xpdtools.cli package

Submodules

xpdtools.cli.process_tiff module

Main entry point for processing images to I(Q)

xpdtools.cli.process_tiff.main(poni_file=None, image_files=None, bg_file=None, mask_file=None, polarization=0.99, edge=20, lower_thresh=1.0, upper_thresh=None, alpha=3.0, auto_type='median', mask_settings='auto', flip_input_mask=True, bg_scale=1)

Run the data processing protocol taking raw images to background subtracted I(Q) files.

The data processing steps included in this protocol are: background subtraction, polarization correction, automated masking, and pixel resolution integration

Parameters:
  • poni_file (str or None, optional) – File generated from pyFAI’s calibration, if None look in the current working directory for the poni file, defaults to None.

  • image_files (str or None, optional) – File to process, if None use all the valid files in the directory, defaults to None.

  • bg_file (str or None, optional) – Background image, if None no background subtraction is performed, defaults to None.

  • mask_file (str or None, optional) – Mask file to include in the data processing, if None don’t use one, defaults to None.

  • polarization (float, optional) – The polzarization factor to use, defaults to .99, if None do not perform polarization correction

  • edge (int, optional) – The number of pixels from the edge to mask with an edge mask, defaults to 20, if None no edge mask used

  • lower_thresh (float, optional) – Threshold for lower threshold mask, all pixels with value less than this value (after background subtraction if applicable), defaults to 1. if None do not apply lower theshold mask

  • upper_thresh (float, optional) – Threshold for upper threshold mask, all pixels with value greater than this value (after background subtraction if applicable), defaults to None if None do not apply upper theshold mask

  • alpha (float, optional) – Number of standard deviations away from the ring mean to mask, defaults to 3. if None do not apply automated masking

  • auto_type ({‘median’, ‘mean’}, optional) – The type of automasking to use, median is faster, mean is more accurate. Defaults to ‘median’.

  • mask_settings ({‘auto’, ‘first’, none}, optional) – If auto mask every image, if first only mask first image, if None mask no images. Defaults to None

  • flip_input_mask (bool, optional) – If True flip the input mask up down, this helps when using fit2d defaults to True.

  • bg_scale (float, optional) – The scale for the image to image background subtraction, defaults to 1

Returns:

  • q_l (list of ndarrays) – The list of q values

  • mean_l (list of ndarrays) – The list of mean values

  • median_l (list of ndarrays) – The list of median values

  • std_l (list of ndarrays) – The list of standard deviation values

xpdtools.cli.process_tiff.make_main(_output_sinks)[source]
xpdtools.cli.process_tiff.make_pipeline(_output_sinks=True)[source]
xpdtools.cli.process_tiff.run_main()[source]

Module contents