Orbit number to add into output/ DEM year/month of acquisition


#1

Hi,

Is it possible to include relative orbit number into the output string of Sentinel 2 L1C products, when downloaded with python package? So that a user could download only scenes from certain orbit?

Also, do you know the year/month for the DEM used for orthorectification of Sentinel2 products?

Teo


#2

Hi Teo,
it is currently not possible to search by orbit as we kind of believe that most people do not know/care about it.

For the DEM. According to the User guide PlanetDEM, which is mostly based on SRTM, which was acquired in 2000.


#3

Hi Grega/Matej,

Do you know if it would be possible to add e.g. a letter/digit into an output name that would simply distinguish between acquisitions from sentinel 2B and 2A?

Teo


#4

Hi Teo,

in sentinelhub Python package it is possible to get info about each tile that will be used for your WmsRequest or WcsRequest. In the process of providing data Sentinel Hub services might join multiple tiles together into single image. However it is possible for user to filter obtained images by orbit. Here is the basic idea:

request = WmsRequest(...)  # WMS or WCS request

wfs_iterator = request.get_tiles()
for tile_info in wfs_iterator:
    print(tile_info)  # info about each tile provided by WFS service
    print(tile_info['properties']['id'])  # this should specify the name of the orbit
    print(tile_info['properties']['date'], tile_info['properties']['time']  # exact acquisition time

images = request.get_data()  # Images
dates = request.get_dates()  # List of acquisition times of these images in the same order as images

# By comparing acquisition times from `dates` and acquisition times from `wfs_iterator` user
# can now filter `images` by desired orbit

Currently user will still have to download all images and then filter them by orbit. In the next version of the package we plan to add an option to filter images (by index) before the download.


#5

P.S.

In the code above orbit name tile_info['properties']['id'] will be in a form e.g.
“S2A_OPER_MSI_L1C_TL_SGS__20180131T143733_A013633_T32VNK_N02.06”.

Hence orbit of Sentinel-2 A will start with “S2A” and orbit of Sentinel-2 B will start with “S2B”.


#6

Thanks! I will give it a try. Yes that makes sense.

That won’t ever appear in the wcs request in this form though? : wcs_B88_EPSG32632_423141.785505… .tiff (e.g. wcs_S2A_… .tifff)?

Teo


#7

Great, I hope it works.

Info about S2A/S2B won’t appear in the image file name as it is not a parameter specified by user. Also, by specifying a large enough time_difference parameter of WmsRequest/WcsRequest, it is even possible to get an image composed of both S2A and S2B data.


#8

Thanks Matej! My goal is to only download scenes for either S2A or S2B, not for both at once, hence the question - if there is an option to specify S2A or S2B option for Wcs/Wms requests.


#9

There is no parameter to simply specify which of the two satellites data will come from.

However if you leave time_difference parameter unchanged each image will be either from S2A or from S2B and not both. So with the approach described above you will be able to determine which image came from which satellite and use only those.
At the moment you would still have to first download all images and then filter them. However the next version of sentinelhub package (released probably by the end of this week) will have an option to specify by index exactly which images (out of all available) will be downloaded.

Best regards,
Matej


#10

Sounds good! Thanks Matej!


#11

Hi Matej, Grega,

Is there a way to extract / display the relative orbit number in the downloaded file? (Sentinel 2A and 2B)

Teo


#12

Hi Teo,

it is possible for user to access names of files before they are downloaded and change them. I have just now released a new package version 2.1.1 where this can be done a bit nicer than before.

Basically once you determine which satellite each image will be taken from (as discussed in previous posts), you can change the names like this:

request = WmsRequest(...)

for download_request in request.get_download_list():
    old_filename = download_request.filename
    new_filename = 'S2A_{}'.format(old_filename)  # create new name
    download_request.set_filename(new_filename)

request.save_data()

By the way, since the version 2.1.0 it is also possible to specify which images will be downloaded. E.g.:

request.save_data(data_filter=[0, 2, -1])

This will download only 1st, 3rd and last image of your request.


#13

Hi Matej,

It is possible though to have images from the same satellite e.g S2A but from two different neighbouring orbits. Will I be able to specify one orbit only? The goal is to use a specific orbit only.

Teo


#14

Yes, if you join instructions from my previous posts you will be able to do that. But, as you can see, the solution will require some coding at your end as well. There is no simpler way than that.

Let me know if you run into any problems during the implementation.


#15

Hi Matej,

From the above, it is not possible to find the relative orbit (only an absolute one). I know that absolute orbit can be changed to relative orbit (1-143) but it’s not always reliable. Can you find the relative orbit number through the request?


#16

In that case you could for each tile read the URL path to its location at s3 bucket and read the productInfo.json file from there.

from sentinelhub import get_json

...
wfs_iterator = request.get_tiles()
for tile_info in wfs_iterator:
    tile_url = tile_info['properties']['path']  # E.g. s3://sentinel-s2-l1c/tiles/32/V/NK/2018/6/17/0
    
    product_info_url = '{}/productInfo.json'.format(tile_url)
    
    product_info = get_json(product_info_url)
    
    print(product_info['name'])  # This is product ID which contains relative orbit number
    #  E.g. S2A_MSIL1C_20180617T104021_N0206_R008_T32VNK_20180617T125156

For now none of our services directly outputs relative orbit number so the only way is to read it from s3. In order to download productInfo.json from s3 using sentinelhub package (in code above) you will first have to set your AWS keys as described in configuration instructions.


#17

Hi Matej, am I right that to get that, I need to create my own AWS account (S3) that is a paid service?


#18

Yes, you need an AWS account but the price of such requests is really minimal as you only have to request for small json files. price list

More about this was discussed in the following topic:


#19

Correction: I just noticed productInfo.json will actually also remain available publicly. So you won’t need AWS account.

In order to do this you would just have to change s3 url to http url in code:

from s3://sentinel-s2-l1c/tiles/32/V/NK/2018/6/17/0
to http://sentinel-s2-l1c.s3-website.eu-central-1.amazonaws.com/#tiles/32/V/NK/2018/6/17/0