nasa / python_cmr

Python library for querying the common metadata repository.
MIT License
24 stars 22 forks source link

how to identify the different types of data links from a GranuleQuery #26

Closed tjhearty closed 4 months ago

tjhearty commented 10 months ago

How can I get a list of data, S3, or opendap urls from a GranuleQuery?

I currently do the following to get the different types of URLs:

First, get the list of all entry URL links returned by granule metadata

all_links = [entry['links'] for entry in gran_met]

Next, get just the granule URL links, exclude inherited links (i.e. from collection metadata).

gran_links = [link for group in all_links for link in group if 'inherited' not in link.keys()]

From there I can search for string in the 'title' or 'rel' to identify the data, S3, or opendap urls? Is there another way to get a list of the different types of urls?