Skip to main content

Hi all,

I am currently trying to request Landsat8 data using sentinelhub (3.4.2) and eo-learn (1.0.0) packages in Python.
B10 is requested by simply inputting it in bands (amongst all other bands of L8) and the data collection DataCollection.LANDSAT_OT_L2. However, our processing chain outputs the following error:

https://services-uswest2.sentinel-hub.com/api/v1/process
with HTTPError:
400 Client Error: Bad Request for url: https://services-uswest2.sentinel-hub.com/api/v1/process
Server response: "{"error":{"status":400,"reason":"Bad Request","message":"Invalid script! Band 'B10' of collection 'LOTL2' requested in unsupported units 'KELVIN'! Supported units for this band: [SURFACE_TEMPERATURE]. See https://shforum.sinergise.com/t/units-improvements/4442 for more information.","code":"RENDERER_EXCEPTION"}}"

As displayed in the units section of the Landsat8 documentation, B10 default unit should indeed be SURFACE_TEMPERATURE but the DataCollection.LANDSAT_OT_L2 specifies Band(name='B10', units=(<Unit.KELVIN: 'KELVIN'>,), output_types=(<class 'numpy.float32'>,)).

First of all, since the 0.10.0 update, shouldn’t the KELVIN unit be changed to SURFACE_TEMPERATURE in the default data collection?

Second, I tried to modify the collection by forcing the B10 unit to be SURFACE_TEMPERATURE. I followed this post and made the following code :

Code

from sentinelhub import DataCollection, Band, Unit
from eolearn.io import SentinelHubInputTask
from eolearn.core import FeatureType

# making a specific data collection from L8 with unit changes for B10
fixed_bands = =]
for band in DataCollection.LANDSAT_OT_L2.bands:
if band.name == 'B10':
fixed_band = Band('B10', (Unit.SURFACE_TEMPERATURE,), (np.uint16,))
fixed_bands.append(fixed_band)
else:
fixed_bands.append(band)

fixed_collection = DataCollection.LANDSAT_OT_L2.define_from(
'LANDSAT_OT_L2_fixed',
bands=fixed_bands
)

# defining tasks
tasks = =]

download_task = SentinelHubInputTask(data_collection=fixed_collection,
bands_feature=(FeatureType.DATA, 'BANDS'),
resolution=resolution,
maxcc=maxcc,
bands=band_names,
time_difference=datetime.timedelta(hours=time_difference),
additional_data=additional_data_extended,
config=sh_config
)

tasks.append((download_task, 'download_task'))

(code non complete, after that the workflow is linearly connected to other tasks and executed)
But this outputs another error: AttributeError: SURFACE_TEMPERATURE, meaning Unit.SURFACE_TEMPERATURE does not exist, which was confirmed by looking for it in the Unit class (nothing similar exists either).
What unit should I use for B10, then?

Thank you for reading this post!
Kind regards,
 

Hi,

Thanks for bringing this to our attention.

We plan to release new SH-py version tomorrow that will fix this issue. If you cannot wait, you will have to add SURFACE_TEMPERATURE to the Unit enum in the sentinelhub/data_collections_bands.py file, and then use the code you have pasted above.

Best regards,
 


Hi,
Thanks for your quick answer! We’ll gladly wait for the new update and test that afterwards.
Also, a quick side observation in case you didn’t know yet: for LANDSAT_OT_L2, the dataMask is a data feature and not a mask feature. Something similar happened with S1 before being changed, thus why I’m pointing that out now. (:
Kind regards,


Hi,

Sentinelhub-py v3.4.4 has just been released and it fixes the Landsat surface temperature bands.

Download task:

download_task = SentinelHubInputTask(
data_collection=DataCollection.LANDSAT_OT_L2,
bands_feature=(FeatureType.DATA, 'BANDS'),
resolution=(40,40),
maxcc=0.9,
time_difference=dt.timedelta(hours=1),
additional_data=[(FeatureType.MASK, 'dataMask')]
)

now works as expected and does not produce any errors.

Regarding the feature type of dataMask, see the snippet above: you have to request dataMask in the additional_data parameter, and specify the feature type accordingly.

Best,


Hi,

Thanks for the update! The new version 3.4.4 works perfectly for B10, thanks.
As for dataMask, my bad! The error was coming from a part of a self-made code. Thank you for your assistance!

Have a good day,


Reply