Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| hdf5 [2016/10/21 11:26] – [Visualiser les fichiers HDF] admin | hdf5 [2018/02/01 19:57] (Version actuelle) – [Links] admin | ||
|---|---|---|---|
| Ligne 2: | Ligne 2: | ||
| **HDF5** is a data model, library, and file format for storing and managing data. It supports an unlimited variety of datatypes, and is designed for flexible and efficient I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and applications for managing, manipulating, | **HDF5** is a data model, library, and file format for storing and managing data. It supports an unlimited variety of datatypes, and is designed for flexible and efficient I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and applications for managing, manipulating, | ||
| - | ====== | + | ====== |
| * Use module avail lib/hdf5 to view installed version | * Use module avail lib/hdf5 to view installed version | ||
| - | ====== | + | ====== |
| - | * Charger le module | + | * load the latest |
| <code bash> | <code bash> | ||
| $ module load lib/hdf5 | $ module load lib/hdf5 | ||
| </ | </ | ||
| - | ===== Manipulation des fichiers depuis des programmes | + | ===== Manipulate data from your code ===== |
| - | **Exemple | + | **Example |
| <file C dataSet.c> | <file C dataSet.c> | ||
| Ligne 60: | Ligne 60: | ||
| </ | </ | ||
| - | * Compiler votre application | + | * Compile your code |
| <code bash> | <code bash> | ||
| - | $ [icc|ifort] myApplication.c -o myProgram.exe -L$(HDF5_HOME)/ | + | $ [icc|ifort|gcc|mpicc] myApplication.c -o myProgram.exe -L$(HDF5_HOME)/ |
| </ | </ | ||
| + | ===Python example=== | ||
| + | We need to load python first <code bash>$ module load lang/ | ||
| + | **Wrire HDF5** | ||
| + | <code python> | ||
| + | # | ||
| + | import h5py | ||
| - | ===== Utiliser les utilitaires | + | # Create random data |
| + | import numpy as np | ||
| + | data_matrix | ||
| + | |||
| + | # Write data to HDF5 | ||
| + | data_file | ||
| + | data_file.create_dataset(' | ||
| + | data_file.close() | ||
| + | </ | ||
| + | |||
| + | **Read HDF5** | ||
| + | <code python> | ||
| + | |||
| + | import h5py | ||
| + | filename | ||
| + | f = h5py.File(filename, | ||
| + | |||
| + | # List all groups | ||
| + | print(" | ||
| + | a_group_key = list(f.keys())[0] | ||
| + | |||
| + | # Get the data | ||
| + | data = list(f[a_group_key]) | ||
| + | |||
| + | </ | ||
| + | ===== Using H5 tools ===== | ||
| - | La liste des commandes est disponible | + | Commands are located |
| + | /** | ||
| ===== Visualiser les fichiers HDF ===== | ===== Visualiser les fichiers HDF ===== | ||
| Ligne 82: | Ligne 114: | ||
| {{ : | {{ : | ||
| - | ====== | + | */ |
| + | ====== | ||
| - | http:// | + | * http:// |
| + | * https:// | ||