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

Compare with Current View Page History

« Previous Version 16 Next »

Setup environment

ssh pslogin
ssh psananeh (or psanafeh for cxi, sxr, and mec)
cd <your-directory>
sit_setup

All files used in this example are currently available in my local directories:
/reg/neh/home/dubrovin/LCLS/PSANA-V01/
/reg/neh/home/dubrovin/LCLS/PSANA-V01/ana-xpp50312/

Pedestals

In this section we show how to get CSPad2x2 pedestals using psana for "dark" run.
For this example we create the configuration file ana-xpp50312/psana-xpp50312-r0082-pedestals.cfg:

[psana]
files   = /reg/d/ana01/xpp/xpp50312/xtc/e178-r0082-s04-c00.xtc
modules = cspad_mod.CsPad2x2Pedestals

[cspad_mod.CsPad2x2Pedestals]
#source = DetInfo(:Cspad2x2)
source = DetInfo(XppGon.0:Cspad2x2.0)
output = cspad-pedestals-ave-xpp50312-r0082.dat
noise  = cspad-pedestals-rms-xpp50312-r0082.dat

Run psana with this configuration file:

psana -c ana-xpp50312/psana-xpp50312-r0082-pedestals.cfg

In a few seconds this job produces two text files with averaged pedestals and rms values as one-dimensional (143560) array for CSPad2x2. Actual shape of these arrays is assumed to be (185,388,2).
Using, for example, a simple python script these files may be plotted

./PlotCSPad2x2ArrayFromFile.py cspad-pedestals-ave-xpp50312-r0082.dat 700 1400
./PlotCSPad2x2ArrayFromFile.py cspad-pedestals-rms-xpp50312-r0082.dat 0 20

Averaged pedestals:

RMS of pedestals:

Calibration

By default psana assumes that all calibration files are located in the pre-defined directory
/reg/d/psdm/<INSTRUMENT>/<experiment>/calib/ as explained in Locating calibration files. However, for analysis it may be convenient to re-define the calibration directory through the psana parameters. In order to fulfill the naming conventions we have to create a tree of the calibration sub-directories somewhere in local user's space, for example:

ana-xpp50312/calib/CsPad2x2::CalibV1/XppGon.0:Cspad2x2.0/pixel_gain/
                                                         pixel_status/
                                                         pedestals/
                                                         common_mode/

and populate them with all necessary for analysis files. In particular, for pedestals we can use:

cp cspad-pedestals-ave-xpp50312-r0082.dat ana-xpp50312/calib/CsPad2x2::CalibV1/XppGon.0:Cspad2x2.0/pedestals/82-end.data

Another file for common mode correction common_mode/0-end.data usually looks like

1 50 10

The files for pixel_status and pixel_gain have the same structure like for pedestals and can be supplied, if necessary, depending and based on analysis.

Analysis

For this example we create the configuration file ana-xpp50312/psana-xpp50312-r0092.cfg:

[psana]
files       = /reg/d/ana01/xpp/xpp50312/xtc/e178-r0092-s04-c00.xtc
experiment  = xpp50312
calib-dir   = ana-xpp50312/calib
events      = 10

modules = cspad_mod.CsPadCalib CSPadPixCoords.CSPad2x2ImageProducer CSPadPixCoords.SaveImageInFile

[cspad_mod.CsPadCalib]
inputKey      = 
outputKey     = calibrated
doPedestals   = yes
doPixelStatus = no
doCommonMode  = yes
doPixelGain   = no

[CSPadPixCoords.CSPad2x2ImageProducer]
source         = DetInfo(:Cspad2x2)
inkey          = calibrated
outimgkey      = Image
tiltIsApplied  = true
print_bits     = 15

[CSPadPixCoords.SaveImageInFile]
source        = DetInfo(:Cspad2x2)
key           = Image
fname         = cspad2x2
eventSave     = 5
#saveAll       = true

This configuration file provides parameters for psana and three modules.
So far we setup calibration files for cspad_mod.CsPadCalib module for pedestal subtraction and common mode correction. Module CSPadPixCoords.CSPad2x2ImageProducer produces the CSPad2x2 image and saves it in the event. Module SaveImageInFile saves indicated image(s) in the file(s).

Run psana with this configuration file:

psana -c ana-xpp50312/psana-xpp50312-r0092.cfg

Plot obtained text file with an image:

./PlotCameraImageFromFile.py cspad2x2-r0092-2012-07-20-154000.855680176.txt -20 120

Playing with doPedestals and doCommonMode parameters, we could get different images.
Raw data without any correction:

Pedestals subtracted:

Pedestals subtracted and common mode corrected:

  • No labels