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

Fix MERRA-2 access #630

Merged
merged 13 commits into from
Feb 20, 2024
Merged

Fix MERRA-2 access #630

merged 13 commits into from
Feb 20, 2024

Conversation

jlmaurer
Copy link
Collaborator

This PR updates the calls to the MERRA-2 API, which seem to keep changing...

Description

  • updated API calls to the GES DISC
  • updated the rest of merra2.py module to reflect the changes in variable types and names
  • replaced some outdated NETCDF4 writing and reading routines with calls to xarray

Motivation and Context

MERRA-2 was not working due to recent changes to the API, which involved both a change in the dataset short name and a change in the way variables are accessed. This fix is needed as GMAO is also currently not working, and is used for several unit tests. This PR also replaces GMAO with MERRA-2 for those tests.

How Has This Been Tested?

  • all unit tests pass locally

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have added an explanation of what your changes do and why you'd like us to include them.
  • I have written new tests for your core changes, as applicable.
  • I have successfully ran tests with your changes locally.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@jlmaurer jlmaurer mentioned this pull request Feb 15, 2024
8 tasks
@jlmaurer jlmaurer marked this pull request as ready for review February 18, 2024 19:59
@jlmaurer
Copy link
Collaborator Author

jlmaurer commented Feb 18, 2024

@cmarshak I'm getting two unit test failures saying that there is no "foo.json" files in test_weather_model_availability_integration_using_valid_range in test_GUNW.py. Any idea what's up with that?

@bbuzz31 this PR should be ready to check, only test failures are with the missing foo.json.

@cmarshak
Copy link
Collaborator

cmarshak commented Feb 20, 2024

Yes, foo.json does not exist. It's a mocked side-effect of all the calls made in the GUNW workflow.

This test makes sure that the attribute model._valid_range is checked and silently stops for the GUNW workflow. This for the situation of HRRR being called for present SLCs that do not have data available (usually we have a long time-series of GUNWs for which a small set of HRRR is not available).

It appears you swapped out GMAO with MERRA2 for this test.

They have different date ranges:

GMAO:

self._valid_range = (dt.datetime(1980, 1, 1), "Present")

MERRA2:
self._valid_range = (dt.datetime(2014, 2, 20), "Present")

I am not sure what the differences between these two models are and why you changed the models out in the test. Honestly, you could remove GMAO from the test because I don't think we will use GMAO or MERRA2 for cloud processing. If you or David see this model being used, would be good to update the test accordingly (just pick a secondary date outside the date range of MERRA2 here).

Hope that helps.

@jlmaurer jlmaurer merged commit 4fb2956 into dbekaert:dev Feb 20, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants