Quantcast
Channel: Earthdata Forum
Viewing all articles
Browse latest Browse all 1307

Home • Get only the latest version of a granule with earthaccess.search_data()

$
0
0
Hi there,

I am working with the SWOT Water Mask Pixel Product (PIXC). I am accessing and downloading granules locally as shown here using earthaccess.search_data() in a Jupyter notebook: https://podaac.github.io/tutorials/notebooks/datasets/SWOTHR_localmachine.html#water-mask-pixel-cloud-netcdf

Is there a way to only retrieve the latest version of each granule? For example, when I use the following search, I get two granules (_02 and _03) for SWOT_L2_HR_PIXC_018_298_080L_20240720T131306_20240720T131317_PIC0.

pixc_results = earthaccess.search_data(short_name = 'SWOT_L2_HR_PIXC_2.0',
temporal = ('2024-05-01 00:00:00', '2024-08-05 23:59:59'),
granule_name='*_298_080L_*')

I checked the docs for the API, but I don't see a kwarg for this:
https://earthaccess.readthedocs.io/en/stable/user-reference/api/api/#earthaccess.api.search_data

Is there an easy way to filter my results before download?

Thank you,
Fiona

Statistics: Posted by fbennitt — Mon Aug 05, 2024 5:08 pm America/New_York



Viewing all articles
Browse latest Browse all 1307

Trending Articles