Page History
...
See also Example for Module ImgAlgos::ImgPeakFinderAB.
Module ImgAlgos::ImgHitFinder
ImgHitFinder is created by request for amo74213. It works pretty similar to ImgCalib, but the threshold algorithms are extended and background subtraction is removed.
It gets the raw image from data and process it as follows:
- subtracts pedestals,
- apply gain factors,
- apply mask, and
- apply one of the threshold algorithms
and saves the corrected image or hit-pixel map in the event.
Functionality:
- ImgHitFinder uses the
source
andkey_in
parameters to get the input raw image (asndarray<T,2>
object), where T stands for uint16_t, int, float, uint8_t, or double, - 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.
Details:
- All files with input calibration parameters should have the same shape as image and formatted as regular text file containing 2d matrix (table) of float (or integer) values, with columns separated by space(s), ' ', and rows(lines) terminated by the '\n'.
- Masking algorithm assumes that good pixels in the
fname_mask
file should be marked by '1' (ones) and bad pixels – by '0' (zeros). The bad masked pixel amplitudes are substituted by themasked_value
.
parameter | default value | description |
---|---|---|
| "DetInfo(:Camera)" | source of data |
|
| key for input image |
| "calibrated" | output key for calibrated image saved in event |
|
| input file name for pedestals, applied if the file name is specified |
|
| input file name for mask, applied if the file name is specified |
|
| input file name for gain, applied if the file name is specified |
|
| input file name for threshold, applied if the file name is specified and |
| 0. | amplitude value (in ADU) substituted for masked pixels |
| 1 | threshold mode: 0 - is not applied; 1 - constant level threshold defined by |
| def | threshold parameter - its meaning depends on |
| 0. | the amplitude substituted in pixels below threshold |
| def | the amplitude substituted in pixels below threshold, by default - amplitude above threshold is not substituted |
| 1 | the window in image, which is used to make hit map |
| def | the window in image, which is used to make hit map, by default - use all rows-1 |
| 1 | the window in image, which is used to make hit map |
| def | the window in image, which is used to make hit map, by default - use all columns-1 |
| 0 | verbosity:
|
Corrections are not applied by default or with empty file names.
See also Example for Module ImgAlgos::ImgHitFinder.
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:
...
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="421e0d91b197d294-13fe4fce-47664f19-b704ae7a-535a7efe1c4e4cf5b21347f0"><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:
|
...
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="348a548043cdd63c-04840a2c-4ff442b2-ad6b87be-22d369743289697aec910bcc"><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:
|
...