You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to read in the hdf5 file more intelligently for a nice interactive experience in OMFIT.
We use xarray Datasets a lot (http://xarray.pydata.org/en/stable/index.html) for interacting with netcdfs (and doing almost anything - it is awesome!). Luckily the modern netCDF4 is based on HDF5. This means I can successfully read the FOCUS output using our OMFITncDataset, browse, and print / plot the FOCUS output data just by clicking on it
Notice how the (double-click in the tree) plot knew the ylabel? Smart. But see how it doesn't know the xlabel? Thats because FOCUS isn't storing the dimensions along with any of its data. This sort of meta-data is a major strength of HDF5/netCDF over dumb binary formats. Can we utilize it better in FOCUS? It shouldn't be hard, for example, to tell the HDF5 that intial_Bmns is m by n (yes, I see technically it is just 1D by "mode_index" as are Bmnin and Bmnim... but even recording that would be helpful).
While we are at it, all the 0D (i.e. length 1) outputs should probably just be stored as global attributes. I think HDF5/netCDF standard practices are right to use these, as they increase efficiency and clarity of the file.
This is not pressing, but worth having in the to do list.
The text was updated successfully, but these errors were encountered:
@logan-nc Great suggestion. I was aware of that FOCUS is writing HDF5 file not in the Standard way. I copy the format from somewhere. I will add this in to-do list and keep you informed if there is an update on this topic.
I am trying to read in the hdf5 file more intelligently for a nice interactive experience in OMFIT.
We use
xarray
Datasets a lot (http://xarray.pydata.org/en/stable/index.html) for interacting with netcdfs (and doing almost anything - it is awesome!). Luckily the modern netCDF4 is based on HDF5. This means I can successfully read the FOCUS output using our OMFITncDataset, browse, and print / plot the FOCUS output data just by clicking on itNotice how the (double-click in the tree) plot knew the ylabel? Smart. But see how it doesn't know the xlabel? Thats because FOCUS isn't storing the dimensions along with any of its data. This sort of meta-data is a major strength of HDF5/netCDF over dumb binary formats. Can we utilize it better in FOCUS? It shouldn't be hard, for example, to tell the HDF5 that intial_Bmns is m by n (yes, I see technically it is just 1D by "mode_index" as are Bmnin and Bmnim... but even recording that would be helpful).
While we are at it, all the 0D (i.e. length 1) outputs should probably just be stored as global attributes. I think HDF5/netCDF standard practices are right to use these, as they increase efficiency and clarity of the file.
This is not pressing, but worth having in the to do list.
The text was updated successfully, but these errors were encountered: