Skip to main content

Aggregated time series for Sentinel 1

  • April 26, 2024
  • 1 reply
  • 109 views

Hi everyone!
Im trying to obtain the statistics from S1 (mean OF VV, VH and incidence angle) for Many polygons in a shapefile…Im only getting VV values, I cant obtain VH =(, and even in the examples I dont find any about this.
Im using the following script:
early_time_interval = ‘2020-01-01’, ‘2020-01-31’
evalscript = “”"
//VERSION=3
function setup() {
return {
input: [{
bands: [
“VV”,
“dataMask”
]
}],
output: [
{
id: “output_VV”,
bands: 2,
sampleType: “FLOAT32”
},
{
id: “dataMask”,
bands: 1
}]
}
}
function evaluatePixel(samples) {
return {
output_VV: [samples.VV],
dataMask: [samples.dataMask]
}
}
“”"
aggregation = SentinelHubStatistical.aggregation(
evalscript=evalscript,
time_interval=yearly_time_interval,
aggregation_interval=‘P12D’,
resolution=(10, 10)
)

input_data = SentinelHubStatistical.input_data(
DataCollection.SENTINEL1_IW
)

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)),
config=config
)
vv_requests.append(request)

Followed by:

%%time

download_requests = [vv_request.download_list[0] for vv_request in vv_requests]

client = SentinelHubStatisticalDownloadClient(config=config)

vv_stats = client.download(download_requests)

len(vv_stats)

It works for VV, but when I try to get VH(replacing correctly at the script) it is coming with NaN values…
Maybe do you know the reason?

Thank you very much!

1 reply

Hello everyone!
just solved it for me, the request was like:
“”"
//VERSION=3

function setup() {

return {

input: [{

bands: [

"VV","VH",

"dataMask"

]

}],

output: [

{

id: "bands",

bands: ["VV","VH"],

sampleType: "FLOAT32"

},

{

id: "dataMask",

bands: ["dataMask"]

}]

}

}

function evaluatePixel(samples) {

return {

bands: [samples.VV, samples.VH],

dataMask: [samples.dataMask]

}

}

“”"

Now it is working fine =)