Hello everyone,
We are trying to download data from Sentinel-5P using the Sentinel Hub Python interface. The problem is that depending on the time interval we give we retrieve images with data or images full of NaN, even though in EO Browser we can check that there is available data for our area of interest.
For instance, if we use the time interval (‘2023-03-01’, ‘2023-03-05’) we retrieve images with data, but if we use the time time interval (‘2023-03-01’, ‘2023-03-06’) we don’t.
I show the code here.
script = """
//VERSION=3
function setup() {
return {
input: {
bands: "CO","dataMask"],
units: "DN"
}],
output: {
bands: 2,
sampleType: "FLOAT32"
}
};
}
function evaluatePixel(sample) {
return sample.CO,sample.dataMask];
}
"""
request_bands = SentinelHubRequest(
data_folder='downloads',
evalscript=script,
input_data=b
SentinelHubRequest.input_data(
data_collection=data_collection,
time_interval=time
)
],
responses=<
SentinelHubRequest.output_response('default', MimeType.TIFF)
],
bbox=bbox,
size=bbox_to_dimensions(bbox, resolution=5000),
config=config
)
request_bands.save_data()
If we open the downloaded mosaic with rasterio, we can see the following for the “valid” time interval:
array(>
90.03337331, 0.03337331, 0.0407076 ],
70.03435842, 0.03435842, nan]],
,<1. , 1. , 1. ],
1. , 1. , 1. ],
1. , 1. , 0. ]]], dtype=float32)
But we can see this with the “invalid” time interval:
array(
nan, nan, nan],
nan, nan, nan]],
an 0., 0., 0.],
0., 0., 0.],
0., 0., 0.]]], dtype=float32)