Skip to main content

Hi! I am trying to get thermal data from the Landsat-8 Level 2 Collection using the script you provide:


    //VERSION=3

function evaluatePixel(samples) {
return [samples.B10, samples.dataMask];
}

function setup() {
return {
input: [{
bands: [
"B10",
"dataMask"
]
}],
output: {
bands: 2, sampleType:"FLOAT32"
}
}
}

But both the preview in the dashboard configuration and the response give back files with no data. What am I missing? Thank you!

Hi! I have tested your evalscript and it works absolutely fine for me. Are you able to provide the AOI and the time range you were searching for? I suspect that this could be why you are returning no data in your return. Landsat 8 has a revisit period of 16 days so it could be that there was no acquisition in the time range that you were searching.

All the Best,

 


Hi, I also suspect the problem is within my code, using the custompara:geometry. This is the code I am using:

request_LST = WmsRequest(
data_folder=save_dir,
layer='LST',
data_collection=DataCollection.LANDSAT8_L2,
time=(start_date, end_date),
maxcc=0.05,
image_format=MimeType.TIFF,
bbox=box,
width=width,
custom_url_params={CustomUrlParam.GEOMETRY: geometry},
config=config
)
request_LST.save_data()

With the following params:

start_date =  '2020-01-01'
end_date = '2021-01-01'
geo = json.load(f)['features']
box = BBox(bbox=shape(geo[0]['geometry']).bounds, crs=CRS.WGS84).buffer(buffer)
geometry = shape(geo[0]['geometry'])

Using this AOI as a geojson file

AOI_epsg4326.kml (966 Bytes)


Forgot to mention I am doing the exact process for the NDMI and NDVI layers and it works perfectly. Thanks!


Hi! We have found the fix for your issue. There was nothing wrong with your eval script. If you try running it now it should work without any issues.


Let us know if there are any further issues and we can try and solve them.


William


Hi again. I tried to run it and it still gives me a tiff with only nan values…


Hi! Sorry had missed this reply. Can you share the code eval script and request you are using again please?


Reply