Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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|PCDSPSDM: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:

...

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|PCDSPSDM:Psanapsana - Module Examples#Example for Module ImgAlgos::CSPadMaskApply].

...

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|PCDSPSDM:Psanapsana - Module Catalog#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|PCDSPSDM:Psanapsana - 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.

...