Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Objective

Currently LCLS does not offer an uniform approach to the analysis of accumulated experemental data. Users exploit myana, pyana, MatLab, IDL, CASS, and probably something else. The work on long-awaited project of psana is in progress. The psana is going to be quite generic and probably not so simple approachLCLS Data Management group works on PSANA project. The PSANA is a generic but not so simple platform for analysis of experimental data. In this page we discuss a simple but absolutly flexible approach to analysis of data stored in HDF5 files. It is based on Python code with extensive exploitation of standard libraries. A few code examples of how to access and process data are presented at the end of this page.

There are obvious advantages in this approach,:

  • Flexiabilitythis approach is absolutely flexible; HDF5 file has indexed structure, that means direct access to any event data from any file from your code.
  • Python is a high-level scripting language allows to write transparent and compact code based on well-elaborated standard libraries.
  • In general code in Python works slow comparing to C++, but there are libraries like NumPy written on C++, which solve this problem for manipulation with large arrays.

...

Libraries

Here is a list of Python libraries with appropriate references which we are going to use in our examples:

...

These libraries can be imported in the top of the Python-code file, for example

Code Block
#!/usr/bin/env python
import h5py
import numpy as np
import scipy as sp
import scipy.ndimage as spi
import matplotlib.pyplot as plt

...

  • For all HDF5 items:
    these parameters are available:
    Code Block
    item.id      # for example: <GroupID [1] (U) 33554473>
    item.ref     # for example: <HDF5 object reference>
    item.parent  # for example: <HDF5 group "/Configure:0000/Run:0000/CalibCycle:0000" (5 members)>
    item.file    # for example: <HDF5 file "cxi80410-r0587.h5" (mode r, 3.5G)>
    item.name    # for example: /Configure:0000/Run:0000/CalibCycle:0000/Camera::FrameV1
    
  • For Dataset
    Code Block
    ds.dtype     # for example: ('seconds', '<u4'), ('nanoseconds', '<u4')]
    ds.shape     # for example: (1186,)
    ds.value     # for example: (1297610252L, 482193420L)
    

...