Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotting a time series of Level 2 Data from Multiple Granules #19

Open
tjhearty opened this issue Mar 28, 2023 · 2 comments
Open

Plotting a time series of Level 2 Data from Multiple Granules #19

tjhearty opened this issue Mar 28, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@tjhearty
Copy link
Contributor

The jupyter notebook on "How to Find and Plot Level 2 Data from Multiple Granules on a Map using Python" can be modified to create a new How-To document that might be titled "How to Find and Plot at time series Level 2 Data from Multiple Granules using Python".

@battistowx battistowx added the enhancement New feature or request label Mar 28, 2023
@tjhearty tjhearty self-assigned this Jul 8, 2024
@battistowx battistowx added this to the v2024.10.01 milestone Jul 25, 2024
@battistowx
Copy link
Collaborator

Hey @tjhearty ,

I like the state of the notebook so far! I do have some suggestions, before I can make formatting edits:

  1. For the get_CMRgranurls function, lets make it so that it only returns the HTTPS urls. This will make it a bit more readable and will avoid issues where users will try to grab the S3 URLs when not in us-west-2.
  2. Let's replace the wget call with requests. I want to make it so that non-Python methods are not used when downloading granules in Jupyter Notebooks. Here's some code that can be used instead, which will work if a .netrc file is present:
datadir = 'granules'
os.makedirs(datadir, exist_ok=True)

with open('dataurls.txt', 'r') as file:
    urls = file.readlines()

for url in urls:
    url = url.strip()
    filename = os.path.join(datadir, os.path.basename(url))
    if not os.path.exists(filename):
        response = requests.get(url)
        with open(filename, 'wb') as f:
            f.write(response.content)

Great work so far! Thanks for taking this project up.

@battistowx
Copy link
Collaborator

battistowx commented Sep 3, 2024

Suggestions from meeting on 9-2-24:

  • Add requests, remove wget
  • Make cmrgranurls() function only return one data access method (OPeNDAP or https)

We will turn the existing notebook into a use case notebook, and will have another notebook that is a more streamlined version to serve as a how-to.

@battistowx battistowx modified the milestones: v2024.10.01, v2025.01.01 Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants