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 [2011/08/30 13:21] – [Utilisation] 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, | ||
| - | ====== | + | ====== |
| - | * 1.9.63 (version | + | * Use module avail lib/hdf5 to view installed |
| + | ====== How to? ====== | ||
| - | ====== Utilisation ====== | + | |
| - | + | ||
| - | | + | |
| <code bash> | <code bash> | ||
| - | $ module load hdf5 | + | $ module load lib/hdf5 |
| </ | </ | ||
| - | **Exemple | + | ===== Manipulate data from your code ===== |
| + | |||
| + | **Example | ||
| <file C dataSet.c> | <file C dataSet.c> | ||
| Ligne 59: | 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 H5 ===== | + | # Create random data |
| + | import numpy as np | ||
| + | data_matrix | ||
| + | # Write data to HDF5 | ||
| + | data_file = h5py.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 ===== | ||
| + | |||
| + | |||
| + | Commands are located [[http:// | ||
| + | |||
| + | /** | ||
| + | ===== Visualiser les fichiers HDF ===== | ||
| + | |||
| + | Vous pouvez visualiser les fichiers HDF en utilisant l' | ||
| + | |||
| + | <code bash> | ||
| + | $ module load tools/ | ||
| + | $ hdvfiew | ||
| + | </ | ||
| - | La liste des commandes est disponible [[http://www.hdfgroup.org/HDF5/ | + | {{ :hdfview.png? |}} |
| - | ====== | + | */ |
| + | ====== | ||
| - | http:// | + | * http:// |
| + | * https:// | ||