-
Notifications
You must be signed in to change notification settings - Fork 1
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
Zarr Metadata #59
Zarr Metadata #59
Conversation
Codecov ReportAttention: Patch coverage is
|
chunk_meta[chunk_key] = [str(self._loc), value["offset"], value["size"]] | ||
zarr_tmp = zarr.MemoryStore() | ||
ds.to_zarr(zarr_tmp, mode="w", compute=False, encoding=encoding) | ||
zarr_meta = {"version": 1, "refs": {}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats the version of 1 here refer to? Im guessing thats just a zarr metadata version that will only be updated when changes are made specifically to the zarr metadata functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's the Zarr metadata version. More details here: https://fsspec.github.io/kerchunk/spec.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't see any issues. The advanced docs are a nice touch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried hard but could not spot anything to call out. Looks great!
Changes
RasPlanHdf
to generate Kerchunk-type Zarr metadata from HEC-RAS HDF files. These methods return dictionaries.zmeta_mesh_cells_timeseries_output
zmeta_mesh_faces_timeseries_output
zmeta_reference_lines_timeseries_output
zmeta_reference_points_timeseries_output
mesh_cells_timeseries_output
(old:mesh_timeseries_output_cells
)mesh_faces_timeseries_output
(old:mesh_timeseries_output_faces
)DataFrame
objects of summary output data:mesh_cells_summary_output
mesh_faces_summary_output
Zarr Metadata
The goal of generating Zarr metadata from RAS HDF files is the ability to treat multiple RAS HDF files as if they are a single file. By combining the dictionaries returns from the
zmeta_*
methods listed above, we can open many RAS HDF files with the same structure (i.e., from the same model, with the same settings, per FFRD) as if they are a single data source. The metadata generated by these methods contains information about where to find certain data within a single HDF file; when metadata from multiple files is combined, we can operate on many HDF files as if they are one. This is explained in the newAdvanced
documentation page.From the new Advanced docs page
The cell timeseries output for a single simulation might look something like this:
Note that the example below requires installation of the optional libraries
kerchunk
,zarr
,fsspec
, ands3fs
:Now, we can open the combined dataset with
xarray
:The resulting combined dataset includes a new
sim
dimension: