S1 CARD4L requests

Ok finally getting back to this. I read through some of the docs, looked at the request builder, and tried out the example you linked above. I also setup a configuration for processing Sentinel-1 in our account (which I think you can find that – there is only one of them). When I use the “SHConfig()” function I specify the “instance_id” of the configuration.

Several problems arrise:

  1. processing units used is way more than expected (like 3 pu per request for a small boundary – see below). I expected something like 0.01 pu.
  2. Returned data doesn’t make sense in multiple ways. I specify I want a geotiff (.TIFF) bytestring but it’s returning a numpy array, and the size is weird (it’s a square shape when my bbox is rectangular). I don’t really understand why the “SentinelHubRequest” has a “size” input when the bbox and processing functions selected for S-1 determine the size.
  3. I’ve already specified a configuration (the instance_ID noted above). Why can’t I just send a boundary and date range and get back all the processed imagery available for S-1 in that range using the processing setup in my configuration? It seems this requires me to specify the eval script and input_data which I shouldn’t have to since the endpoint has already got the configuration specified.

Thanks.

request=SentinelHubRequest(
    evalscript="""
    return [VH*2]
    """,
    input_data=[
      SentinelHubRequest.input_data(
        data_collection=DataCollection.SENTINEL1_IW,
        time_interval=('2019-11-05', '2019-12-03'),
      )
    ],
    responses=[
      SentinelHubRequest.output_response('default', MimeType.TIFF)
    ],
    bbox= BBox(bbox=[-93.776497, 42.016923, -93.769195, 42.019745], crs=CRS.WGS84),
    config=configs
  )

response = request.get_data()

Where did you find this 3PU per request? Looking at the process API requests done on your account today, there were 3 requests around 7:30 CET, each consuming 0.083 PU.

I will ask someone from our sh-py team to help you with 2. and 3.

Thanks – under usage then under the OGC Requests I’m seeing 7.92 PU over the last 24 hours which was all via me calling the API. I did make 3 requests as you say…but strangely that’s just the OAuth client ID. My endpoint from the configuration utility (the other two instance IDs that show 7 and 16 requests with 2 and 8 PUs are the one I created and used with the SHconfig, along with also the oauth ID). Something appears to be happening that’s not very transparent to me.

instanceId dateTime requests processingUnits;
f2924fc9-… 2022-01-16T06:00Z 3 0;
02fec5c6-… 2022-01-16T06:00Z 7 2;
02fec5c6-… 2022-01-16T05:00Z 16 5;

Hi John,
the requests you are making with the code above are going to processAPI and are related to OAuth client ID. The second set are some WMS requests that you (or somene else knowing your instance ID) is making in parallel.

Perhaps best to delete the instance ID in the Configuration utility and run the code again

1 Like

Hi @justjohnp,

Here are the answers for questions 2. and 3.:

  1. Returned in-memory data will by default be in the form of numpy arrays. But you can provide data_folder parameter and call request.get_data(save_data=True) which will also save GeoTIFF images to disk. More about this in the docs.

    Bounding box and processing functions are not enough to define the size/resolution of your image. This is especially important in WGS 84 where due to the nature of the projection images never have a constant resolution. Therefore users have to provide either size or resolution parameter according to definitions in the docs.

  2. The service and the basic SentinelHubRequest class do not assume that a user would want all images from a time range. But you can achieve that by combining these requests with a Catalog API request like it is shown in this example.

Hi Matej – can you suggest a way to specify the resolution or size? I see both of those are a tuple, but when I’ve process S-1 or S-2 imagery with SNAP it has output a set resolution (10m per pixel) without me having to specify anything in that regard. I know adding multi-looking or filtering can reduce S-1 resolution, but I’ve never had to “define” it – can you clarify for me?

Parameters resolution and size are tuples so that you can specify the values for x and y dimensions separately. The problem with resolution parameter is that it has to be specified in units of the CRS that you are working in. So you have 2 options:

  • Because you are working in WGS 84 you have to calculate approximately how much latitude and longitude degrees is 10 meters for your bounding box and use those values.
  • Convert your bounding box to a UTM CRS where units are meters and then use parameter resolution=(10, 10).

I recommend the 2nd option because working in UTM will ensure that your entire bounding box will have the same resolution.

1 Like