Beispiel #1
0
def main_test_2x1() :

    w = CSPadPixCoordsWODB()
    w.make_maps_of_2x1_pix_coordinates()
    w.print_maps_2x1()

    for i,arr2d in enumerate([w.x_map2x1,w.y_map2x1]) :
        range = (arr2d.min(), arr2d.max())
        gg.plotImage(arr2d, range, figsize=(10,5))
        gg.move(200*i,100*i)

    gg.show()
Beispiel #2
0
def main_calib() :

    print 'Start test in main_calib()'

    #calp.calibpars.setCalibPars( run      = 9,
    #                             calibdir = '/reg/d/psdm/CXI/cxi35711/calib',
    #                             group    = 'CsPad::CalibV1',
    #                             source   = 'CxiDs1.0:Cspad.0' )

    runnum=0

    #path_calib = '/reg/neh/home/dubrovin/LCLS/CSPadAlignment-v01/calib-cxi37411-r0039-Dsd/'
    #path_calib = '/reg/neh/home/dubrovin/LCLS/CSPadAlignment-v01/calib-cxi37411-r0080-Ds1'
    #path_calib = '/reg/neh/home/dubrovin/LCLS/CSPadAlignment-v01/calib-cxi35711-r0009-det'
    #path_calib = '/reg/d/psdm/CXI/cxi37411/calib/CsPad::CalibV1/CxiDs1.0:Cspad.0'
    #path_calib = '/reg/d/psdm/CXI/cxi35711/calib/CsPad::CalibV1/CxiDs1.0:Cspad.0'
    #path_calib = '/reg/d/psdm/CXI/cxi37411/calib/CsPad::CalibV1/CxiDsd.0:Cspad.0'
    path_calib = '/reg/d/psdm/xpp/xpp47712/calib/CsPad::CalibV1/XppGon.0:Cspad.0'

    #fname  = '/reg/d/psdm/CXI/cxi35711/hdf5/cxi35711-r0009.h5'
    #fname  = '/reg/d/psdm/CXI/cxi37411/hdf5/cxi37411-r0080.h5'
    #fname  = '/reg/d/psdm/CXI/cxi37411/hdf5/cxi37411-r0039.h5'
    #fname  = '/reg/d/psdm/XPP/xpp47712/hdf5/xpp47712-r0043.h5'
    #fname  = '/reg/d/psdm/CXI/cxi80410/hdf5/cxi80410-r0628.h5'
    fname, runnum = '/reg/d/psdm/XPP/xppcom10/hdf5/xppcom10-r1437.h5', 1437

    #dsname = '/Configure:0000/Run:0000/CalibCycle:0000/CsPad::ElementV2/CxiDs1.0:Cspad.0/data'
    #dsname = '/Configure:0000/Run:0000/CalibCycle:0000/CsPad::ElementV2/CxiDsd.0:Cspad.0/data'
    dsname = '/Configure:0000/Run:0000/CalibCycle:0000/CsPad::ElementV2/XppGon.0:Cspad.0/data'

    event  = 0

    print 'Load calibration parameters from', path_calib
    calp.calibpars.setCalibParsForPath ( run=runnum, path=path_calib )

    print 'Get raw CSPad event %d from file %s \ndataset %s' % (event, fname, dsname)
    ds1ev = hm.getOneCSPadEventForTest( fname, dsname, event )
    print 'ds1ev.shape = ',ds1ev.shape

    print 'Make the CSPad image from raw array'
    #cspadimg = CSPadImageProducer(rotation=3, tiltIsOn=False, mirror=False)
    cspadimg = CSPadImageProducer(rotation=0, tiltIsOn=False, mirror=False)
    cspadimg.printInputPars()
    cspadimg.printGeometryPars()
    #arr = cspadimg.getImageArrayForPair( ds1ev, pairNum=3 )
    #arr = cspadimg.getImageArrayForQuad( ds1ev, quadNum=2 )
    #arr = cspadimg.getImageArrayForCSPadElement( ds1ev )
    arr = cspadimg.getCSPadImage( ds1ev )
    #print 'arr = \n',arr

    AmpRange = (1700,2000)
    #AmpRange = (0, 100)

    print 'Plot CSPad image'
    gg.plotImage(arr,range=AmpRange,figsize=(11.6,10))
    gg.move(200,100)
    #gg.plotImageAndSpectrum(arr,range=(1,2001))
    gg.plotSpectrum(arr,range=AmpRange)
    gg.move(50,50)
    print 'To EXIT the test click on "x" in the top-right corner of each plot window.'
    gg.show()