Skip to main content

Hi all,


I’m trying to extract the metadata of a Sentinel-1 scene. I’ve followed several tutorials and examples, but the userData.json file returned is null every time, which doesn’t happens for Sentinel-2 scenes. I don’t know if I’m missing something or the scenes for Sentinel-1 are different. It’s important to say that the image is from one specific day, not a mosaic.


The evalscript I use is the following:


                //VERSION=3
function setup() {
return {
input: {
bands: "VH", "VV"]
}],
mosaicking: Mosaicking.ORBIT,
output: {
id: "default",
bands: 2
}
};
}

function evaluatePixel(sample) {
return sample.VH, sample.VV];
}

function updateOutputMetadata(scenes, inputMetadata, outputMetadata) {
outputMetadata.userData = { "scenes": scenes.orbits }
}

Hi,


I cannot reproduce your problem: I get a populated userdata file for Sentinel-1, even for a single date using your Evalscript. Would you care to share your payload so we can take a look?


Sure, I attach the rest of the code



time = ('2021-09-26', '2021-09-26')
bbox = (101.298014, 17.297079, 101.347986, 17.343721)

process_requests = list()
request = SentinelHubRequest(
data_folder=data_folder,
evalscript=evalscript,
input_data=[
SentinelHubRequest.input_data(
data_collection=DataCollection.SENTINEL1,
time_interval=time,
mosaicking_order=None
)
],
responses=[
SentinelHubRequest.output_response("default", MimeType.TIFF),
SentinelHubRequest.output_response("userdata", MimeType.JSON),
],
bbox=bbox,
size=bbox_to_dimensions(bbox, 1000),
config=config,
)
process_requests.append(request)

download_client = SentinelHubDownloadClient(config=config)
download_requests = [request.download_list[0] for request in process_requests]
data = download_client.download(download_requests)

Very strange… when I run your code I get the following:


'userdata.json': {'scenes': :{'tiles': :{'date': '2021-09-26T23:08:35Z',
'shId': 2468928,
'tileOriginalId': 'S1A_IW_GRDH_1SDV_20210926T230835_20210926T230900_039859_04B728_9D6F',
'dataPath': 's3://sentinel-s1-l1c/GRD/2021/9/26/IW/DV/S1A_IW_GRDH_1SDV_20210926T230835_20210926T230900_039859_04B728_9D6F'}],
'dateTo': '2021-09-26T23:59:59Z',
'__idx': 0,
'dateFrom': '2021-09-26T00:00:00Z'}]}}

I did modify the code for it to run with:


coords = (101.298014, 17.297079, 101.347986, 17.343721)
bbox = BBox(coords, crs="EPSG:4326")

but asides from this all is the same as you!


Reply