# Convert hdf5 files to a Paraview readable format

**URL:** https://discourse.paraview.org/t/convert-hdf5-files-to-a-paraview-readable-format/6004
**Category:** ParaView Support
**Created:** [December 7, 2020, 5:47pm UTC](https://discourse.paraview.org/t/convert-hdf5-files-to-a-paraview-readable-format/6004 "2020-12-07T17:47:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![stevenrend](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/b487fb/32.png) [@stevenrend](https://discourse.paraview.org/u/stevenrend)
#### Post date: [December 7, 2020, 5:47pm UTC](https://discourse.paraview.org/t/convert-hdf5-files-to-a-paraview-readable-format/6004/1 "2020-12-07T17:47:46Z")

</div>

Hello everyone,

I use a 3D code for solving Euler equations in a cylindrical geometry.  
The structure of my output ( an hdf5 file ) looks like :  
**Mesh**  
gas/mesh/x : 1D array of dimension nx containing all r values  
gas/mesh/y : 1D array of dimension ny containing all theta values  
gas/mesh/z : 1D array of dimension nz containing all z values

**Physical variables**  
gas/rho : 3D array of dimension nz,ny,nx  
gas/p : 3D array of dimension nz,ny,nx

I want to use Paraview in order to visualize my output data but it is not read.  
I read that apparently I have to change the format of my data. Thus I want to know, please, to which format I should convert my data ? (If possible the easiest way). If possible I would like to have an example of what my data should look like.  
If needed in the following link you can find an example of my file : [https://nuage.osupytheas.fr/s/W5y3eRPXM9C7geH](https://nuage.osupytheas.fr/s/W5y3eRPXM9C7geH)

Thank you in advance for your help,  
Steven

---

<div class="post-metadata">

### Author: ![jfavre](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5ac83/32.png) [@jfavre](https://discourse.paraview.org/u/jfavre)
#### Post date: [December 9, 2020, 10:46am UTC](https://discourse.paraview.org/t/convert-hdf5-files-to-a-paraview-readable-format/6004/2 "2020-12-09T10:46:18Z")

</div>

A Python Programmable Source and h5py would do the job nicely. See the attached draft.  
[pvCylindrical.py](https://discourse.paraview.org/uploads/short-url/lypFKQiW6yRfOiMTHSyKGQ1rM6o.py) (2.0 KB)

Left as an exercise: if the cylinder must close on itself, you’ll need one more plane of data in the (r,z) space. Or use cell-data instead of point-data.

---

<div class="post-metadata">

### Author: ![stevenrend](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/b487fb/32.png) [@stevenrend](https://discourse.paraview.org/u/stevenrend)
#### Post date: [December 10, 2020, 6:03pm UTC](https://discourse.paraview.org/t/convert-hdf5-files-to-a-paraview-readable-format/6004/3 "2020-12-10T18:03:56Z")

</div>

Hello Jean M. Favre,

I tried your python script and it works like a charm. Thank you very much !  
Do you have documentation please Python Programmable source please ?

Best regards,  
Steven

---

<div class="post-metadata">

### Author: ![jfavre](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5ac83/32.png) [@jfavre](https://discourse.paraview.org/u/jfavre)
#### Post date: [December 10, 2020, 7:07pm UTC](https://discourse.paraview.org/t/convert-hdf5-files-to-a-paraview-readable-format/6004/4 "2020-12-10T19:07:45Z")

</div>

See the online doc here:

> **[4. Programmable Filter — ParaView Documentation 5.8.1 documentation](https://docs.paraview.org/en/latest/ReferenceManual/pythonProgrammableFilter.html?highlight=programmable%20Source#programmable-filter)**
