Sentinel 2 loading issue - SCL Band
Closed this issue · 4 comments
The AWS Element 84 STAC index recently changed the Sentinel 2 data schema to no longer contain the SCL band. This results in loading errors when utilizing the load_ard function from datahandling.py because the current implementation requires the SCL band.
Is it possible to remove the SCL band requirement from the load_ard function?
AWS Element 84 STAC Specification : https://stacindex.org/catalogs/earth-search#/43bjKKcJQfxYaT1ir3Ep6uENfjEoQrjkzhd2?t=3
Hi @BrandonFeldhaus, I'm not aware that the SCL band is removed. I can see it in the STAC catalog. This error could mean that no data is found. Are you able to share the command that generates this error?
The command that generates this error is
# Set the vegetation proxy to use
veg_proxy = 'NDVI'
# veg_proxy = 'EVI'
# Define area of interest
lat = 36.879827
lon = -76.288891
lon_buffer = 0.05
lat_buffer = 0.05
# Set the range of dates for the analysis
time_range = ('2019-01', '2019-12')
# Combine central lat,lon with buffer to get area of interest
lat_range = (lat-lat_buffer, lat+lat_buffer)
lon_range = (lon-lon_buffer, lon+lon_buffer)
# Create a reusable query
query = {
'y': lat_range,
'x': lon_range,
'time': time_range,
'measurements': ['red', 'green', 'blue', 'nir'],
'resolution': (-20, 20),
'output_crs': 'epsg:6933',
##'group_by':'solar_day'
}
# Load available data from Sentinel-2
ds = load_ard(
dc=dc,
products=['s2_l2a'],
mask_filters=[('opening', 3),('dilation', 3)],
**query,
)
Its odd, the SCL band is not specified in the band measurements on the STAC site but it is within then json item assets. I have since updated the product and indexed again but still receive the key error for SCL when loading. I did notice the casing of the band name is now lowercase. Could this be causing the issue?
I have confirmed the issue was with the casing for sentinel 2 data. I was able to modify the package locally to retrieve the band "scl" instead of "SCL" which resulted in successful loading of the data.
I have confirmed the issue was with the casing for sentinel 2 data. I was able to modify the package locally to retrieve the band "scl" instead of "SCL" which resulted in successful loading of the data.
@BrandonFeldhaus Glad to hear that you've solved the problem. I assumed you are using the data through DEAfrica sandbox, which should not have this problem, but looks like you have indexed the data yourself. Great that you are able to use our package. Worth noting that we are working on migrating to use the new Element84 collection 1 Sentinel-2 data (https://stacindex.org/catalogs/earth-search#/5WpJuuvfexLDmorjkAGQ8X6oLkYtawu8NG3NGezU?t=3). The new collection will have an offset so we will be updating relavent tools including load_ard() to work with the new collection. No defined timeline yet and it is possible that the function will be backward compatible to work with current product in the short term.