Page History
...
- gets the pixel coordinates from PixCoords2x1, PixCoordsQuad, and PixCoordsCSPad classes,
- gets data from the event (from Psana::CsPad::DataV#, Psana::CsPad::ElementV# (where # stands for 1 or 2) data objects or from ndarray<Tndarray<
const
T,3> of shape [N][185][388]) - produces the
ndarray<doublendarray<
orconst
double,2>Image2D<double>
object with CSPad image for each event, - adds the image object in the event for processing in other modules.
Time consumed to fill the CSPad image array (currently 1750x1750) is measured to be about 40 msec/event on psana0105. - produces image size pixel map array where real/fake pixels are marked as 1/0, respectively. This array is saved in the
env.calibStore()
asndarray<int16ndarray<
forconst
int16_t ,2>source
. If the file namefname_pixmap
is not empty the map will be saved in this file in text format. - produces image size map of pixel indexes in the flatten [4][8][185][388] array where fake pixels are marked as -1. This array is saved in the
env.calibStore()
asndarray<int32ndarray<
forconst
int32_t ,2>source
. If the file namefname_pixnum
is not empty the map will be saved in this file in text format.
...
- gets the pixel coordinates from PixCoords2x1, PixCoordsQuad, and PixCoordsCSPad classes,
- makes the arrays of neighbour addresses (quad, section, row, column) and weights as a function of the bin indexes (ix, iy) of the CSPad image,
- gets data from the event,
- produces the Image2D object with interpolated CSPad image for each event,
- adds the
ndarray<doublendarray<
orconst
double,2>CSPadPixCoords::Image2D<double>
object in the event for processing in other modules.
In this module we use 4-node bi-linear interpolation algorithm.
Time consumed to fill the CSPad image array (currently 1750x1750) is measured to be about 200 msec/event on psana0106. We consider options for acceleration using GPU or multi-core processing.
...
- gets geometry alignment parameters
center
andtilt
from/reg/d/psdm/<inst>/<experiment>/calib/...
directory - gets the pixel coordinates from PixCoords2x1 and PixCoordsCSPad2x2 classes,
- gets data from the event,
- produces the
Image2D<double>
orndarray<doublendarray<
object with CSPad image for each event,const
double,2> - adds the image object in the event for processing in other modules.
The CSPad2x2 image array is currently shaped as (400,400).
...
- By default the empty
inkey
corresponds to raw data. - If the
outimgkey
is defined as "Image2D", the image is saved in the event as aCSPadPixCoords::Image2D<double>
object, otherwise (for other names) as andarray<doublendarray<
object.const
double,2>
See also Example for Module CSPadPixCoords::CSPad2x2ImageProducer.
...
- gets CSPAD configuration from the environment frame
Psana::CsPad::ConfigV#
, - gets CSPAD data from the event frames
Psana::CsPad::DataV#
,Psana::CsPad::ElementV#
, - creates the data array as
ndarray<Tndarray<
, where T stands forconst
T,3>outtype
, which may be double, float, int, or uint16, - puts the data array in the event with
outkey
tag.
The data array ndarray<Tndarray<
has a shape (N,185,388), where N≤32.const
T,3>
This array is combined from data arrays for quads, ndarray<int32ndarray<
with shape (M,185,388), where M≤8, taking into account the CSPAD configuration.const
int32_t,3>
...
- gets CSPAD2x2 configuration from the environment frame
Psana::CsPad2x2::ConfigV#
, - gets CSPAD2x2 data from the event frames
Psana::CsPad2x2::ElementV#
, - creates the data array as
ndarray<Tndarray<
, where T stands forconst
T,3>outtype
, which may be double, float, int, or uint16, - puts the data array in the event with
outkey
tag.
The data array ndarray<Tndarray<
has a shape (185,388,2).const
T,3>
...
- gets Andor data from the event for specified
source
andkey_in
parameters, - puts the
ndarray<doublendarray<
object with camera image in the event using specifiedconst
double,2>key_out
parameter.
parameter | default value | description |
---|---|---|
| "DetInfo(:Andor)" | source of data |
|
| key for input data |
| "andorimg" | output key for image saved in event |
| "asdata" | out data type: implemented values: asdata (default, unsigned shortuint16_t), float, double, int and int16. |
| 0 | verbosity:
|
...
- gets pnCCD data from Psana::PNCCD::FramesV1 object from the event for specified
source
andkey_in
parameters, - puts the
ndarray<TOUTndarray<
object of shape 4x512x512 specifiedconst
TOUT,3>key_out
parameter.
...
- gets from the event store the object with pnCCD data of type
- Psana::PNCCD::FullFrameV1 containing four [512][512] frames with T=uint16_t, or
ndarray<Tndarray<const T,3>
, where shape=[4][512][512], T=unsigned short, float, double, int, or int16,
source
andinkey
parameters
- puts the
ndarray<Tndarray<
object with pnccd [1024+gap_rows][1024+gap_cols] image in the event using specifiedconst
T,2>outimgkey
parameter.
...
- gets any camera image data from the event for specified
source
andkey_in
parameters, - puts the
ndarray<doublendarray<
object with camera image in the event using specified
double,2>const
key_out
parameter.
parameter | default value | description |
---|---|---|
| "DetInfo(:Opal1000Camera)" | source of data |
|
| key for input data |
| "pnccdimg" | output key for image saved in event |
| "asdata" | out data type: implemented values: asdata (default, uint16_t), float, double, int and int16. |
| true | on/off the amplitude offset using configuration data (not applied for |
| 0 | verbosity:
|
See also Example for Module ImgAlgos::CameraImageProducer.
...
- gets the Princeton camera image data from event for specified
source
andkey_in
parameters, - puts the
ndarray<uint16ndarray<const uint16_t,2>
object with image in the event using specifiedkey_out
parameter.
...
- Gets acqiris configuration and data from
Acqiris::ConfigV1
andAcqiris::DataDescV1
, objects usingparameters source
andkey_in
; - produces
ndarray<doublendarray<const double,2>
ofshape[] = {nbrChannels, nbrSamples}
for waveforms and time stamps; - saves configuration data in the file defined by
fname_prefix
; - saves waveforms and time stamps in the event store with keys
key_wform
andkey_wtime
.
...
- Gets Acqiris waveforms from event store as
ndarray<double ndarray<
object using parametersconst
double,2>source
andkey_in
; - performs waveform selection controlled by parameters:
thresholds
,is_postive_signal
,do_inverse_selection
, in the range depending on local event numbersskip_events
andproc_events;
- after number of events
proc_events
or at the end of job (whatever happens first), saves array of averaged waveforms in the text file with name constructed fromfname_ave_prefix
and in the event store using parameterssource
andkey_
average
.
...
- Gets Acqiris waveforms from event store as
ndarray<double ndarray<
object using parametersconst
double,2>source
andkey_in
; - processes events in the range depending on local event numbers
skip_events
andproc_events;
- at the 1st processed event loads the fname_base_line file with baseline
ndarray<doublendarray<
;const
double,2> - subtract baseline from waveforms;
- save corrected waveforms in the event store as
ndarray<doublendarray<
object usingconst
double,2>parameters source
andkey_out.
...
- Gets Acqiris waveforms from event store as
ndarray<double ndarray<
object using parametersconst
double,2>source,
key_wform, key_wtime
; runs constant-fraction discriminator algorithm on all acqiris channels using user-specified per-channel parameters;
saves edges into the event as a set of ndarray<double,1>;
parameter
default value
description
source
"DetInfo(:Acqiris)"
Source of data.
key_wform
"acqiris_wform"
Key for input ndarray with waveforms (either raw, or subtracted using AcqirisCalib module) from
evt
store.key_wtime
"acqiris_wtime"
Key for input ndarray with waveform times from
evt
store.key_edges "acqiris_edges_"
Key for output ndarray<double,1> with calibrated waveforms. This key will have the acqiris channel number (1 thru 20) appended to the end of it, and the data for that channel will be added to the event only if edges were found.
baselines ""
A list of baseline values (one per channel) to subtract from the waveform in volts.
fractions ""
A list of fractions (one per channel) between 0 and 1. The edge-time reported will be at the time when the pulse is at this fraction of the peak value.
thresholds ""
A list of threshold values (one per channel) in volts that indicate a new edge should be found. If this value is less than the baseline, then the algorithm will look for negative pulses, otherwise it will look for positive pulses.
deadtimes ""
A list of deadtimes (one per channel) in seconds. After each edge the algorithm will ignore any new hits in this time interval.
leading_edges ""
A list of 0/1 values (one per channel) indicating whether edge-times are desired for leading edges (1) or falling edges (0).
...
This module averages over events the per-element data of the image array (ndarray<Tndarray<
, where T is implemented for almost all types: int, int16, uint, float, double etc., NDim≤5) and saves files for sum, averaged, rms values, mask, and, the hot pixel map. Input const
T,NDim>ndarray
can be specified by the source
and key
parameters. Averaging may have up to three stages, depending on configuration parameters:
...
- NDArrCalib uses the
source
andkey_in
parameters to get anyndarray<Tndarray<
object from the event store, whereconst
T,NDIM>T
stands foruint16_t, int, float, uint8_t,
ordouble, 1≤NDim≤5
, - automaticly gets parameters from calibration store for types
pedestals, common_mode, pixel_status, pixel_gain,
andpixel_rms,
- gets parameters from user-defined files
fname_bkgd
andfname_mask
, if their names are specified, the specified by the
do_...
parameter corrections are applied to raw datandarray<Tndarray<
as follows:const
T,NDIM>
- subtracts pedestals,
- subtracts common mode,
- subtracts normalized background,
- apply gain factors,
- apply hot/bad pixel_status mask,
- apply mask, and
- apply threshold as a common low level,
- apply per-pixel threshold as N*RMS,
- and saves the corrected ndarray<doublendarray<
const
double,NDim> in the event with keykey_out
...
parameter | default value | description |
---|---|---|
| DetInfo(:Camera) | source of data |
|
| key for input |
| calibrated | output key for calibrated image saved in event |
| false | true: pedestals subtracted if available in calib store |
| false | true: common mode correction is evaluated and applied |
| false | true: bad/hot pixels in pixel_status are masked |
| false | true: mask is applied if the file |
| false | true: normalized background is subtracted if the file |
| false | true: |
| false | true: per-pixel threshold is applied if |
| false | true: low level |
|
| input file name for background, applied if the file name is specified |
|
| input file name for mask, applied if the file name is specified |
| 0. | intensity value (in ADU) substituted for masked pixels |
| 3. | threshold as a number of sigmas to |
| 0. | common low level threshold in ADU |
| 0. | intensity substituted for pixels below threshold |
| 0 | minimal index in flatten ndarray, which is used for background normalization |
| 100 | maximal index in flatten ndarray, which is used for background normalization |
| 2 | index increment in flatten ndarray, which is used for background normalization |
| 0 | verbosity:
|
...
This module averages over events the per-pixel data of the image array (ndarray<doublendarray<const
double,2>) and saves files for averaged, rms values, and, if requested, the hot pixel mask. Input data can be specified by the source
and key
parameters. Averaging may have up to three stages, depending on configuration parameters:
...
This module gets the image data array (ndarray<Tndarray<const
T,2>), where T stands for double, float, int, uint8_t, or uint16_t, and evaluates two masks:
...
- ImgCalib uses the
source
andkey_in
parameters to get the input raw image (asndarray<Tndarray<
object), where T stands for uint16_t, int, float, uint8_t, or double,const
T,2> - gets the calibration parameters from files
fname_peds
,fname_bkgd
,fname_gain
,fname_mask
, andfname_nrms
, if their names are specified, the specified by the file name corrections are applied per-pixel to raw data image as follows:
Code Block bgColor #F7F7ED A_cor = A_raw (1) - pedestal | if the file name is specified in the parameter "fname_peds" (2) - N*background | if the file name is specified in the parameter "fname_bkgd" (3) * gain | if the file name is specified in the parameter "fname_gain" (4) apply mask | if the file name is specified in the parameter "fname_mask" (5) apply N*RMS threshold | if the file name is specified in the parameter "fname_nrms" (6) apply threshold | if the "do_threshold" = true
- corrected image is saved in the event with key
key_out
asdouble
type.
...
- ImgIntForBins uses the
source
andkey_in
parameters to get the input image (asndarray<Tndarray<
object), where T stands for uint16_t, int, float, uint8_t, or double,const
T,2> - gets the pixel-bin indexes from files
fname_map_bins
, which has a size of image, - calculates average per pixel intensity for each of
number_of_bins
bin (from 0 tonumber_of_bins-1
), - saves the 2-D array of <I>(event, bin) in file
fname_int_bins
.
...
- The default
key
("Image2D") stands for theCSPadPixCoords::Image2D<double>
image object. Otherkey
names work for thendarray<doublendarray<
image object.const
double,2> - The
xmin
,xmax
,ymin
,ymax
(in pixels) defines the window in the image for pixel counting. Default values means the entire image range. - The
threshold
,numPixMin
, and the window extents have to be adjusted for particular experiment.
...
This module finds peaks in the ndarray<doublendarray<
image object. Algorithm and the list of parameters are the same as described is section Module ImgAlgos::CSPadArrPeakFinder. The only difference is that the image size is defined by the const
double,2>ndarray<doublendarray<
object.const
double,2>
See also Example for Module ImgAlgos::ImgPeakFinderAB.
...
- ImgHitFinder uses the
source
andkey_in
parameters to get the input raw image (asndarray<Tndarray<
object), where T stands for uint16_t, int, float, uint8_t, or double,const
T,2> - gets the calibration parameters from files
fname_peds
,fname_gain
,fname_mask
, andfname_thre
, if their names are specified, the specified by the file name corrections are applied per-pixel to raw data image as follows:
Code Block bgColor #F7F7ED A_cor = A_raw (1) - pedestal | if the file name is specified in the parameter "fname_peds" (2) * gain | if the file name is specified in the parameter "fname_gain" (3) apply mask | if the file name is specified in the parameter "fname_mask" (4) apply threshold | if the file name is specified in the parameter "fname_thre"
- corrected image is saved in the event with key
key_out
asdouble
(or unsigned for pixel map) type.
...
This module is motivated by the discussion with Josef Frisch, Ryan Coffee, Nick Hartmann. In xppi0412 etc. experiments they need to extract two spectra from Opal1000 camera image for signal and reference, evaluate their relative difference, and find peak position in the differential spectrum.
Module mgAlgos::ImgSpectra
works as follows:
- gets the
ndarray<doublendarray<
image object from event,const
double,2> - 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<doublendarray<
object with shape (3,<number-of-columns>) in the event.const
double,2> - Further analytical work is assumed to be done in the next module ImgAlgos::ImgSpectraProc.
...
ImgSaveInFile works after the CSPadImageProducer, CSPadInterpolImageProducer, CameraImageProducer, PnccdImageProducer, etc., which produce image object in formats CSPadPixCoords::Image2D<T>
or ndarray<Tndarray<
, where the const
T,2>T
stands for one of the data types, double, float, int, uint8_t, or uint16_t.
...
- get image for each event as an
ndarray<Tndarray<
object,const
T,2> - 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
.
...
- ImgIntMonCorr uses the
source
andkey_in
parameters to get the input image (asndarray<doublendarray<
object),const
double,2> - 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.
...