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_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, MythenDetector: angcal._angcal.MythenDetector) → None
Parameters:

MythenDetector (MythenDetector) – storing all mythen specific parameters

add_flatfield(self: angcal._angcal.FlatField, photon_counts: numpy.ndarray[numpy.uint32], incident_intensity: int, detector_angle: float) → None

Add flatfield from single acquisition to the accumulated flatfield

Parameters:
  • photon_counts (numpy.ndarray of uint32, shape (n_channels,)) – Photon counts for each strip

  • incident_intensity (int) – Incident intensity for normalization

  • detector_angle (float) – Position of detector [degrees]

normalize_flatfield(self: angcal._angcal.FlatField) → None

Normalize the accumulated flatfield

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

property bad_channels

Each element is True if the channel is bad, otherwise False.

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