Skip to content

Query for one product using producer_granule_id? #302

Answered by betolink
scottstanie asked this question in Q&A
Discussion options

You must be logged in to vote

@scottstanie no worries, the documentation needs a lot of work. For this use case you could do something like...

import earthaccess

# this will use environment variables, or a netrc if not found it will ask us for our EDL credentials
auth = earthaccess.login()
s3_credentials = earthaccess.get_s3_credentials("ASF")

results = earthaccess.search_data(short_name="SENTINEL-1A_SLC",
                                  granule_name="S1A_WV_SLC__1SSV_20190201T001401_20190201T002532_025728_02DC1A_8582")
# technically we will get only one result back 
s3_links = [g.data_links(access="direct")[0] for g in results]
s3_links

And then you could use the S3 credentials with other libraries we want to use…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@scottstanie
Comment options

@betolink
Comment options

Answer selected by scottstanie
Comment options

You must be logged in to vote
2 replies
@jhkennedy
Comment options

@betolink
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants