Hi,
I am trying to compile monthly NO2 composites with average values for available data from Sentinel-5P data with a custom script.
I was using this example as a starting point:
docs.sentinel-hub.com
Examples for S1GRD
Use these CURL and Postman examples to access Sentinel-1 GRD data with Sentinel Hub Processing API.
According to this documentation, I expected to receive one value per day with “ORBIT”:
docs.sentinel-hub.com
Evalscript V3
Evalscript V3 is a powerful tool for imagery visualization, multitemporal scripting, datafusion, scene filtering, etc.
And according to this, that should also work for Sentinel-5P-L2:
docs.sentinel-hub.com
Sentinel-5P L2
Use Sentinel Hub API to access Sentinel-5P level 2 (L2) data products CH4, CLOUD, CO, AER, SO2, O3, NO2, and HCHO.
However, when I am providing a time interval over one month, it seems like I am still just getting the average of one day (which is the same as the image from that day). Here is my eval_script:
function setup() {
return {
input: ["NO2", "dataMask"],
output: [
{ bands: 1, sampleType: "FLOAT32" }
],
mosaicking: Mosaicking.ORBIT
}
}
function calculateAverage(samples) {
var sum = 0;
var nValid = 0;
for (let i = 0; i < samples.length; i++) {
var sample = samples[i];
if (sample.dataMask != 0) {
nValid++;
sum += sample.NO2;
}
}
return sum/nValid;
}
function evaluatePixel(samples) {
return [calculateAverage(samples)]
}
Can anyone point me to my error in the code or logic?
Thanks!
