Page History
...
Module CSPadPixCoords::SaveImageInFile
(Re-named from deprecated module CSPadPixCoords::CSPadImageGetTest).
Moved to ImgAlgos::SaveImageInFile is a psana module class, which works after the CSPadImageProducer or CSPadInterpolImageProducer. It receives the CSPadPixCoords::Image2D<double>
or ndarray<double,2>
image object from the event. (This image object may be used in further data processing.) For test purpose, the image of particular event, defined by the eventSave
parameter in configuration file, is saved in the text file with standard predefined name like cspad_image_ev<number>.txt
.
Module configuration parameters:
source
(default: "CxiDs1.0:Cspad.0") – source of data,key
(default: "Image2D") – input image key,eventSave
(default: 0) – event number to save the CSPad image file,saveAll
(default: false) – save or not all selected events,fname
(default: "cspad_image_ev") – common part of the output file name, event number with extension ".txt" will be added at the end.print_bits
(default: 0) – verbosity:- =0 - print nothing,
- +1 - input pars,
- +2 - info about saved files.
Package ImgPixSpectra
For complete reference see the Doxygen documentation.
Note |
---|
Package ImgPixSpectra is available since release |
Package ImgPixSpectra is intended to accumulate the spectra for all pixels of the image array.
Different modules of this package work with different data types for detectors like CSPad, mini-CSPad, Opal, Princeton camera, etc. All modules have the same interface and the same functionality.
In the loop over events from beginJob
to endJob
the image pixel amplitudes are accumulated in the 2-d array,
of the shape (<number-of-pixels>, <number-of-spectral-bins>). The first parameter is defined by the image size. The second is passed as an external parameter of the psana configuration file (psana.cfg
) along with minimal and maximal amplitudes. At the endJob
the spectral array is saved in file with specified name. Auxiliary file with the name extension *.sha
is created in order to save the shape parameters. For example, the "mini-cspad-pix-spectra.txt.sha" outpuit file contains
Code Block |
---|
NPIXELS 143560
NBINS 100
AMIN 500
AMAX 1000
NEVENTS 2549
ARRFNAME mini-cspad-pix-spectra.txt
|
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
.
Package ImgPixSpectra
For complete reference see the Doxygen documentation.
Note |
---|
Package ImgPixSpectra is available since release |
Package ImgPixSpectra is intended to accumulate the spectra for all pixels of the image array.
Different modules of this package work with different data types for detectors like CSPad, mini-CSPad, Opal, Princeton camera, etc. All modules have the same interface and the same functionality.
In the loop over events from beginJob
to endJob
the image pixel amplitudes are accumulated in the 2-d array,
of the shape (<number-of-pixels>, <number-of-spectral-bins>). The first parameter is defined by the image size. The second is passed as an external parameter of the psana configuration file (psana.cfg
) along with minimal and maximal amplitudes. At the endJob
the spectral array is saved in file with specified name. Auxiliary file with the name extension *.sha
is created in order to save the shape parameters. For example, the "mini-cspad-pix-spectra.txt.sha" outpuit file contains
Code Block |
---|
NPIXELS 143560
NBINS 100
AMIN 500
AMAX 1000
NEVENTS 2549
ARRFNAME mini-cspad-pix-spectra.txt
|
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.
source
(default: "DetInfo(:Cspad2x2SxrBeamline.0:Opal1000.1)" ) – 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.
- Opal camera
or source
(default: "DetInfo(:Princetonsource
(default: "DetInfo(SxrBeamline.0:Opal1000.1)" ) – source of data for Opal camera
orsource
(default: "DetInfo(: Princeton )" ) – source of data for Princeton camera
See also Example for Package ImgPixSpectra.
...
Code Block |
---|
struct Peak{
double x;
double y;
double ampmax; // amplitude in the peak masimum
double amptot; // total amplitude in the range of {{peak_radius}}
unsigned npix; // number of pixels in the range of {{peak_radius}}
} ;
|
Module configuration parameters:
source
(default: "DetInfo()") – source of datakey
(default: "") – key for input image datapeaksKey
(default: "peaks") – key for output list of peaksthreshold_low
(default: 10) – low threshold on pixel amplitudethreshold_high
(default: 100) – high threshold on pixel amplitudesigma
(default: 1.5) – width of the Gaussian for smearingsmear_radius
(default: 1) – radius in pixel for smearingpeak_radius
(default: 3) – radius in pixel for peak findingxmin
(default: 0) – minimal column numberxmax
(default: 100000) – maximal column numberymin
(default: 0) – minimal row numberymax
(default: 100000) – maximal row numbertestEvent
(default: 0) – event number to save images and print info for test purposefinderIsOn
(default: true) – On/Off algorithmprint_bits
(default: 0) – finder verbosity:- =0 - print nothing,
- +1 - input pars,
- +2 - summary,
- +4 - number of peaks in the event,
- +8 - per event each peak parameters,
- +16- info about input image format.
Remarks:
- This algorithm consumes ~15 ms/event on psana0101 for full Opal1000 (1024x1024) camera image.
- Smearing algorithm use a "safety margin" which is currently set to 10 pixels (offset from each boarder of the full image size).
See also Example for Module ImgAlgos::ImgPeakFinder.
Module ImgAlgos::ImgPeakFilter
;
|
Module configuration parameters:
source
(default: "DetInfo()") – source of datakey
(default: "") – key for input image datapeaksKey
(default: "peaks") – key for output list of peaksthreshold_low
(default: 10) – low threshold on pixel amplitudethreshold_high
(default: 100) – high threshold on pixel amplitudesigma
(default: 1.5) – width of the Gaussian for smearingsmear_radius
(default: 1) – radius in pixel for smearingpeak_radius
(default: 3) – radius in pixel for peak findingxmin
(default: 0) – minimal column numberxmax
(default: 100000) – maximal column numberymin
(default: 0) – minimal row numberymax
(default: 100000) – maximal row numbertestEvent
(default: 0) – event number to save images and print info for test purposefinderIsOn
(default: true) – On/Off algorithmprint_bits
(default: 0) – finder verbosity:- =0 - print nothing,
- +1 - input pars,
- +2 - summary,
- +4 - number of peaks in the event,
- +8 - per event each peak parameters,
- +16- info about input image format.
Remarks:
- This algorithm consumes ~15 ms/event on psana0101 for full Opal1000 (1024x1024) camera image.
- Smearing algorithm use a "safety margin" which is currently set to 10 pixels (offset from each boarder of the full image size).
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 filterIsOn
is "on" ("true" or "yes" state) and the number of found peaks exceeds the n_peaks_min
the event is passed for further analysis/processing.
Module configuration parameters:
source
(default: "DetInfo()") – source of datakey
(default: "peaks") – key for input list of peaks, should be the same aspeaksKey
inImgPeakFinder
threshold_peak
(default: 0) – threshold on peak amplitudethreshold_total
(default: 0) – threshold on total peak intensity (in the matrix around peak)n_peaks_min
(default: 1) – minimal number of peaks above all thresholdsfilterIsOn
(default: true) – On/Off the filterprint_bits
(default: 0) – filter verbosity:- =0 - print nothing,
- +1 - input pars,
- +2 - summary,
- +4 - peaks' info,
- +8 - event ID.
Module ImgAlgos::SaveImageInFile
SaveImageInFile is a psana module class, which works after the CSPadImageProducer or CSPadInterpolImageProducer. It receives the CSPadPixCoords::Image2D<double>
or ndarray<double,2>
image object from the event. (This image object may be used in further data processing.) For test purpose, the image of particular event, defined by the eventSave
parameter in configuration file, is saved in the text file with standard predefined name like cspad_image_ev<number>.txt
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 filterIsOn
is "on" ("true" or "yes" state) and the number of found peaks exceeds the n_peaks_min
the event is passed for further analysis/processing.
Module configuration parameters:
source
(default: "DetInfo()CxiDs1.0:Cspad.0") – source of datakey
(default: "peaks") – key for input list of peaks, should be the same aspeaksKey
inImgPeakFinder
- ,
key
threshold_peak
(default: 0"Image2D") – threshold on peak amplitudethreshold_total
input image key,eventSave
(default: 0) – threshold on total peak intensity (in the matrix around peak)event number to save the CSPad image file,saveAll
n_peaks_min
(default: 1false) – minimal number of peaks above all thresholdssave or not all selected events,fname
filterIsOn
(default: true) – On/Off the filter"cspad_image_ev") – common part of the output file name, event number with extension ".txt" will be added at the end.print_bits
(default: 0) – filter verbosity:- =0 - print nothing,
- +1 - input pars,
- +2 - summary,
- +4 - peaks' info,
- +8 - event IDinfo about saved files.
Module ImgAlgos::Tahometer
...