Page History
...
Include Page | ||||
---|---|---|---|---|
|
About
This page provides a list of existing modules for psana framework. Only the modules that are included in the standard analysis releases appear on this page.
Package psana
Psana package include several simple modules which do generic tasks that do not need knowledge of the event data types.
Module psana.EventKeys
This module dumps the list of the event keys in the event or configuration store. Event key is a triplet of data type, data source address, and string key.
...
Note that one can specify EventKeys
instead of psana.EventKeys
as psana
package name is optional.
Module psana.PrintEventId
This module prints the content of the Event ID object on every event.
...
Code Block |
---|
[info:psana.PrintEventId] event ID: XtcEventId(run=100, time=2010-12-12 11:09:36.300506429-08) [info:psana.PrintEventId] event ID: XtcEventId(run=100, time=2010-12-12 11:09:36.317163082-08) |
Module psana.PrintSeparator
This module prints separator line on every event. Can be used to indicate event boundaries in job's log.
...
Code Block |
---|
[info:/root/] ================================================================================ [info:psana.PrintEventId] event ID: XtcEventId(run=100, time=2010-12-12 11:09:36.300506429-08) [info:/root/] ================================================================================ [info:psana.PrintEventId] event ID: XtcEventId(run=100, time=2010-12-12 11:09:36.317163082-08) |
Package psana_examples
This package contains modules that are meant to be used as examples of accessing different data types or framework services. Can be used by developers as templates for new modules.
Module psana_examples.DumpAcqiris
Extracts and dumps the content of Acqiris configuration (Psana::Acqiris::ConfigV1
) and event data (Psana::Acqiris::DataDescV1
) objects.
...
source
(default: "DetInfo(:Acqiris)") – data source address
Module psana_examples.DumpAcqTdc
Extracts and dumps the content of Acqiris TDC configuration (Psana::Acqiris::TdcConfigV1
) and event data (Psana::Acqiris::TdcDataV1
) objects.
...
source
(default: "DetInfo(:AcqTDC.0)") – data source address
Module psana_examples.DumpBld
Extracts and dumps the content of beamline data objects (Psana::Bld::BldDataEBeamV0
, Psana::Bld::BldDataEBeam
, Psana::Bld::BldDataPhaseCavity
, Psana::Bld::BldDataFEEGasDetEnergy
, and Psana::Bld::BldDataIpimb
).
...
eBeamSource
(default: "BldInfo(EBeam)") – data source address forPsana::Bld::BldDataEBeam
phaseCavSource
(default: "BldInfo(PhaseCavity)") – data source address forPsana::Bld::BldDataPhaseCavity
feeSource
(default: "BldInfo(FEEGasDetEnergy)") – data source address forPsana::Bld::BldDataFEEGasDetEnergy
ipimbSource
(default: "BldInfo(NH2-SB1-IPM-01)") – data source address forPsana::Bld::BldDataIpimb
Module psana_examples.DumpCamera
Extracts and dumps the content of camera configuration (Psana::Camera::FrameFexConfigV1
) and event data (Psana::Camera::FrameV1
and Psana::Camera::TwoDGaussianV1
) objects.
...
source
(default: "DetInfo(:Opal1000)") – data source address
Module psana_examples.DumpControl
Extracts and dumps the content of scan control configuration (Psana::ControlData::ConfigV1
) object.
...
source
(default: "ProcInfo()") – data source address
Module psana_examples.DumpCsPad
Extracts and dumps the content of CsPad configuration (Psana::CsPad::ConfigV*
) and event data (Psana::CsPad::DataV*
) objects.
...
source
(default: "DetInfo(:Cspad)") – data source address
Module psana_examples.DumpEncoder
Extracts and dumps the content of encoder configuration (Psana::Encoder::ConfigV1
) and event data (Psana::Encoder::DataV*
) objects.
...
source
(default: "DetInfo(:Encoder)") – data source address
Module psana_examples.DumpEpics
Extracts and dumps the list of EPICS PVs and their values and status information on every event.
Module psana_examples.DumpEvr
Extracts and dumps the content of Evr configuration (Psana::EvrData::ConfigV*
and Psana::EvrData::IOConfigV1
) and event data (Psana::EvrData::DataV*
) objects.
...
source
(default: "DetInfo(:Evr)") – data source address
Module psana_examples.DumpFccd
Extracts and dumps the content of FCCD configuration (Psana::FCCD::FccdConfigV*
) objects. To dump event data objects use psana_examples.DumpCamera module.
...
source
(default: "DetInfo(:Fccd)") – data source address
Module psana_examples.DumpIpimb
Extracts and dumps the content of IPIMB configuration (Psana::Ipimb::ConfigV1
) and event data (Psana::Ipimb::DataV1
) objects.
...
source
(default: "DetInfo(:Ipimb)") – data source address
Module psana_examples.DumpLusi
Extracts and dumps the content of LUSI configuration (Psana::Lusi::DiodeFexConfigV1
, Psana::Lusi::IpmFexConfigV1
, and Psana::Lusi::PimImageConfigV1
) and event data (Psana::Lusi::DiodeFexV1
and Psana::Lusi::IpmFexV1
) objects.
...
tmSource
(default: "DetInfo(:Tm6740)") – data source address forPsana::Lusi::PimImageConfigV1
ipimbSource
(default: "DetInfo(:Ipimb)") – data source address for other data
Module psana_examples.DumpOpal1k
Extracts and dumps the content of Opal1000 configuration (Psana::Opal1k::ConfigV1
) object. To dump event data objects use psana_examples.DumpCamera module.
...
source
(default: "DetInfo(:Opal1000)") – data source address
Module psana_examples.DumpPnccd
Extracts and dumps the content of pnCCD configuration (Psana::PNCCD::ConfigV*
) and event data (Psana::PNCCD::FrameV1
) objects.
...
source
(default: "DetInfo(:pnCCD)") – data source address
Module psana_examples.DumpPrinceton
Extracts and dumps the content of Princeton configuration (Psana::Princeton::ConfigV1
) and event data (Psana::Princeton::FrameV1
) objects.
...
source
(default: "DetInfo(:Princeton)") – data source address
Module psana_examples.DumpPulnix
Extracts and dumps the content of Pulnix configuration (Psana::Pulnix::TM6740ConfigV*
) objects.
...
source
(default: "DetInfo(:Tm6740)") – data source address
Module psana_examples.EBeamHist
This module is an example of histogramming service usage. It extracts beam line data and fills couple of histograms with the beam parameters.
...
eBeamSource
(default: "BldInfo(EBeam)") – data source address
Package cspad_mod
Package cspad_mod contains common modules useful for analysis of data from CsPad detector.
Module cspad_mod.CsPadPedestals
This module is supposed to run on dark cspad2x2 frame data. It calculates average and standard deviation values for each pixel and writes these values to output files in text format.
...
This should produce file pedestals.dat
in the current directory. As the source address is more specific this configuration file can be used even if input data contain more than one CsPad device.
Module cspad_mod.CsPad2x2Pedestals
This module is supposed to run on cspad2x2 dark frame data. It calculates average and standard deviation values for each pixel and writes these values to output files in text format.
...
This should produce file pedestals.dat
in the current directory. As the source address is more specific this configuration file can be used even if input data contain more than one CsPad2x2 device.
Module cspad_mod.CsPadCalib
This module performs standard CsPad calibration procedures: per-pixel pedestal subtraction and common mode correction. The algorithms used in calibrations are identical to translator algorithms, the result of calibration should be the same as the data stored in HDF5 files.
...
inputKey
(default is empty) – string key used to locate uncalibrated data objects in eventoutputKey
(default is "calibrated") – string key used to store calibrated data objects in eventdoPedestals
(default is "yes") – can be set to "no" to explicitly disable pedestal subtraction algorithmdoPixelStatus
(default is "yes") – can be set to "no" to explicitly disable reading of pixel status data, all pixels will be used for common modedoCommonMode
(default is "yes") – can be set to "no" to explicitly disable common mode algorithmdoPixelGain
(default is "yes") – can be set to "no" to explicitly disable pixel gain correction algorithm
Module cspad_mod.CsPadFilter
This is a filter module which implements skipping for the events which have too low signal in CsPad. filtering algorithm can be controlled trough the module parameter and/or parameters in calibration file. The name of the calibration file is "filter" and it will be searched in the standard calibration directories of the experiment.
...
With the default parameters module works with non-calibrated data, to switch to calibrated data add the module cspad_mod.CsPadCalib before filter and change inputKey
parameter to calibrated
.
Package CSPadPixCoords
Package CSPadPixCoords calculates the 2x1 section, quad, and CSPad pixel coordinates and produces the image.
For complete reference select Doxygen documentation.
Module CSPadPixCoords::PixCoordsTest
This module demonstrates of how to use the PixCoords2x1, PixCoordsQuad, and PixCoordsCSPad classes
in order to pre-calculate pixel coordinates, taking into account the calibration parameters.
Relevant images are produced in combination of the pixel coordinates with event data and saved in text files.
...
calibDir
(default: "/reg/d/psdm/CXI/cxi35711/calib") – directory with calibration files,typeGroupName
(default: "CsPad::CalibV1") – data type and group names,source
(default: "CxiDs1.0:Cspad.0") – source of data,runNumber
(default: 32U) – run number for calibration file,events
(default: 32U) – number of events before stop a job,filter
(default: false) – on/off for potential selection filter.
Module CSPadPixCoords::CSPadImageProducer
CSPadImageProducer works in psana framework. It does a few operation as follows:
...
- By default the
key
corresponds to raw data. - If the
imgkey
is defined as "Image2D", the image is saved in the event as aCSPadPixCoords::Image2D<double>
object, otherwise (by default) as andarray<double,2>
object.
Module CSPadPixCoords::CSPadInterpolImageProducer
CSPadInterpolImageProducer works in psana framework. It does a few operation as follows:
...
Module configuration parameters are the same as for the CSPadPixCoords::CSPadImageProducer.
Module CSPadPixCoords::CSPad2x2ImageProducer
CSPad2x2ImageProducer works in psana framework. It does a few operation as follows:
...
See also Example for Module CSPadPixCoords::CSPad2x2ImageProducer.
Module CSPadPixCoords::CSPadNDArrProducer
CSPadNDArrProducer is a module for psana framework. It uses specified source
and inkey
parameters,
...
source
(default: ":Cspad.0") – source of data,inkey
(default: "") – key for data processing stage,outkey
(default: "cspad_ndarr") – output key for image saved in event,outtype
(default: "float") – type of output data,print_bits
(default: 0) – verbosity:- =0 - print nothing,
- +1 - input pars,
- +4 - consumed time per event.
Package ImgPixSpectra
For complete reference see the Doxygen documentation.
...
This information can be used in analysis or presentation of this array.
Module ImgPixSpectra::CSPadPixSpectra
Module configuration parameters:
source
(default: "CxiDs1.0:Cspad.0" ) – source of data for CSPadevents
(default: 1<<31U ) – number of events before stop a jobinputKey
(default: "" ) – input key for data processing stageamin
(default: 0. ) – minimal spectral amplitudeamax
(default: 1000. ) – maximal spectral amplitudenbins
(default: 100 ) – number of bins in spectraarr_fname
(default: "..._spectral_array.txt" ) – output file name
Module ImgPixSpectra::MiniCSPadPixSpectra
The only difference in interface of this module from previous is in the default name for the source parameter and the output file name.
source
(default: "DetInfo(:Cspad2x2)" ) – source of data for MiniCSPad
Module ImgPixSpectra::CameraPixSpectra
The only difference in interface of this module from previous is in the default name for the source parameter and the output file name.
...
See also Example for Package ImgPixSpectra.
Package ImgAlgos
This packages contains a few psana
modules for analysis and image processing
Module ImgAlgos::Tahometer
This module measures the time interval for entire job and for each dn
events and prints the rate info as requested by the print_bits
parameter.
...
See also Example for Module ImgAlgos::Tahometer.
Module ImgAlgos::TimeStampFilter
This module passes only the events if their time stamp is in the requested range.
The range of allowed time stamps is defined by the configuration parameters.
...
See also Example for TimeStampFilter and XtcOutputModule.
Module ImgAlgos::EventNumberFilter
This filter selects events by their number counting from the beginning of job, starting from 0. The event number is not a parameter which is associated with event. Use this filter cautiously on your own risk for debugging purpose only.
...
- If the
first
and/orlast
event numbers are defined, then the filter will select events in this range only. - If the
evtstring
is defined, only listed events of event ranges will be selected. For example, theevtstring
parameter can be defined as
that means the list of events:Code Block 2,5,11-15,20-25,29,30
In theCode Block 2 5 11 12 13 14 15 20 21 22 23 24 25 29 30
evtstring
parameter the comma "," and sign minus "-" as a dash are the only allowed separators. Blank spaces are also allowed. Other characters may abort the program. Theevtstring
mode has higher priority than the 1st mode.
ThefilterIsOn
allows easy turn on/off this filter in*.cfg
file.
Module ImgAlgos::PnccdImageProducer
Functionality:
- gets the pnccd data from the event, based on specified
source
andinkey
parameters, - puts the
ndarray<double,2>
object with pnccd 1024x1024 image in the event using specifiedoutimgkey
parameter.
...
See also Example for Module ImgAlgos::PnccdImageProducer.
Module ImgAlgos::CameraImageProducer
This module takes care about any generic camera image.
Functionality:
...
See also Example for Module ImgAlgos::CameraImageProducer.
Module ImgAlgos::PrincetonImageProducer
This module gets the Princeton camera image data and put it in the event as an image.
Functionality:
...
See also Example for Module ImgAlgos::PrincetonImageProducer.
Module ImgAlgos::ImgAverage
This module averages over events the per-pixel data of the image array (ndarray<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:
...
Default parameters are set for regular single-stage averaging without any constrains.
See also Example for Module ImgAlgos::ImgAverage.
Module ImgAlgos::ImgMaskEvaluation
This module gets the image data array (ndarray<T,2>), where T stands for double, float, int, uint8_t, or uint16_t, and evaluates two masks:
...
See also Example for Module ImgAlgos::ImgMaskEvaluation.
Module ImgAlgos::ImgCalib
ImgCalib gets the raw image from data and process it as follows:
...
See also Example for Module ImgAlgos::ImgCalib.
Module ImgAlgos::ImgIntForBins
Functionality:
- ImgIntForBins uses the
source
andkey_in
parameters to get the input image (asndarray<T,2>
object), where T stands for uint16_t, int, float, uint8_t, or double, - 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
.
...
source
(default: "DetInfo(:Camera)") – source of data,key_in
(default: "") – key for input image,fname_map_bins
(default: "") – input file name for map of bin indexes,fname_int_bins
(default: "") – output file name for intensity(bin,event),number_of_bins
(default: 10) – number of bins for output intensities, if map has bins \>=number_of_bins
they will be ignored,print_bits
(default: 0) – verbosity:- =0 - print nothing,
- +1 - input pars,
- +2 - time stamp for each event,
- +4 - detailed info about input file pars,
- +8 - the first 100 chars of the output intensity string
- +32 - info about open/close output file
Module ImgAlgos::ImgRadialCorrection
This module averages the image pixel amplitude in r-phi bins, normalizes it per single pixel and subtracts the average amplitude from each pixel. Image is obtained from event by its source
and inkey
values. The output corrected image is saved in the event with outkey
keyword. Carthesian to polar coordinate transformation is done with respect to center coordinates xcenter
, ycenter
. The central region (r<rmin) and edges of the image (r>rmax) pixels can be removed from further consideration by setting rmin
and rmax
. The number of radial bins is defined as an int(rmax-rmin)
. The number of angular bins is set by n_phi_bins
.
...
See also Example for Module ImgAlgos::ImgRadialCorrection.
Module ImgAlgos::ImgPixAmpFilter
The ImgAlgos::ImgPixAmpFilter is a filter for event selection.
This filter counts the number of image pixels in the specified window with amplitude exceeding the threshold
. If the number of high-amplitude pixels exceed the numPixMin
, the event is passed for further analysis.
...
- The default
key
("Image2D") stands for theCSPadPixCoords::Image2D<double>
image object. Otherkey
names work for thendarray<double,2>
image object. - 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.
Module ImgAlgos::ImgPeakFinder
This algorithm was motivated by users of amo42112:
1. Select the pixels in the window xmin
, xmax
, ymin
, ymax
with amplitudes above the threshold_low
.
2. Smear image for selected pixels, using 2-d matrix of weights over pixels
from -smear_radius
to +smear_radius
around each smeared pixel amplitude.
The matrix of weights is defined by the 2-d Gaussian function of width sigma
.
3. Find peaks as pixels with absolute-maximal amplitude above the threshold_high
in the center of the matrix -peak_radius
to +peak_radius
.
4. Put the vector of found peaks in the event with key peaksKey
. Each entry of this vector has an object of the struct Peak
, containing x, y positions, peak pixel amplitude, the total amplitude in the matrix, defined by the peak_radius
, and the number of pixels in the matrix above threshold_low
:
...
See also Example for Module ImgAlgos::ImgPeakFinder.
Module ImgAlgos::ImgPeakFilter
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.
...
See also Example for Module ImgAlgos::ImgPeakFilter.
Module ImgAlgos::ImgPeakFinderAB
This module finds peaks in the ndarray<double,2>
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 ndarray<double,2>
object.
See also Example for Module ImgAlgos::ImgPeakFinderAB.
Module ImgAlgos::ImgSpectra
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:
...
See also Example for Module ImgAlgos::ImgSpectra.
Module ImgAlgos::ImgSpectraProc
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.
...
See also Example for Module ImgAlgos::ImgSpectraProc.
Module ImgAlgos::ImgSaveInFile
Note |
---|
Aka depricated modules: CSPadPixCoords::CSPadImageGetTest, CSPadPixCoords::SaveImageInFile, and ImgAlgos::SaveImageInFile. |
...
See also Example for Module ImgAlgos::ImgSaveInFile.
Module ImgAlgos::ImgVsTimeSplitInFiles
This module is a part of complex algorithm, described in Command Line Interface For Time Correlation Analysis.
...
<fname_prefix>-<fname-common>-b<block-number>.<file_type>
<fname_prefix>-<fname-common>-med.txt
<fname_prefix>-<fname-common>-time.txt
is implemented in stand-alone c++ moduleCode Block ImgAlgos/app/corana.cpp (or ImgAlgos/test/corana.cpp)
whereNote Note, the application in the
test
directory is compiled and run by the commands:
scons test
<path>/corana -f <fname_data>
-t <fname_tau>\
-h
-l <logfile>\
-b <basedir>\
<fname_data>
is one of the data files:<fname_prefix>-<fname-common>-b<block-number>.<file_type>
, which needs to be available;<fname_tau>
is a file with a list of indexes of tau for evaluation of correlations. By default or if the file is missing, the list of indexes will be generated automatically, and for book-keeping is saved in the file<fname_prefix>-<fname-common>-tau.txt
;<basedir>
is a directory for all data files, which is current by default;<logfile>
is an output log-file, or standard output by default.
Module ImgAlgos::ImgTimeStampList
This module is reduced from ImgAlgos::ImgVsTimeSplitInFiles.
Functionality is restricted to:
...
fname
(default: "tstamp-list.txt") – output files common prefix,print_bits
(default: 0 ) – verbosity:- =0 - print nothing,
- +1 - input pars,
- +2 - event record,
- +4 - job summary,
- +8 - print summary parameters for parser.
Module ImgAlgos::ImgIntMonCorr
This module is intended for CorAna
project.
ImgIntMonCorr gets the image and intensity monitor data, evaluate the normalization factor, applies this factor to the image intensity, and saves the corrected image in the event.
...
Code Block |
---|
BldInfo(FEEGasDetEnergy) FEEGasDetEnergy 1 1 1 1 0 1 3.000000 7.500000 5.250000 BldInfo(XCS-IPM-02) XCS-IPM-02 1 1 1 0 1 0 10.000000 13.000000 11.500000 BldInfo(XCS-IPM-mono) XCS-IPM-mono 1 1 1 0 0 1 14.500000 16.000000 15.250000 DetInfo(XcsBeamline.1:Ipimb.4) Ipimb.4 1 1 1 1 0 0 -1.000000 -1.000000 1.000000 DetInfo(XcsBeamline.1:Ipimb.5) Ipimb.5 1 1 1 1 0 0 -1.000000 -1.000000 1.000000 |
Module ImgAlgos::IntensityMonitorsData
This module is intended for CorAna
project.
It gets the 5 intensity monitors data (4 channels for each) and saves them in the text or binary file file_data
. Comments (or header) for this file is saved separately in file_header
. It also prints the summary parameters for parser, for example:
...
imon1
(default: "BldInfo(FEEGasDetEnergy)" – source name for intensity monitor,imon2
(default: "BldInfo(XCS-IPM-02)") – source name for intensity monitor,imon3
(default: "BldInfo(XCS-IPM-mono)") – source name for intensity monitor,imon4
(default: "DetInfo(XcsBeamline.1:Ipimb.4)") – source name for intensity monitor,imon5
(default: "DetInfo(XcsBeamline.1:Ipimb.5)") – source name for intensity monitor,file_type
(default: "txt"); – file type may be "txt" or "bin",file_data
(default: "intensity-monitor-data.txt") – file name for data from intensity monitors,file_header
(default: "intensity-monitor-comments.txt") – file name for comments,print_bits
(default: 0 ) – verbosity:- =0 - print nothing,
- +1 - input pars,
- +2 - event record,
- +4 - job summary,
- +8 - summary parameters for parser,
- +16 - all available data for all sources,
- +32 - information about opened/closed files.
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: |
source
(default: "DetInfo(:Cspad)") – input source of datakey
(default: "") – key for input data, for example, it might be "calibrated"outfile
(default: "cspad-arr") – out file name prefix for saved arrayprint_bits
(default: 0) – module verbosity:- =0 - print nothing,
- +1 - input pars,
- +2 - event ID,
- +4 - time stamp,
- +8 - saved file names.
Module ImgAlgos::CSPadArrAverage
Wiki Markup |
---|
This module averages the CSPad data array and saves two files for averaged and rms values in CSPad format \[5920=4*8*185\]\[388\]. In contrast to the [cspad_mod.CsPadPedestals|PSDM:psanaPsana - Module Catalog#Modulecspadmod.CsPadPedestals], the input data can be specified with a {{key}}, that allows to average CSPad array for already pre-processed data, for example {{"calibrated"}}. This feature can be used to evaluate the averaged signal or background event. Implemented algorithm of averaging allows to eliminate large statistical fluctuations in the pixel amplitude spectrum. In advanced case averaging may have up to three stages, depending on configuration parameters: |
...
See also Example for Module ImgAlgos::CSPadArrAverage.
Module ImgAlgos::CSPadCommonModeCorrection
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.
...
source
(default: "DetInfo(:Cspad)" ) – source of data for CSPadinputKey
(default: "calibrated" ) – key for input data, by default expects data fromcspad_mod.CsPadCalib
outputKey
(default: "cm_subtracted" ) – output key for the next data processing stageampthr
(default: 30 ) – threshold to exclude the large pixel amplitudes in average
Module ImgAlgos::CSPadBkgdSubtract
This module uses the CSPad array, specified by the configuration parameters source
and inputKey
, subtracts the background, defined in the file bkgd_fname
, and saves the resulting array in the event with outputKey
. The subtracted background array is normalized on the sum of pixel amplitudes in the quad section norm_sector
, which can be set from 0 to 7.
...
See also Example for Module ImgAlgos::CSPadBkgdSubtract.
Module ImgAlgos::CSPadMaskApply
This module uses the CSPad array, defined by the configuration parameters source
and inkey
, apply the mask from file mask_fnname
and saves the masked data with key outkey
. For masked pixels the amplitude will be replaced by the value from masked_amp
.
...
source
(default: "DetInfo(:Cspad)" ) – input source of datainkey
(default: " " ) – key for input data, by default use raw dataoutkey
(default: "bkgd_subtracted" ) – output key for the next data processing stageWiki Markup {{mask_fname}} (default: "cspad_mask.dat" ) -- file with CSPad mask array \[4*8*185\]\[388\]
masked_amp
(default: 0) – this amplitude will replace the amplitude in each masked pixelmask_control_bits
(default: 1) – control bits for applied mask:- =0 - do not apply any mask,
- +1 - apply mask from file,
- +2 - mask two long edges of 2x1,
- +4 - mask two short edges of 2x1,
- +8 - mask two short rows in the middle of 2x1 (rows with wide pixels).
print_bits
(default: 0) – module verbosity:- =0 - print nothing,
- +1 - input pars (in beginJob),
- +2 - event ID (in event),
- +4 - mask statistics (in beginJob),
- +8 - part of the mask array (in beginJob).
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:psanaPsana - Module Catalog#Module ImgAlgos::CSPadArrPeakFinder]. |
...
See also Example for Module ImgAlgos::CSPadArrNoise.
Module ImgAlgos::CSPadArrPeakFinder
Wiki Markup |
---|
Module {{ImgAlgos::CSPadArrPeakFinder}} is a psana-based implementation of the "median algorithm" for peak finding in CSPad data array shaped as \[5920=4*8*185\]\[388\]. This algorithm was first implemented in [myana|PCDS:myana user guide]/[Cheetah|https://github.com/antonbarty/cheetah] by Anton Barty and Co. The "median algorithm" assumes that the amplitude level of background and noise for each pixel can be estimated as a mean and RMS of the surrounding pixels, located in the ring with parameters {{rmin}} and {{dr}} around the pixel in question. The threshold {{SoNThr_noise}} on signal over noise (S/N) ratio allow to asset the pixel amplitude as a large noise fluctuation. Statistics of pixels above the S/N threshold accumulated over many images can be used to form the noisy-pixel mask. For example, if the fraction of images where pixel exceeds the S/N threshold grater than certain value ({{frac_noisy_imgs}}=0.9), the pixel is considered as noisy. The permanent bad pixel mask (see module [ImgAlgos::CSPadMaskApply|PSDM:psana -Psana Module Catalog#Module ImgAlgos::CSPadMaskApply]) and dynamically evaluated noisy pixel mask are used to get rid of bad pixels and improve the image quality. Healthy pixels with S/N above threshold ({{SoNThr_signal}} about 3-5) are treated as potential signals. Using recursive flood-filling algorithm the groups of connected signal pixels can be found and considered as a candidate for a diffraction peaks. Peak finding algorithm uses the amplitude, S/N thresholds, and limits on number of pixels in the connected region (parameters {{peak_amp_tot_thr}}, {{peak_SoN_thr}}, {{peak_npix_min}}, and {{peak_npix_max}}) in order to define the peak. Finally, the event is selected or discarded depending on number of found peaks and total amplitude threshold, defined by the parameters {{event_npeak_min}}, {{event_npeak_max}}, and {{event_amp_tot_thr}}, respectively. |
...
See also Example for Module ImgAlgos::CSPadArrPeakFinder.
Module ImgAlgos::CSPadArrPeakAnalysis
This module is intended for analysis of the results obtained in the peak finding algorithm implemented in the ImgAlgos::CSPadArrPeakFinder
module.
...