Hi Guys!
Im trying to request S1 and S2 data using the same evalscript, mentioned here:
So, my script looks like:
yearly_time_interval = ‘2020-01-01’, ‘2020-01-15’
evalscript = “”"
//VERSION=3
function setup() {
return {
input: [{
datasource: "S1GRD_A",
bands: ["VV"]
},
{
datasource: "S2L2A",
bands: ["B04", "B08"]
}
],
output: [{
bands: 3
}]
}
}
function evaluatePixel(samples) {
var s1 = samples.S1GRD_A[0]
var s2 = samples.S2L2A[0]
return [s1.VV, s2.B04, s2.B08]
}
"""
aggregation = SentinelHubStatistical.aggregation(
evalscript=evalscript,
time_interval=yearly_time_interval,
aggregation_interval='P6D',
resolution=(20, 20)
)
input_data = SentinelHubStatistical.input_data(
DataCollection.SENTINEL1_IW,
)
# histogram_calculations = {
# "output_VV": {
# "histograms": {
# "default": {
# "nBins": 20,
# "lowEdge": -5.0,
# "highEdge": 40.0
# }
# }
# }
# }
vv_requests = []
for geo_shape in polygons_gdf.geometry.values:
request = SentinelHubStatistical(
aggregation=aggregation,
input_data=[input_data],
geometry=Geometry(geo_shape, crs=CRS(polygons_gdf.crs)),
# calculations=histogram_calculations,
config=config
)
vv_requests.append(request)
However, I dont know how to set the input data parameter, since it only accepts one argument…In my understanding, I should put S1 and S2 there…
So, is it currently possible to bring both, S1 and S2 data at the same eval?
I only want the mean values for my polygons, I dont have the intention to fill cloud gaps with S1 values, for instance…
Finally, congratulations on the amazing service shub is doing =)
Thank you all =)