Skip to content

Adding cutsom file format (HDF5) #198

Open

Description

@christopher566

Thank you for such a good tool to visualize time history. I have a new data format which is popular called HDF5. I tried your method on adding a new file format to the codes. However, I met some problem as I have to import another library called "h5py" to read files in such format. I installed the library but failed to import it, it seems the environment I am using is different to the one used in the pyDatView. It will be appreciated if you can integrate this file format. Thanks.

https://docs.h5py.org/en/stable/

Activity

  1. ebranlard commented on May 23, 2025

    @ebranlard
    Owner

    Hi Christopher,

    To add new file formats, you can either register them by:

    In your case, your file format require additional python package that are not installed by default with pyDatView, which indeed adds some complications.

    If you used windows, pyDatView ships with its own version of python and packages, that are stored in the installation directory of pyDatView. There are ways to install packages in this directory, but that might not be the easiest. You would need to following the instructions given here: #192 (comment)

    If you already have python installed on your system (or in a virtual environment), you can git clone pyDatView and use this version of pyDatView by doing python pyDatView.py (you can also use the executable located in _tools/pyDatView.exe). As long as hdf5 is installed in your local python, then your new file format should work.

    Let me know if you need further help!

  2. changed the title [-]Adding more file formats[/-] [+]Adding cutsom file format (HDF5)[/+] on May 23, 2025
  3. Flecken-Zwerg commented on Jul 7, 2025

    @Flecken-Zwerg

    Has somebody already put work into this?
    Some tools of the Wind Energy ToolBox (WETB) by DTU only support .hdf5 files.
    This is a very good results file viewer and I would like to continue using it.

  4. ebranlard commented on Aug 22, 2025

    @ebranlard
    Owner

    Sorry for the slow response.

    I think the reason I never included hdf5 was because the package is pretty big and then it makes the executable large and slow to download.

    But I'm open to look into that.

    If you have a small hdf5 from DTU/hawc2, feel free to post it here. I guess we already have some WETB tools, I might just need to update them and see whether we can include HDF5 without adding too much to the executable, or at least make it available to people that just git clone the repository.

    Keep me in touch

  5. Flecken-Zwerg commented on Sep 10, 2025

    @Flecken-Zwerg

    I made an attempt to implement hdf5. Dont't know if it's a 'complete' implementation, but it works for me.

    init.py

    hdf5_file.py

    Since I run PyDatView only via Python interpreter (I seem to be too stupid to generate the binary), I can't say how much the program will be bloated.
    Nevertheless I hope this helps a bit.

  6. SimonHH commented on Sep 16, 2025

    @SimonHH
    Contributor

    I can confirm, that pydatview is very usable also with importing and using h5py. We do that on a regular basis for our internal extentions.

  7. ebranlard commented on Sep 16, 2025

    @ebranlard
    Owner

    Thanks to both of you.

    My guess is that multiple softwares will have different ways or storing data into an HDF5. At first we can try to support a couple of specific case, and a gneric reader that tries its best to extract whatever "tables" are in the files.

    I think it would make sense to support the HAWC2 HDF5 format for sure.

    @Flecken-Zwerg , your code looks good, do you think you can do a pull request to have authorship?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedusage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions