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,