Versions Compared

Key

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

...

Code Block
import CSPAD2x2PixCoords as pixcoor
import CSPAD2x2CalibPars as calpars

Instantiate object with calibration parameters

Define path to the directory with calibration types and instantiate the calib object
for run:int number with access to the calibration constants from the list 'center', 'tilt', 'pedestals':

Code Block
    # Official path:
    path = '/reg/d/psdm/mec/mec73313/calib/CsPad2x2::CalibV1/MecTargetChamber.0:Cspad2x2.1/
    # or local:
    # path = '/reg/neh/home1/dubrovin/LCLS/CSPad2x2Alignment/calib-cspad2x2-01-2013-02-13/'

    calib = calpars.CSPAD2x2CalibPars(path, run, ['center', 'tilt', 'pedestals'])

Get pixel coordinates

Instantiate the coord object, using calibration parameters loaded ib the calib object and get the X and Y pixel coordinate arrays of shape (185, 388, 2):

Code Block
    coord = pixcoor.CSPAD2x2PixCoords(calib)
    X,Y = coord.get_cspad2x2_pix_coordinate_arrays_pix()

Get array of calibration parameters

Get array of calibration parameters of specific type:

Code Block
    peds_arr = calib.getCalibPars('pedestals')

Get CSPAD2x2 data array from hdf5 file

...

Code Block
import HDF5Methods as hm 
    fname  = '/reg/neh/home1/dubrovin/LCLS/HDF5Analysis-v01/PyCSPadImage/src/mec73313-r0180.h5
    dsname = '/Configure:0000/Run:0000/CalibCycle:0000/CsPad2x2::ElementV1/MecTargetChamber.0:Cspad2x2.1/data'
    data_arr = hm.getDataSetForOneEvent(fname, dsname, event=0)

Get CSPAD2x2 data array from hdf5 file

...

Code Block
import GlobalGraphics as gg
    my_range = None
    my_range = (-10,40)
    gg.plotImageLarge(img2d, range=my_range)        
    gg.plotSpectrum(img2d, range=my_range)
    gg.show()

Code example

Code Essential code of the module CSPAD2x2Examples.py:

...