Read datasets stored as the native HDF5 complex datatype - #2036
Open
NAThompson wants to merge 1 commit into
Open
Read datasets stored as the native HDF5 complex datatype#2036NAThompson wants to merge 1 commit into
NAThompson wants to merge 1 commit into
Conversation
HDF5 2.0 added `H5T_COMPLEX` (class 11), storing interleaved real and imaginary
components of a base float. It is what h5py writes given a `COMPLEX_IEEE_*`
type, and what HDF5 2.0 writers will produce in place of the legacy `{r, i}`
compound H5Web already reads. `H5T_CLASS` stopped at `ARRAY = 10`, so such a
dataset fell through `parseDType` to `unknownType()` and offered no
visualisation at all.
Both components are the same float and each is half the itemsize, so the
component type needs no metadata of its own. The values do need converting:
h5wasm exposes the interleaved layout directly, whereas H5Web's model is one
`[real, imag]` pair per element. Attributes need the same by a separate route,
arriving through `Attribute.json_value` as a plain array.
The reader side is usnistgov/h5wasm#140. `packages/h5wasm/package.json` pins
h5wasm 0.10.3, which predates it, so nothing exercises this in CI until that
lands and the pin is bumped. Checked by hand against a local h5wasm build and a
file written by h5py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HDF5 2.0 added
H5T_COMPLEX(class 11), storing interleaved real and imaginary components of a base float. It is what h5py writes given aCOMPLEX_IEEE_*type, and what HDF5 2.0 writers will produce in place of the legacy{r, i}compound H5Web already reads.H5T_CLASSstopped atARRAY = 10, so such a dataset fell throughparseDTypetounknownType()and offered no visualisation at all.Both components are the same float and each is half the itemsize, so the component type needs no metadata of its own. The values do need converting: h5wasm exposes the interleaved layout directly, whereas H5Web's model is one
[real, imag]pair per element. Attributes need the same by a separate route, arriving throughAttribute.json_valueas a plain array.The reader side is usnistgov/h5wasm#140.
packages/h5wasm/package.jsonpins h5wasm 0.10.3, which predates it, so nothing exercises this in CI until that lands and the pin is bumped. Checked by hand against a local h5wasm build and a file written by h5py.