Page History
...
- number of peaks in Equ region (constrain on sp.count_equ_pks_sel is not applied).
Scripts for analysis on 2015-05-18
Current version of scripts with comments is collected here. It is assumed that you work on one of psana nodes which has access to data, for example:
Code Block |
---|
ssh -Y psana
cd <your-analysis-directory>
sit_setup |
Download files in <your-analysis-directory>
- psana-cxif5315-r0169-cspad-ds2-NDArrDropletFinder.cfg (download) - configuration file for psana. This script sets parameters for a few psana modules,
- ImgAlgos.PixCoordsProducer - for each run get CSPAD geometry info from "geometry" calibration file and saves it in the psana internal calibration store,
- CSPadPixCoords.CSPadNDArrProducer - for each event get raw CSPAD data and saves them as [32,185,388] ndarray in the event store,
- ImgAlgos.NDArrCalib - get raw CSPAD data ndarray from the event store, apply requested intensity corrections (pedestals, common mode, etc.) and saves calibrated ndarray in the event store,
- ImgAlgos.NDArrDropletFinder:Arc - uses calibrated ndarray to search for peaks in the arc region and saves the list (ndarray) of peaks in the event store,
- ImgAlgos.NDArrDropletFinder:Equ - the same as above in the equatorial region,
- ImgAlgos.NDArrDropletFinder:Whi - the sabe as above in the whiskers region,
- ImgAlgos.Tahometer - convenience module for performance monitoring.
Beside automatically loaded calibration files (for pedestals, common mode, masks, geometry, etc.) this configuration file uses four external files with region masks and background
- work/cspad-ndarr-ave-cxif5315-r0162.dat - file with ndarray for background subtraction
- work/roi_mask_nda_arc.txt - ndarray with mask for arc region
- work/roi_mask_nda_equ.txt - ndarray with mask for equator region
- work/roi_mask_nda_whi.txt - ndarray with mask for whiskers region
- work/roi_mask_nda_all.txt - ndarray with mask for combined arc, equator, and whiskers regions.
These files are expected to be in the <your-analysis-directory>/work
directory.
psana-cxif5315-r0169-cspad-ds2-NDArrDropletFinder.py.txt (download) - python script, which used *.cfg file to produce all ndarrays in the event store, gets these ndarrays, does preliminary processing, saves list of peaks in the output text file, draw events (if requested).
This script can be run interactively or in batch by commands:Code Block // interactive command: psana -c psana-cxif5315-r0169-cspad-ds2-NDArrDropletFinder.cfg exp=cxif5315:run=169 // batch job submission command: bsub -q psfehq -o log-r169.log python psana-cxif5315-r0169-cspad-ds2-NDArrDropletFinder.py
At least 2 parameters need to be adjusted in this script for each mode:
Code Block do_plot = True - should be = False in the batch mode #events_max = 10000000 - for batch mode loop over all events events_max = 1000 - for loop over 1000 events in interactive mode
This job produces text file with all found peaks with name like
work/peaks-2015-05-09-23:52:30-cxif5315-r0169-all.txt
, which can be used for further analysisproc-peaks-from-file.py (download) - python script for processing of the text file with list of peaks.
Input file name and output file path prefix should be set at the end of this script:Code Block procPeaksFromFiles (('work/peaks-2015-05-09-23:52:30-cxif5315-r0169-all.txt',), '2015-05-14-figs-cxif5315/plot-cxif5315-r0169-all')
After that this script can be executed by the command:
Code Block python proc-peaks-from-file.py
which loops over peaks in file, does analysis, and plots requested histograms at the end.
References
...