asfadmin / Discovery-asf_search

BSD 3-Clause "New" or "Revised" License
124 stars 43 forks source link

[Bug/Feature] Frame search for new `ARIA_S1_GUNW` collection #296

Closed cmarshak closed 4 months ago

cmarshak commented 4 months ago

This is an extension of #198.

Want to be able to search using temporal_baseline_days and frame in this ARIA collection. If I use a >=7.0.9, I am able to get the new collections of ARIA-S1-GUNWs:

import asf_search as asf

opts = asf.ASFSearchOptions(
    shortName='ARIA_S1_GUNW',
    maxResults=10,
)
scenes = asf.search(opts=opts)

Here is metadata for a sample product:

{'centerLat': None,
 'centerLon': None,
 'stopTime': '2024-03-16T23:36:26Z',
 'fileID': 'S1-GUNW-A-R-091-tops-20240316_20240304-233600-00074W_00037S-PP-4b33-v3_0_1',
 'flightDirection': 'ascending',
 'pathNumber': 91,
 'processingLevel': None,
 'url': 'https://grfn.asf.alaska.edu/door/download/S1-GUNW-A-R-091-tops-20240316_20240304-233600-00074W_00037S-PP-4b33-v3_0_1.nc',
 'startTime': '2024-03-16T23:35:34Z',
 'sceneName': None,
 'browse': ['https://grfn-public-prod.asf.alaska.edu/S1-GUNW-A-R-091-tops-20240316_20240304-233600-00074W_00037S-PP-4b33-v3_0_1.png'],
 'platform': 'Sentinel-1A',
 'bytes': None,
 'md5sum': None,
 'frameNumber': 14211,
 'granuleType': None,
 'orbit': [53013, 52838],
 'polarization': 'VV',
 'processingDate': '2024-03-26T03:18:06Z',
 'sensor': None,
 'groupID': None,
 'pgeVersion': None,
 'perpendicularBaseline': 70.8606,
 'inputGranules': ['S1A_IW_SLC__1SDV_20240316T233534_20240316T233601_053013_066B21_474E',
  'S1A_IW_SLC__1SDV_20240316T233559_20240316T233626_053013_066B21_F192',
  'S1A_IW_SLC__1SDV_20240304T233534_20240304T233601_052838_06650A_A731',
  'S1A_IW_SLC__1SDV_20240304T233559_20240304T233626_052838_06650A_CD37'],
 'ariaVersion': '3.0.1',
 'fileName': 'S1-GUNW-A-R-091-tops-20240316_20240304-233600-00074W_00037S-PP-4b33-v3_0_1.nc',
 'beamModeType': 'IW',
 's3Urls': [],
 'additionalUrls': []}

So, I know the above product exists. However, when I update the search to include:

import asf_search as asf

opts = asf.ASFSearchOptions(
    shortName='ARIA_S1_GUNW',
    maxResults=10,
    frame=14211
)
scenes = asf.search(opts=opts)

I get no results.

However, I am able to successfully query using temporal baseline:

opts = asf.ASFSearchOptions(
    shortName='ARIA_S1_GUNW',
    maxResults=10,
    #frame=14211,
    temporalBaselineDays=48
)
scenes = asf.search(opts=opts)
SpicyGarlicAlbacoreRoll commented 4 months ago

Hi! Sorry for the late follow up, this is possible with the asfFrame parameter, which queries FRAME_NUMBER directly.

import asf_search as asf

opts = asf.ASFSearchOptions(
    shortName='ARIA_S1_GUNW',
    maxResults=10,
    asfFrame=14211
)
scenes = asf.search(opts=opts)

At the time of writing this should return 10 scenes from the ARIA_S1_GUNW collection.

Explanation:

asf-search and SearchAPI by default map the frame keyword to CENTER_ESA_FRAME, except when searching with platform, dataset, collections that fit under 'SENTINEL-1A', 'SENTINEL-1B', 'ALOS', in which case they implicitly use FRAME_NUMBER instead. asf-search doesn't do this conversion with the shortName keyword at the moment, so CENTER_ESA_FRAME gets passed along instead. Luckily, asfFrame can cover this basis!

cmarshak commented 4 months ago

Thank you.

I didn't quite understand your explanation regarding the translation of CMR metadata in asf_search. But fortunately, that's why I use this library and don't have to sweat too much. Thanks for explaining.

This indeed solves the issue!