You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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()
  • No labels