Objective
Libraries
- Python
- h5py
- NumPy
- SciPy
- MatPlotLib
#!/usr/bin/env python import h5py import numpy as np import scipy as sp import scipy.ndimage as spi import matplotlib.pyplot as plt
Basic operations
- Open file, get dataset, get array for current event, and close file:
file = h5py.File(hdf5_file_name, 'r') dataset = file['/Configure:0000/Run:0000/CalibCycle:0000/Camera::FrameV1/XppSb4Pim.1:Tm6740.1/image'] arr1ev = dataset[eventNumber] file.close()
Advanced operations
- Get item attributes
Code examples
#!/usr/bin/env python import h5py import numpy as np eventNumber = 5 file = h5py.File('/reg/d/psdm/XPP/xppcom10/hdf5/xppcom10-r0546.h5', 'r') dataset = file['/Configure:0000/Run:0000/CalibCycle:0000/Camera::FrameV1/XppSb4Pim.1:Tm6740.1/image'] arr1ev = dataset[eventNumber] file.close()
Overview
Content Tools