Page History
...
This module use results and should work after the ImgAlgos::ImgPeakFinder. It gets the vector of peaks for the source
and key
, loops over all founded peaks and counts the number of peaks above the thresholds threshold_peak
and threshold_total
. If the selection_mode
is "SELECTION_ON" and the number of found peaks exceeds the n_peaks_min
the event is passed for further analysis/processing,
the table of found peaks may be saved in file with prefix defined by the fname
parameter.Module configuration parameters:
parameter | default value | description |
---|---|---|
|
...
"DetInfo()" |
...
source of data | |
|
...
"peaks" |
...
key for input list of peaks, should be the same as | |
|
...
"SELECTION_ON" |
...
three possible options:
|
...
|
...
|
...
|
...
0 | threshold on peak amplitude | |
|
...
0 | threshold on total peak intensity (in the matrix around peak) | |
|
...
1 | minimal number of peaks above all thresholds | |
|
...
| file name prefix; by default the prefix is empty and file is not saved | |
|
...
0 | filter verbosity:
|
...
|
...
|
...
|
...
|
...
|
...
See also Example for Module ImgAlgos::ImgPeakFilter.
...
- gets the
ndarray<double,2>
image object from event, - selects two spectral band regions and integrates amplitudes for each column (it is assumed that both spectra are oriented along the rows),
- saves two spectral arrays for signal and reference bands and their relative difference as another
ndarray<double,2>
object with shape (3,<number-of-columns>) in the event. - Further analytical work is assumed to be done in the next module ImgAlgos::ImgSpectraProc.
Module configuration parameters:
...
parameter | default value | description |
---|---|---|
| "DetInfo(:Opal1000)" |
...
source of data | |
|
...
"img" |
...
key for input image data | |
|
...
"spectra" |
...
key for output array with spectra | |
|
...
510 | signal band central row at column=0 | |
|
...
550 | reference ... | |
|
...
0 | signal band tilt angle | |
|
...
0 | reference ... | |
|
...
10 | signal band width in number op rows | |
|
...
10 | reference ... | |
|
...
0 | module verbosity:
|
...
|
...
|
...
|
...
|
...
See also Example for Module ImgAlgos::ImgSpectra.
...
Works after module ImgAlgos::ImgSpectra.
This module is designed as an example, in order to show how to get access to spectral array.
In particular, method ImgSpectraProc::getSpectra(...)
shows how to get pointer to data, and method ImgSpectraProc::printSpectra(...)
iterates over array and selectively prints its elements.
Module configuration parameters:
...
parameter | default value | description |
---|---|---|
| "DetInfo(:Opal1000)" |
...
source of data | |
|
...
"spectra" |
...
key for input image data | |
|
...
0 | module verbosity:
|
...
|
...
|
...
|
...
|
...
See also Example for Module ImgAlgos::ImgSpectraProc.
...
ImgSaveInFile works after the CSPadImageProducer, CSPadInterpolImageProducer, CameraImageProducer, PnccdImageProducer, etc., which produce image object in formats CSPadPixCoords::Image2D<T>
or ndarray<T,2>
, where the T
stands for one of the data types, double, float, int, uint8_t, or uint16_t.
Module configuration parameters:
...
parameter | default value | description |
---|---|---|
| "CxiDs1.0:Cspad.0" |
...
source of data |
...
|
...
"Image2D" |
...
input image key |
...
|
...
0 | event number to save the CSPad image file |
...
|
...
false | save or not all selected events |
...
|
...
"txt" |
...
output file format; currently implemented formats | |
|
...
"img" |
...
prefix of the output file name. Entire file name |
...
is formed as |
...
|
...
0 | verbosity:
|
...
|
...
|
...
Note |
---|
Saving in PNG currently works for uint8_t and uint16_t formats only... |
...
- get image for each event as an
ndarray<T,2>
object, - splits it for
nfiles_out
equal parts, - saves each part of the image for all events in the job in a separate file with name
<fname_prefix>-<fname-common>-b<block-number>.<file_type>
, - saves metadata in the text file with name:
<fname_prefix>-<fname-common>-med.txt
, - saves counter number and the time records in file:
<fname_prefix>-<fname-common>-time.txt
.
Module configuration parameters:
...
parameter | default value | description |
---|---|---|
| "DetInfo(:Princeton)" |
...
source of data |
...
|
...
"img" |
...
input image key |
...
|
...
"my-exp" |
...
output files common prefix |
...
|
...
"bin" |
...
output files type: "bin", "txt" |
...
|
...
true | add time stamp to the output file names |
...
|
...
8 | number of output files (or number of parts to split image), it works tested and works for |
...
|
...
1 | pixel amplitude threshold in image amplitude units |
...
|
...
1 | default pixel amplitude if it is below |
...
|
...
0 | verbosity:
|
...
|
...
|
...
|
...
|
...
|
...
|
...
See also Example for Module ImgAlgos::ImgVsTimeSplitInFiles.
...
- saves counter number and the time records in file
fname
. - print summary parameters for parser, for example:
Code Block bgColor #F7F7ED ImgTimeStampList: Summary for parser BATCH_RUN_NUMBER 0020 BATCH_NUMBER_OF_EVENTS 75 BATCH_FRAME_TIME_INTERVAL_AVE 8.086934 BATCH_FRAME_TIME_INTERVAL_RMS 0.120381 BATCH_FRAME_TIME_INDEX_MAX 74
Module configuration parameters:
...
parameter | default value | description |
---|---|---|
| "tstamp-list.txt" |
...
output files common prefix |
...
|
...
0 | verbosity:
|
...
|
...
|
...
|
...
|
...
Module ImgAlgos::ImgIntMonCorr
...
- ImgIntMonCorr uses the
source
andkey_in
parameters to get the input image (asndarray<double,2>
object), - gets and process the intensity monitors' data in accordance with configuration from file
fname_imon_cfg
, - intensity normalized image is saved in the event with key
key_out
. The type of output data is the same as the type of input data.
Module configuration parameters:
...
parameter | default value | description |
---|---|---|
| "DetInfo(:Camera)" |
...
source of data |
...
|
...
"calibrated" |
...
key for input image |
...
|
...
"imon_corrected" |
...
key for output calibrated image saved in event |
...
|
...
| input file name with intensity monitors' configuration |
...
|
...
0 | verbosity:
|
...
|
...
|
...
|
...
|
...
fname_imon_cfg
file content per line: source name, short name, on/off bits for 4-channels, normalization and selection, minimal, maximal and averaged intensities:
...
Code Block | ||
---|---|---|
| ||
IntensityMonitorsData: Summary for parser BATCH_RUN_NUMBER 0020 BATCH_NUMBER_OF_EVENTS 75 |
...
parameter | default value | description |
---|---|---|
|
...
"BldInfo(FEEGasDetEnergy)" |
...
source name for intensity monitor |
...
|
...
"BldInfo(XCS-IPM-02)" |
...
source name for intensity monitor |
...
|
...
"BldInfo(XCS-IPM-mono)" |
...
source name for intensity monitor |
...
|
...
"DetInfo(XcsBeamline.1:Ipimb.4)" |
...
source name for intensity monitor |
...
|
...
"DetInfo(XcsBeamline.1:Ipimb.5)" |
...
source name for intensity monitor |
...
|
...
"txt" |
...
file type may be "txt" or "bin" |
...
|
...
"intensity-monitor-data.txt" |
...
file name for data from intensity monitors |
...
|
...
"intensity-monitor-comments.txt" |
...
file name for comments |
...
|
...
0 | verbosity:
|
...
|
...
|
...
|
...
|
...
|
...
|
...
Module ImgAlgos::CSPadArrSaveInFile
Wiki Markup |
---|
This module saves the CSPad data array formatted as \[5920=4*8*185\]\[388\] in output file for each passes event.
Module configuration parameters: |
...
parameter | default value | description |
---|---|---|
| "DetInfo(:Cspad)" |
...
input source of data | |
|
...
| key for input data, for example, it might be "calibrated" | |
|
...
"cspad-arr" |
...
out file name prefix for saved array | |
|
...
0 | module verbosity:
|
...
|
...
|
...
|
...
|
...
Module ImgAlgos::CSPadArrAverage
...
This type of averaging algorithm may be useful for pedestal defenition in case of large amplitude fluctuations.
Module configuration parameters:
...
parameter | default value | description |
---|---|---|
| "DetInfo(:Cspad)" |
...
input source of data | |
|
...
| key for input data, for example, it might be "calibrated" | |
|
...
"cspad-ave.dat" |
...
out file with averaged amplitudes | |
|
...
"cspad-rms.dat" |
...
out file with rms | |
|
...
1<<31U | number of events before stage 1 | |
|
...
100 | additional number of events before stage 2 | |
|
...
0 | gate_width for stage 1 | |
|
...
0 | gate_width for stage 2 | |
|
...
0 | module verbosity:
|
...
|
...
|
...
|
...
|
...
|
...
Default version of the configuration parameters works the same way as cspad_mod.CsPadPedestals. In this case module gets raw events and stage 0 continues for entire input data sample.
...
Alternative to the cspad_mod.CsPadCalib
algorithm for the common mode correction.
Takes the CSPad data array with subtracted pedestals, evaluate the average amplitude for each 2x1 section for amplitudes below the threshold, and subtract it from all pixel amplitudes. This algorithm consumes about 30 ms/event on psana0205.Module configuration parameters:
parameter | default value | description |
---|---|---|
| "DetInfo( |
...
: |
...
Cspad)" |
...
source of data for CSPad | |
|
...
"calibrated" |
...
key for input data, by default expects data from | |
|
...
"cm_subtracted" |
...
output key for the next data processing stage | |
|
...
30 | threshold to exclude the large pixel amplitudes in average |
Module ImgAlgos::CSPadBkgdSubtract
...
Note | |||||||
---|---|---|---|---|---|---|---|
|
Module configuration parameters:
...
parameter | default value | description |
---|---|---|
| "DetInfo(:Cspad)" |
...
input source of data | |
|
...
| key for input data, by default use raw data | |
|
...
"bkgd_subtracted" |
...
output key for the next data processing stage | |
<ac:structured-macro ac:name="unmigrated-wiki-markup |
...
" ac:schema-version="1" ac:macro-id="86c19b61-6dda-4ae5-bf1f-eddfd32cbe7e"><ac:plain-text-body><![CDATA[ | | "cspad_background.dat" |
...
file with CSPad array [4*8*185 |
...
] |
...
[388 |
...
] |
...
of |
...
averaged |
...
background | ]]></ac:plain-text-body></ac:structured-macro> |
|
...
0 | CSPad sector in quad from 0 to 7 | |
|
...
0 | module verbosity:
|
...
|
...
|
...
|
...
|
...
See also Example for Module ImgAlgos::CSPadBkgdSubtract.
...
Wiki Markup |
---|
The file {{mask_fnname}} has the same structure as files for pedestals and background with dimensions \[4*8*185\]\[388\]. Masked pixels are indicated by 0-th in this file. This file can be generated, for example, from the averaged background file, using amplitude threshold. This can be done with auxiliary python script {{MakePixelMask.py}} as explained in [Example for Module ImgAlgos::CSPadMaskApply|PSDM:Psana Module Examples#Example for Module ImgAlgos::CSPadMaskApply]. |
Module configuration parameters:
...
parameter | default value | description |
---|---|---|
| "DetInfo(:Cspad)" |
...
input source of data | |
|
...
| key for input data, by default use raw data | |
|
...
"bkgd_subtracted" |
...
output key for the next data processing stage | |
<ac:structured-macro ac:name="unmigrated-wiki-markup |
...
" ac:schema-version="1" ac:macro-id="6a7d2904-2d90-4400-a146-46a07df5ef71"><ac:plain-text-body><![CDATA[ | | "cspad_mask.dat" |
...
file with CSPad mask array [4*8*185 |
...
] |
...
[388 |
...
] | ]]></ac:plain-text-body></ac:structured-macro> |
|
...
0 | this amplitude will replace the amplitude in each masked pixel | |
|
...
1 | control bits for applied mask:
|
...
|
...
|
...
|
...
|
...
|
...
0 | module verbosity:
|
...
|
...
|
...
|
...
|
...
Module ImgAlgos::CSPadArrNoise
Wiki Markup |
---|
This module works on CSPad data array shaped as \[5920=4*8*185\]\[388\], uses the "median algorithm" to evaluate the signal and noise for each pixel, evaluates S/N ratio for each pixel, counts the fraction of events where {{S/N > SoNThr}}, and writes the same shape arrays for pixel mask and status information in the {{maskfile}} and {{statusfile}}, respectively. The {{statusfile}} contains for each pixel the fraction of events where {{S/N > SoNThr}}. This module presents a part of features implemented in the module [ImgAlgos::CSPadArrPeakFinder|PSDM:Psana Module Catalog#Module ImgAlgos::CSPadArrPeakFinder]. |
Module configuration parameters:
...
parameter | default value | description |
---|---|---|
| "DetInfo(:Cspad)" |
...
input source of data | |
|
...
| key for input data, for example, it might be "calibrated" | |
|
...
"cspad-pix-status.dat" |
...
out file with pixel status: fraction of noisy images | |
|
...
"cspad-pix-mask.dat" |
...
out file with pixel mask | |
|
...
3 | radial parameter of the area for median algorithm | |
|
...
1 | radial band width of the area for median algorithm | |
|
...
3 | S/N threshold for each pixel to be considered as noisy | |
|
...
0.1 |
...
fraction of noisy images above which pixel is masked in the | |
|
...
0 | module verbosity:
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
See also Example for Module ImgAlgos::CSPadArrNoise.
...
- in the constructor and
beginJob(...)
method:- enter input parameters,
- (re)set the initial mask of noisy pixels from file
hot_pix_mask_file
(if its name is specified in the configuration file), - do necessary initialization of work arrays.
- in the
event(...)
method the main part of "median algorithm" is implemented:Wiki Markup fill \[4\]\[8\]\[185\]\[388\] per-pixel arrays:
m_stat
- number of events with|S/N| > SoNThr
,m_signal
- signal amplitude, or 0(zero) for masked pixels,m_proc_status
- sets 255 forS/N > SoNThr
or 0(zero) for masked pixels.
- use arrays
m_proc_status
andm_signal
to find peaks:Wiki Markup iterate over \[185\]\[388\] 2x1 pixels and find the connected regions (using recursive flood-filling algorithm)
- create vector of peaks
v_peaks
ofstruct Peak
, usingpeak_npix_min
,peak_npix_max
, andpeak_amp_tot_thr
parameters,
- loop over
v_peaks
, count total amplitude and the number of peaks in the event. - decide if the event selected or not based on
event_npeak_min
,event_amp_tot_thr
, andselection_mode
parameters. - periodically dynamically re-generate the mask, based on
m_stat
array andfrac_noisy_imgs
parameter. When to start and for how many events to update the mask is defined by thenevents_mask_update
andnevents_mask_accum
parameters, respectively. - save
m_signal
in file for selected events, depending onout_file_bits
parameter. - put the vector with peaks
v_peaks
in the evt with key=key_peaks_out
.
- in the
endJob(...)
method, depending on bit status inout_file_bits
:- save current hot-pixel mask in the file
hot_pix_mask_out_file
- save current fraction of events with noisy/signal pixels in the file
frac_noisy_evts_file
- save current hot-pixel mask in the file
...
parameter | default value | description |
---|---|---|
|
...
"DetInfo(:Cspad)" |
...
input source of data | |
|
...
| key for input data, for example, it might be "calibrated" | |
|
...
| key for output signal array. If the string non-empty, the array is added in the datagram for each event (before selection). | |
|
...
"peaks" |
...
key for vector of found peaks in the selected event | |
|
...
"cspad-pix-mask-in.dat" |
...
in read the pixel mask from file | |
|
...
"cspad-pix-mask-out.dat" |
...
out write current pixel mask in the file | |
|
...
"cspad-pix-frac-out.dat" |
...
out file with per-pixel fraction of noisy images | |
|
...
"./cspad-ev-" |
...
out file with signal CSPad array. Time stamp is added. | |
|
...
3 | radial parameter of the area for median algorithm | |
|
...
1 | radial band width of the area for median algorithm | |
|
...
3 | S/N threshold for each pixel to be considered as noisy | |
|
...
5 | S/N threshold for each pixel to be considered as noisy | |
|
...
0.9 |
...
fraction of noisy images above which pixel will be masked | |
|
...
4 | minimal number of connected pixels for the good peak | |
|
...
25 | maximal number of connected pixels for the good peak | |
|
...
0. |
...
threshold on total signal amplitude of the group of connected pixels, if =0:OFF | |
|
...
7. |
...
threshold on peak S/N (S and N are sums over connected pixels) | |
|
...
10 | threshold on minimal number of good peaks for the event selection | |
|
...
10000 | threshold on maximal number of good peaks for the event selection | |
|
...
0. |
...
threshold on total signal amplitude in ADU of all good peaks for the event selection, if =0:OFF | |
|
...
0 | number of skipped events before each mask re-evaluation cycle | |
|
...
50 | number of events for the mask re-evaluation | |
|
...
SELECTION_ON |
...
selection mode, other allowed values are: SELECTION_OFF, or SELECTION_INV | |
|
...
0 | control on |
...
writing of files:
|
...
|
...
|
...
|
...
|
...
|
...
0 | module verbosity:
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
See also Example for Module ImgAlgos::CSPadArrPeakFinder.
...