Hello!
We are trying to understand how could we build a script for Statistical API that leverages data fusion to combine two satellites but also a different day for each of those.
To be more specific, we would like for that script to combine data from Sentinel 2 L2A from a specific day with data from Planet from the next day (e.g. Jan 3 Sentinel 2 + Jan 4 Planet)
One way we thought it could work was building the data and aggregation payloads like this:
"data": [
{
"dataFilter": {
"timeRange": {
"from": "2023-01-03T00:00:00Z",
"to": "2023-01-04T23:59:59Z"
}
},
"id": "l2a",
"type": "sentinel-2-l2a"
},
{
"dataFilter": {
"timeRange": {
"from": "2023-01-04T00:00:00Z",
"to": "2023-01-05T23:59:59Z"
}
},
"id": "planet",
"type": "byoc-***"
}
]
"aggregation": {
"timeRange": {
"from": "2023-01-03T00:00:00Z",
"to": "2023-01-05T23:59:59Z"
},
"aggregationInterval": {
"of": "P1D"
},
"width": 512,
"height": 733.85
}
The evaluate function pixel right now is just returning some bands to check:
function evaluatePixel(samples) {
const l2a = samples.l2a
const planet = samples.planet
const B11 = l2a[0].B11
const l2aDataMask = l2a[0].dataMask
const NIR = getPlanetReflectanceUnit(planet[0].NIR)
const RedEdge = getPlanetReflectanceUnit(planet[0].RedEdge)
const planetDataMask = planet[0].dataMask
return {
l2a: [B11],
planet: [NIR, RedEdge],
dataMask: [l2aDataMask, planetDataMask],
}
}
But this is not working as expected. So to be sure, a couple of questions about this:
- When using Stats API, do time ranges within
dataFilter
in thedata
array work? - If we expand the aggregation time range to whole Jan month, we get two interval outputs, one for Jan 3 and one for Jan 8. This matches the dates S2 has available, why is it outputting only those? Should both satellites be present in a day to get a stats output for said day?
- If by default mosaicking
SIMPLE
is set, why are we accessing a band like thissamples.l2a[0].B11
? What does the l2a array contain?
After more reading, we think that we should use mosaicking ORBIT
and maybe preProcessScenes
as well to filter out the exact dates we want for each satellite. Any ideas how we should approach this?
Are there any examples using Statistical API + Data Fusion + mosaicking ORBIT
or TILE
? We’ve read many docs and watched the webinars, but yet haven’t found anything.
Thanks in advance!