Normalized FlatField¶
The FlatField class is responsible for storing the flatfield correction factors. It provides methods to read and create normalized flatfield from a list of files containing flatfield acquisitions.
Note
The method read_module_parameters_from_file expects a text file in the format below. Each line denotes the DG parameters for each module.
module 0 center 643.320033188550 +- 0.0000 conversion 0.657661167459868E-04 +- 0.0000 offset 0.00000000000000 +- 0.0000
module 1 center 633.044070300816 +- 0.0000 conversion 0.657618957538105E-04 +- 0.0000 offset 5.00486981153634 +- 0.0000
If youre file format deviates from the above format read your file into a np.ndarray(,3) where the first dimension stores the centers the second the conversions and the third the offsets and set DGparameters directly.
Note
The method read_bad_channels_from_file expects a text file using the format below. Each line denotes the index of a bad channel. Consecutive bad channels can be stored on one line e.g. channels with 20-42 are bad channels.
1
2
20-42
100
1002-1004
If youre file format deviates from the above format read your file into a boolean np.ndarray and set bad_channels directly.
- class angcal._angcal.FlatField¶
Bases:
pybind11_object- __init__(self: angcal._angcal.FlatField, MythenDetectorSpecifications: angcal._angcal.MythenDetectorSpecifications) None¶
- Parameters:
MythenDetectorSpecifications (MythenDetectorSpecifications) – storing all mythen specific parameters
- create_normalized_flatfield_from_filelist(self: angcal._angcal.FlatField, file_list: list[os.PathLike], mythen_file_reader: angcal::MythenFileReader) None¶
Create normalized flatfield from list of files containing flatfield acquisitions
- Parameters:
file_list (list of str) – list of paths to acquisition files containing flatfield acquisitions
mythen_file_reader (MythenFileReader) – file reader to read mythen acquisition files
- diffraction_angle_from_DG_parameters(self: angcal._angcal.FlatField, module_index: int, detector_angle: float, strip_index: int, distance_to_strip: float) float¶
Calculate diffraction angle from DG module parameters (used in Beer’s Law)
- Parameters:
module_index (int) – Index of the DG module
detector_angle (float) – Detector position [degrees]
strip_index (int) – Local strip index of module e.g. 0-1279
distance_to_strip (float) – Distance to strip [given in strips]
- Returns:
Diffraction angle [degrees]
- Return type:
float
- read_bad_channels_from_file(self: angcal._angcal.FlatField, arg0: os.PathLike) None¶
read bad channels from file
- Parameters:
filename (str) – path to file containing bad channels
- read_module_parameters_from_file(self: angcal._angcal.FlatField, arg0: os.PathLike) None¶
read module parameters from file (expects following format module [module_index] center [center] +- [error] conversion [conversion] +- [error] offset [offset] +- [error])
- Parameters:
filename (str) – path to file containing module parameters
- solid_angle(self: angcal._angcal.FlatField, module_index: int, strip_index: int) float¶
Calculate solid angle of strip
- Parameters:
module_index (int) – Index of the DG module
strip_index (int) – Local strip index of module e.g. 0-1279
- Returns:
Solid angle of strip
- Return type:
float
- property bad_channels¶
Each element is
Trueif the channel is bad, otherwiseFalse.- Type:
numpy.ndarray of bool, shape (n_channels,)
- property normalized_flatfield¶
Each row corresponds to a strip/channel in the detector. The first column contains the normalized flatfield value for that strip, and the second column contains the standard deviation of the flatfield value for that strip. Values of -1.0 denote strips with insufficient coverage (e.g. due to the soft window) or strips denotes by a bad channel.
- Type:
numpy.ndarray of float, shape (n_channels, 2)
- property scale_factor¶
scale factor to scale incident intensity to reasonable values (default 1.0)
- Type:
float
- property soft_window¶
bounds [degrees] to exclude strips with lower exposure (default (3.0, 34.0)).
- Type:
tuple of floats