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

Cryo 84: Refactor tutorials to use earthaccess and xarray #91

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

andypbarrett
Copy link
Collaborator

This PR updates the SMAP tutorials to use earthaccess and xarray

Methods are included to load SMAP L3 data into xarray.DataTree and add coordinates.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link

github-actions bot commented Jan 7, 2025

Binder 👈 Launch a binder notebook on this branch for commit 1715ba0

I will automatically update this comment whenever this PR is modified

Copy link

review-notebook-app bot commented Jan 7, 2025

View / edit / reply to this conversation on ReviewNB

flamingbear commented on 2025-01-07T16:28:07Z
----------------------------------------------------------------

xarray names dimensions phony_dim0, phony_dim1, etc.

I actually think this is HDF5 and not xarray.


Copy link

review-notebook-app bot commented Jan 7, 2025

View / edit / reply to this conversation on ReviewNB

flamingbear commented on 2025-01-07T16:28:08Z
----------------------------------------------------------------

Line #1.    dt = xr.open_datatree(filelist[0], phony_dims='sort')

In my notebook I don't need phony_dims keyword, but I might have a different env, and not using h5netcdf. I hope that doesn't really change how the datatrees behave.


Copy link

review-notebook-app bot commented Jan 7, 2025

View / edit / reply to this conversation on ReviewNB

flamingbear commented on 2025-01-07T16:28:08Z
----------------------------------------------------------------

I think here you can just access the dataset object and skip the update. see below

dt["Soil_Moisture_Retrieval_Data_AM"].ds = \
  dt["Soil_Moisture_Retrieval_Data_AM"].ds.rename(
      {
          'phony_dim_0': 'y', 
          'phony_dim_1': 'x', 
          'phony_dim_2': 'igbp_class'
      }

 


Copy link

review-notebook-app bot commented Jan 7, 2025

View / edit / reply to this conversation on ReviewNB

flamingbear commented on 2025-01-07T16:28:09Z
----------------------------------------------------------------

Of course I just said that you didn't need to do update but I don't actually see the Dimensions in the root doing it my way. And I just verified that behavior. It's probably a bug. So if you want the dims recognized I think you'll have to use the update function.


@flamingbear
Copy link
Member

@andypbarrett Unfortunately I think you are doing it properly for the moment, but this looks like the right direction. If I get a chance I'll see if I can create a stripped down example and file a bug on the repo.

Copy link
Member

@flamingbear flamingbear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. One last thing. I noticed the versions for smap in the download data notebooks were 008 and I couldn't get any data without bumping them to 009.

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.

2 participants