Page History
...
Module | Functionality |
---|---|
ImgVsTimeSplitInFiles | splitter |
CorAna | base class with common methods |
CorAnaData | data processing for split files |
CorAnaInputParameters | provides storage for input parameters |
CorAnaMergeFiles | merging algorithm |
CorAnaProcResults | Example showing how to access results using C++ and produce a table for presentation |
CorAnaPars.py | singleton class for parameter storage in the wrapping file manager |
CorAnaSubmit.py | global methods for the file manager |
app/corana_submit | pythonic script which defines the sequence of procedures in the file manager |
app/corana.cpp | main module for the part of image vs time correlation processing |
app/corana_merge.cpp | main module for merging |
app/corana_procres.cpp | main module for merging |
data/psana-...-auto-correlation.cfg | psana configuration file for ImgVsTimeSplitInFiles |
data/PlotCorAnaResults.py | example of the python script which plots the test result histogram resulting graphics |
Image splitting
Image splitting is implemented as a regular psana module ImgAlgos::ImgVsTimeSplitInFiles.
...
- The <int16_t> image data array is split for ordered (in psana *.cfg file) number of equal parts and each part is saved in the output
img-xcs-r0015-b####.bin
file sequentially for all selected events. - The appropriate time record for selected event is saved in the file
img-xcs-r0015-time.txt
. - At the end of the splitting procedure:
- the average time difference and its rms between sequential events is evaluated for all recorded time records.
- The file
img-xcs-r0015-time.txt
is re-processed and for each record the time index is evaluated as unsigned value ofCode Block <time-index> = (<event-time> + 0.5 <average-time-between-events>) / <average-time-between-events>
- Event record with time index is saved in the file
img-xcs-r0015-time-ind.txt
- All metadata parameters which are required for further processing, such as input parameters, image size,
<average-time-between-events
, maximal value of the time index etc., are saved in fileimg-xcs-r0015-med.txt
.
Time correlation processing
ImgAlgos/app/corana
application
Command to run interactively on psana####
or submit in batch from pslogin##
node:
Note |
---|
This approach allows to apply the modest event selection algorithms in |
Time correlation processing
ImgAlgos/app/corana
application
Command to run interactively on psana####
or submit in batch from pslogin##
node:
Code Block |
---|
corana -f <fname-data> [-t <fname-tau>] [-l <logfile>] [-h] bsub -q psfehq -o log-file 'corana -f <fname-data> [-t <fname-tau>] [-l <logfile>] [-h]' |
...
ImgAlgos/app/corana_submit
- is a wrapping script which allows to run all of above procedures by a single command from pslogin##
node and it keeps eye on processing of jobs in batch and doing the file managmentmanagement. Command to start:
Code Block |
---|
corana_submit [-c <config-file>] [-t <fname-tau>] [-x] <xtc-file-list> |
...
Code Block |
---|
corana_submit -c ImgAlgos/data/psana-xcsi0112-r0015-img-auto-correlation.cfg -t my-tau.txt /reg/d/psdm/XCS/xcsi0112/xtc/e167-r0015-s00-c00.xtc |
Manual sequential processing
In case of manual processing of all scripts, commands need to be issued in a right order. Commands corana
, corana_merge
, and corana_procres
should have the same list of parameters. This is important, because all file names for these procedures are generated by the same base class ImgAlgos/src/CorAna.cpp
Right sequence of commands to run interactively on psana####
This script sequentially performs operations for single run as follows:
- Initialize all parameters
- Run psana to split image for files
- Check that all split files are produced
- Submit job for time-correlation processing
- Check that all processed files are produced
- Submit job for merging
- Check that merged file is produced
- Submit job for test processing of the file with results
- List all created files
- Clean-up files in the work directory
- List of preserved files
Note The next to last procedure deletes all intermediate split- and log- files.
In debugging mode this procedure may be turned off.
Manual sequential processing
In case of manual processing of all scripts, commands need to be issued in a right order. Commands corana
, corana_merge
, and corana_procres
should have the same list of parameters. This is important, because all file names for these procedures are generated by the same base class ImgAlgos/src/CorAna.cpp
Right sequence of commands to run interactively on psana####
Code Block |
---|
psana -c <config-file> <xtc-file-list>
corana -f <fname-data> [-t |
Code Block |
psana -c <config-file> <xtc-file-list> corana -f <fname-data> [-t <fname-tau>] [-l <logfile>] [-h] corana_merge -f <fname-data> [-t <fname-tau>] [-l <logfile>] [-h] corana_merge -f <fname-data> [-t <fname-tau>] [-l <logfile>] [-h] corana_procres -f <fname-data> [-t <fname-tau>] [-l <logfile>] [-h] |
...
- File with split-image data for selected events
img-xcs-r0015-b000N.bin
:
Currently this file contains<uint16_t>
amplitude for each pixel in binary format for:Code Block <data-for-img-partN-of-img1> <data-for-img-partN-of-img2> ... <data-for-img-partN-of-imgLast>
- File with metadata parameters
img-xcs-r0015-med.txt
:Code Block IMAGE_ROWS 1300 IMAGE_COLS 1340 IMAGE_SIZE 1742000 NUMBER_OF_FILES 8 BLOCK_SIZE 217750 REST_SIZE 0 NUMBER_OF_IMGS 500 FILE_TYPE bin DATA_TYPE uint16_t TIME_SEC_AVE 8.088413 TIME_SEC_RMS 0.063639 TIME_INDEX_MAX 499
- File with image time records
img-xcs-r0015-time.txt
:
where each record has:Code Block 1 0.000000 0.000000 20120616-080236.671607864 5366 0 2 8.026429 8.026429 20120616-080244.698036743 8255 1 3 16.144788 8.118359 20120616-080252.816395836 11177 2 4 24.154835 8.010048 20120616-080300.826443448 14060 3 ...
Code Block <image-in-file#> <t(sec)-from-the-1st-event> <dt(sec)> <time-stamp> <fiducials> <event#-since-configure>
- File with image time records and evaluated time index
img-xcs-r0015-time-ind.txt
:
where each record has:Code Block 1 0.000000 0.000000 20120616-080236.671607864 5366 0 0 2 8.026429 8.026429 20120616-080244.698036743 8255 1 1 3 16.144788 8.118359 20120616-080252.816395836 11177 2 2 4 24.154835 8.010048 20120616-080300.826443448 14060 3 3 5 32.281937 8.127102 20120616-080308.953545010 16985 4 4 ...
Code Block <image-in-file#> <t(sec)-from-the-1st-event> <dt(sec)> <time-stamp> <fiducials> <event#-since-configure> <time-index-starting-from-0>
- File with split-image correlators for each value of
tau
img-xcs-r0015-b000N-result.bin
:
Currently it saves<float>
correlator for each pixel in binary format for:Code Block <corr-for-img-partN-of-tau1> <corr-for-img-partN-of-tau2> ... <corr-for-img-partN-of-tauLast>
my-tau.txt
:
contains theCode Block 1 3 5 7 9 10 12 14 16 18 20 24 28 30 32 36 40 ... 160 180 200 240 280 300 320 360 400
tau
values presented in terms of number of ordered images in the file.
Quick start guide
We assume that everything is set up to work on LCLS analysis farm, otherwise see Computing and Account Setup.
How to run this procedure
...
contains the28 30 32 36 40 ... 160 180 200 240 280 300 320 360 400
tau
values presented in terms of number of ordered images in the file.
Quick start guide
We assume that everything is set up to work on LCLS analysis farm, otherwise see Computing and Account Setup.
How to run this procedure
If the version of the package ImgAlgos is already current software release, then you may run the script command(s) directly, for example:
Code Block |
---|
cd <your-favorite-directory>
mkdir work_corana
sit_setup
corana_submit [-c <config-file>] [-t <fname-tau>] [-x] <xtc-file-list>
|
Note |
---|
If the code in package ImgAlgos has been recently changed and the updated release is not yet available, then one need to create the local release directory, get the latest/HEAD version of the package and compile the code as shown below: |
Code Block |
---|
cd <your-favorite-directory> mkdir work_coranadirectory> newrel ana-current myReleaseDirectory cd myReleaseDirectory sit_setup corana_submit [-c <config-file>] [-t <fname-tau>] [-x] <xtc-file-list> |
Note |
---|
If the code in package ImgAlgos has been recently changed and the updated release is not yet available, then one need to create the local release directory, get the latest/HEAD version of the package and compile the code as shown below: |
Code Block |
---|
cd <your-favorite-directory>
newrel ana-current myReleaseDirectory
cd myReleaseDirectory
sit_setup
addpkg ImgAlgos HEAD
scons
|
Where to find results
The procedure will produce a bunch of files in the work_corana
directory. The most important files are
File name tail | Format | Content |
---|---|---|
*-image-result.bin | binary for <float> | correlators for all image pixels for all tau values |
*-time-ind.txt | text | time records for all selected events/images |
*-tau.txt | text | the list of tau intervals |
*-med.txt | text | meta data parameters |
*-hist.txt | text | Histogram array with correlators averaged for ring regions of the image for all |
How to look at results
It is assumed that all files listed in previous section may be used for further analysis, depending on particular goals.
...
addpkg ImgAlgos HEAD
scons
|
Where to find results
The procedure will produce a bunch of files in the work_corana
directory. If everything is OK, then all spit - and log- files will be removed at the end of automatic corana_submit
procedure. The most important files are preserved for further analysis:
File name tail | Format | Content |
---|---|---|
*-image-result.bin | binary for <float> | correlators for all image pixels for all tau values |
*-time-ind.txt | text | time records for all selected events/images |
*-tau.txt | text | the list of tau intervals |
*-med.txt | text | meta data parameters |
*-hist.txt | text | Histogram array with correlators averaged for ring regions of the image for all |
How to look at results
It is assumed that all files listed in previous section may be used for further analysis, depending on particular goals. The optional script corana_procres
is designed as an example of how to access data from C++ code. Class CorAnaProcResults
produces the file *-hist.txt
A simple python script shows how to plot this file:
Code Block |
---|
./ImgAlgos/data/PlotCorAnaResults.py work_corana/img-xcs-r0015-hist.txt
|
Note |
---|
Another option is to use python script for direct processing of the resulting files. |