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

Opening virtual datasets with NASA dmrpp files #605

Open
ayushnag opened this issue Jun 18, 2024 · 1 comment · May be fixed by #606
Open

Opening virtual datasets with NASA dmrpp files #605

ayushnag opened this issue Jun 18, 2024 · 1 comment · May be fixed by #606

Comments

@ayushnag
Copy link

ayushnag commented Jun 18, 2024

The idea is to speed up opening up netcdf4/hdf5 datasets with a NASA specific optimization. Load data like xr.open_mfdataset with kerchunk/zarr speeds by translating existing dmr++ metadata files to zarr metadata on the fly. Much more context and discussion here.

virtualizarr PR for the parser here

earthaccess PR here

earthaccess additions:

  1. Open a virtual dataset (like a view of the data that contains dimensions, variables, attrs, chunks, but no actual data)
Screenshot 2024-06-18 at 4 13 48 PM
  1. Concatenate virtual xr.Datasets
    1. Use xarrays concatenation logic to create virtual views of netcdf’s (more details in virtualizarr documentation)
    2. Save as json/parquet/in-memory dict
Screenshot 2024-06-18 at 4 14 13 PM
  1. Read netcdf/hdf5 data
    1. Use the zarr engine in xarray to load a dataset (with indexes)
Screenshot 2024-06-18 at 4 14 31 PM

Questions/Suggestions:

Changes to the API?

  • **xr.combine_nested kwargs might be confusing and could be reworked if needed

NASA datasets you want me to test?

  • Many with unique considerations and the goal is to handle all NASA netcdf4/hdf5 datasets
  • So far I’ve tested and had success MUR-JPL-L4-GLOB-v4.1 (netcdf), SWOT_SSH_2.0 (netcdf), ATL-03 ICE-SAT (hdf5)
  • Feel free to test it out yourself or add a comment with a dataset and I can take a look

Take a look at the virtualizarr parser PR and leave suggestions

  • Speed improvements?
  • The current bottleneck is creating the xml object (dmrpp are xml files) with ET.fromstring(dmr_str) since the xml.ElementTree library needs to read the text, validate the xml, and create a parsable object. I am looking into a non-validating parser like xml.parsers.expat
@Mikejmnez
Copy link

Mikejmnez commented Jun 20, 2024

This looks great @ayushnag ! I will play with this in the next couple of days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

2 participants