Hi, some years ago I made a script to download Planet data based on aSentinelHub tutorial based on Example 8
It downloads all planet images available for the date range, but if there is no data (so no satellite flew over for that date) it gives me an “empty” file over the same extent. I say “Empty” because it returns NaN for the cloud masking part based on UDM2_Clear but it does give each pixel a value per band, which can add up in larger extents. Here is the evalscript:
evalscript_true_color = """
//VERSION=3
function setup() {
return {
input: [{
bands: ["Red", "Green", "Blue", "NIR", "UDM2_Clear"]
}],
output: {
bands: 4
//sampleType: "FLOAT32"
}
};
}
function evaluatePixel(sample) {
// Scale the bands
var scaledBlue = [2.5 * sample.Blue / 10000];
var scaledGreen = [2.5 * sample.Green / 10000];
var scaledRed = [2.5 * sample.Red / 10000];
var scaledNIR = [2.5 * sample.NIR / 10000];
if (sample.UDM2_Clear != 0) {
return [
scaledRed,
scaledGreen,
scaledBlue,
scaledNIR
]
} else {
return [NaN, NaN, NaN, NaN]}
}
The issue is that this fills my memory when downloading many years of data. Is there a way to exclude those empty dates in the evalscript part? I use the same
print("Monthly time windows:\n") for slot in slots: print(slot)
part as in the example.