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

hdf5 data - transposed & upside-down #113

Open
pollyaschm opened this issue Jun 14, 2024 · 2 comments
Open

hdf5 data - transposed & upside-down #113

pollyaschm opened this issue Jun 14, 2024 · 2 comments
Assignees

Comments

@pollyaschm
Copy link

pollyaschm commented Jun 14, 2024

Hello!

In read_hdf5(), the default option is that the data is read tranposed and upside-down.
This is probably not what you always want.

It would be nice to have a switch to decided whether the data should be inverted or not.
(see what I mean here, where I tweaked it for my needs. )

Also, when calling read_grid() for hdf5 data, you need to pass the file_format_opts as

file_format_opts = list(
      data_path = /path/to/data,
      odim= FALSE, 
      meta =TRUE)

I think it would be more consistent (e.g. grib_opts(), ) and intuitive, if could specify the information like this:

file_format_opts = hdf5_opts(
     data_path = /path/to/data,
     odim = FALSE,
     meta = TRUE)

Thanks
Polly

@andrew-MET
Copy link
Collaborator

It seems that hdf5_opts() already exists - it's just not exported. One of the options for netcdf_opts() is y_rev = TRUE/FALSE so that could be used here too.

@andrew-MET andrew-MET assigned andrew-MET and adeckmyn and unassigned andrew-MET Jun 14, 2024
@adeckmyn
Copy link
Collaborator

Please send me any hdf5 files that I can use to check. I know that in the past I have encountered hdf5 files where the data was not ordered as described in the meta data. So maybe my code is rotated and only works for "wrong" hdf5 files. At some point (but I am absolutely not sure here) I had the impression that hdf5 files prepared with h5py (python) were different from others. I know that at some point I also added an option to reverse axes etc. in a development branch, but somehow that dissappeared. I'll redo that work.

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

No branches or pull requests

3 participants