Working with the Batch API to create time-series for S1. Grega shared a notebook with me containing the following evalscript (simplified):
function setup() {
return {
input: ["VV"],
output: [
{id: "VVdB", bands: 1, sampleType: SampleType.FLOAT32},
],
mosaicking: Mosaicking.ORBIT
}
}
function updateOutput(outputs, collection) {
Object.values(outputs).forEach((output) => {
output.bands = collection.scenes.length;
});
}
function updateOutputMetadata(scenes, inputMetadata, outputMetadata) {
var dds = [];
for (i=0; i<scenes.length; i++){
dds.push(scenes[i].date)
}
outputMetadata.userData = { "acquisition_dates": JSON.stringify(dds) }
}
function toDb(linear) {
return 10 * Math.log(linear) / Math.LN10
}
function evaluatePixel(samples) {
var n_observations = samples.length
let array_vv = new Array(n_observations).fill(0)
samples.forEach((sample, index) => {
array_vv[index] = toDb(sample.VV)
});
return {
VVdB: array_vv,
}
}
How could I adjust this to use Mosaicking.SIMPLE
and mosaic every ~6 days into a single image? (Basically to save on PU’s.)
With the Process API and eolearn
, I used time_difference
to achieve this:
s1_input = SentinelHubEvalscriptTask(
features=...,
evalscript=...,
data_collection=...,
time_difference=datetime.timedelta(days=6),
)
Clarification: so it’s clear, I want a time-series/cube, where each sample is a mosaic of six days of imagery.