Skip to main content

To get near infrared band reflectance values for S2 and L8 and I setup the S2 NIR layer JS script as: return [B08];

The pixel values show as min of 0 and max of 0 for the NIR band when I open in ArcMap…


s2r5 = WcsRequest(data_source=DataSource.SENTINEL2_L1C,

layer=‘S2NIR’,

bbox=taber,

time=(‘2017-04-01’, ‘2017-06-01’),

resx=‘10m’, resy=‘10m’,

maxcc=0.1,

instance_id=‘my-instance’,

image_format=MimeType.TIFF_d32f,

data_folder = ‘C:/POC/S21’,

custom_url_params={CustomUrlParam.ATMFILTER: ‘ATMCOR’,

CustomUrlParam.TRANSPARENT: True,

CustomUrlParam.SHOWLOGO: False,

CustomUrlParam.QUALITY: ‘100’,

CustomUrlParam.PREVIEW: ‘0’,

CustomUrlParam.UPSAMPLING: ‘NEAREST’,

CustomUrlParam.DOWNSAMPLING: ‘NEAREST’,

CustomUrlParam.BGCOLOR: False})


s2r5.save_data()

os.listdir(s2r5.data_folder)

Can you provide first part of the instance ID, so that we check logs?

Generally I suggest you check:


  • Are you accessing services.sentinel-hub.com or services-uswest2.sentinel-hub.com? First one should be used for Sentinel data and second one for Landsat (and MODIS)

  • Does the instance you are using, contain at least one layer with Sentinel-2 L1C data source?

  • Are there actually Sentinel-2 data available in your AOI (taking into account also the time range and cloud coverage filter)

return[B08];

is certainly the right script


First part of my instance ID for this call is: a8e40cd4-


Yes to all of your questions.


I think I was told if I specify data source (data_source=DataSource.SENTINEL2_L1C), it’ll override the endpoints and correctly set it to… Do I need to manually update all/every L8 layer (“Advanced layer editor”) to services-uswest2.sentinel-hub.com?


Your S2NIR layer was set to “Sentinel-2 L2A”, not “Sentinel-2 L1C” (bullet 2 above). As you were querying for data outside of Europe, there were no results found. I changed this now to L1C.


Then there is another error in your set-up as the service gets WCS calls with VERSION=1.3.0 set, which is not supported. You should set it to 1.1.0 (I am not familiar with the Python package so I cannot help you with that one)


Thanks, those are good catches. I didn’t think it would set like that! Should I still create a separate instance for S2 and another for other data sets just to be on the safe side?

Appreciate your prompt help! 🙂


Where do you set WCS version to 1.1.0?


WCS version is hardcoded in the Python package and it is not meant for users to change it.


However I noticed that the package incorrectly requesting WCS version 1.3.0. Fortunately this is not causing any problems to Sentinel Hub services as they simply use default WCS version 1.1.2 instead. We have been making WCS requests with sentinelhub-py for months and all requests were executed correctly. Hence this minor issue in sentinelhub-py is not the reason for any problem. (We will still fix it in next version.)


I need few more help:



  1. Setting “Full” atmospheric correction on S2 L1C data, will default from Sen2Cor to ATMFILTER, and setting ATMFILTER on L8 will default to DOS1 or no correction applied? is it possible to implement DOS1 on L8? Is the order: Sen2Cor > ATMFILTER > DOS1 > No? Any studies/analyses comparing Sen2Cor to ATMFILTER or DOS1? I believe by default both S2 and L8 are in TOA values.




  2. Do I need to edit and set the endpoint to services-uswest2.sentinel-hub.com endpoint for ID, WMS, WMTS, WFS, WCS of the configuration (Advanced Editor > “@id”)? Or just by specifying the datasource (non-S2 or S2), the code knows where to correctly point it to? I can edit the URL in the service end-point but it doesn’t seem to save (saves when I click save, but reverts to original when I refresh the browser)…




  3. Is it possible to get the S2 TileID or L8 PathRow in the download file name?




  4. L8 products are @ 30m by default and so when I set “res” (x, y) @ 15m for NDVI I guess it will have some implications due to resampling? So by setting res @ 30m, am I getting the L8 data as-is?




I don’t know much about atmospheric corrections and which one is used for L8, but I can answer the remaining questions:



  1. No, there is no need to set uswest url in either Configurator’s advanced editor or sentinelhub-py config file. The Python package automatically replaces standard base url with uswest if you specify a correct source to data_source parameter. The uswest url only has to be used whenever you manually construct a WMS/WCS url request.




  2. If you are using sentinelhub-py you can get names of tiles, used in your request, like this:


    request = WcsRequest( ... )
    tiles = list(request.get_tiles())

    However you must be aware that Sentinel Hub services may join multiple spatially adjacent tiles to construct images. Therefore there might be more tiles than images.




  3. Yes, if you request products in their original resolution you will get them without any spatial resampling applied.

    Of course if you request data in CRS that is not equal to original CRS of tiles or if your bbox coordinates are not aligned with original tile grid, there will be still some interpolation applied due to reprojection.




Reply