Page History
...
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:
...
- runs through 400 events of the xtc file
exp=meca1113:run=45
, uses CSPadNDArrProducer and CSPad2x2NDArrProducer modules to get cspad and four cspad2x2 data and put them as universal
ndarray<T,3>
objects in psana event store,uses NDArrAverage module to evaluate and save in file average, rms, mask, and hot pixel map for all array elements:
No Format cspad.0-ave-meca1113-r0045.dat cspad.0-hot-meca1113-r0045.dat cspad.0-msk-meca1113-r0045.dat cspad.0-rms-meca1113-r0045.dat cspad2x2.1-ave-meca1113-r0045.dat cspad2x2.1-hot-meca1113-r0045.dat cspad2x2.1-msk-meca1113-r0045.dat cspad2x2.1-rms-meca1113-r0045.dat cspad2x2.2-ave-meca1113-r0045.dat cspad2x2.2-hot-meca1113-r0045.dat cspad2x2.2-msk-meca1113-r0045.dat cspad2x2.2-rms-meca1113-r0045.dat cspad2x2.3-ave-meca1113-r0045.dat cspad2x2.3-hot-meca1113-r0045.dat cspad2x2.3-msk-meca1113-r0045.dat cspad2x2.3-rms-meca1113-r0045.dat cspad2x2.4-ave-meca1113-r0045.dat cspad2x2.4-hot-meca1113-r0045.dat cspad2x2.4-msk-meca1113-r0045.dat cspad2x2.4-rms-meca1113-r0045.dat
NDArrAverage module has a bunch of parameters which depend on particular detector/experiments and need to be adjusted looking at spectra of average and rms values from these files. For example averaged image and spectrum and rms spectrum of pixel intensities for
...
Code Block |
---|
ssh -Y psana cd <your-favorite-directory> kinit <next 6 lines can be copied and pasted> newrel ana-0.10.14 my-release-dir; cd my-release-dir; sit_setup; addpkg ImgAlgos HEAD; addpkg CSPadPixCoords HEAD; scons -j 8; <wait a few minutes until it is compiled> <pick-up *.cfg files> files and run them> psana -c psana-meci0114-r0050-exampleimgdump-cspadcalib.cfg psana -c psanapsana-meci0114-r0050-exampleimgdump-ndarrcalib.cfg |
These example print too much, but this is an intentional example. Level of verbosity can be controlled by the print_bits
parameter for each module.
Configuration files
- psana-meci0114-r0050-exampleimgdump-cspadcalib.cfg - use sequence of CsPadCalib, CSPadImageProducer, and ExampleDumpImg modules
works with int16_t data on all stages until ExampleDumpImg
...
Psana can use python modules. A few modules in package pyimgalgos were recently developed to process CSPAD data.
Psana Module Catalog - Package pyimgalgos
Psana Module Examples - Examples for Package pyimgalgos
In particular, module pyimgalgos.image_save_in_file
may save image in 16-bit tiff files.
...
Other option for floating point conversion: -define quantum:format=floating-point
References
Examples for cxi86415
This test is done by request
Note |
---|
Loh, Ne-Te writes: |
Standard configuration file
Use psana configuration file psana-cxidg3-cspad2x2-NDArrAverage.cfg (download), which can be executed by command:
Code Block |
---|
sit_setup
psana -c psana-cxidg3-cspad2x2-NDArrAverage.cfg exp=cxi86415:run=7 |
This job produces 3 files with cspad2x2 shaped arrays for averaged, rms, and maximal intensities.
These arrays can be plotted by the command
Code Block |
---|
plims cspad2x2-ndarr-ave-cxi86415-r0007.dat |
Results for runs 7, 62, and 83 are shown on plots:
These plots show that the dark level is consistent with zero and does not indicate on any offset.
Loh's configuration file
Use configuration file from Loh's e-mail orig.cfg (download)
with minor modifications
- add psana parameters in the header, add list of modules
- remove
typeGroupname = CsPad:CalibV1 from
[CSPadPixCoords.CSPad2x2ImageProducer:2]
- add module
ImgAlgos.ImgSaveInFile:2
just in order to save image:
Code Block |
---|
[psana]
files = exp=cxi86415:run=64
events = 10
modules = CSPadPixCoords.CSPad2x2NDArrProducer:2 \
ImgAlgos.NDArrCalib:2 \
CSPadPixCoords.CSPad2x2ImageProducer:2 \
ImgAlgos.ImgSaveInFile:2
<code from e-mail is here>
[ImgAlgos.ImgSaveInFile:2]
source = DetInfo(CxiDg3.0:Cspad2x2.0)
key = reconstructed
fname = img-cspad2x2-dg3
ftype = txt
#saveAll = true
print_bits = 3
eventSave = 9 |
Run it with command:
Code Block |
---|
psana -c orig.cfg |
which produces file with image for event #9, which can be viewed as
Code Block |
---|
plims img-cspad2x2-dg3-cxi86415-r0064-e00000009-20150308-162942.145136207.txt |
ang brings us an image: - the same image, but spectrum is shown in the range (-100, 100) ADU. This event looks good.
Event #36: looks like left-side sensor is not corrected for common mode fluctuation...
In stead of default common_mode parameters (1,25,25,100) let us try (1,50,10,100) in the file
Code Block |
---|
/reg/d/psdm/CXI/cxi86415/calib/CsPad2x2::CalibV1/CxiDg3.0:Cspad2x2.0/common_mode/9-end.data |
The same image looks better now:
Recommendation: try to play with common mode parameters.
References
NDArrAverage module