nxtomomill.utils.flat_reducer.flat_reducer#

nxtomomill.utils.flat_reducer.flat_reducer(scan_filename, ref_start_filename, ref_end_filename, mixing_factor, entry_name='entry0000', median_or_mean='mean', save_intermediated=False, reuse_intermediated=False, overwrite=True, dark_default_value=300)[source]#

this method extracts first a flatfield and dark from two reference scans. After flats and darks extraction, an interpolation is done according to the mixing_factor parameter. The obtained flats and dark are then saved associating them for a given target scan_filename

Parameters
  • scan_filename (str) – The target scan. A nexus filename for which we want to create reduced scan from the scans given by ref_start and ref_end parameters ( a scan at the beginning, another at the end)

  • ref_start_filename (str) – The scan with projections to be used as reference for the beginning of the measures.

  • ref_end_filename (str) – The scan with projections to be used as reference at the end of the measures.

  • mixing_factor (float) – The mixing factor giving the averaged flats as (ref_start-darkB+darkS)*(1-mixing_factor)+(ref_end-darkE+darkS)*mixing_factor

  • entry_name (str) – The entry name, it defaults to entry0000

  • median_or_mean (str) – Either “mean” or “median”. Default is “mean”

  • save_intermediated (bool) – Save intermediated flats and darks corresponding to extremal reference scans (ref_start_filename, refa_filename) for later usage. Defaults to False

  • use_intermediated – Save intermediated flats and darks and if already presente reuse them for mixing

  • overwrite (bool) – enforce overwriting of the reduced flats/darks