Hi all, I am looking at processing a time range of Sentinel-1 images (using Process API), and I am looking at getting an image showing for each pixel the maximum or the minimum value of my time series. I tried to replicate an averaging function by modifying it to min/max, but this does not seem to work: while the band that is supposed to return my average pixels do have data, the min and max bands do not contain any data. Here you can find below such function. I am using Sentinel-1 collection, using ORBIT
tiling.
How should I proceed? I do like to mention that I want to get an image, the Statistical API is not fit for my purpose.
// works!
function calculateAverage(samples) {
var sum = 0
var nValid = 0
for (let sample of samples) {
if (sample.dataMask != 0) {
nValid++
sum += sample.VV
// sum += toDecibels(sample.VV)
}
}
return sum / nValid
}
// does not work.. returns no data.
function calculateMax(samples) {
sampleArray = []
for (let sample of samples) {
if (sample.dataMask != 0) {
sampleArray.push(sample.VV)
}
}
return Math.max(sampleArray)
}
Thanks all!