xpdtools.pipelines package

Submodules

xpdtools.pipelines.raw_pipeline module

Main pipeline chunks for processing images to I(Q) and PDF

xpdtools.pipelines.raw_pipeline.calibration(wavelength, calibrant, detector, is_calibration_img, geo_input, bg_corrected_img, img_shape, calib_setting=None, **kwargs)[source]

Pipeline chunk for performing and loading calibration

Parameters:
  • wavelength (Stream)

  • calibrant (Stream)

  • detector (Stream)

  • is_calibration_img (Stream)

  • geo_input (Stream)

  • bg_corrected_img (Stream)

  • img_shape (Stream)

  • calib_setting (None or dict, optional) – The calibration setting, if set to {"setting": False} the user will not be prompted to perform calibration on calibration samples. This is useful for not performing calibration when re analyzing an entire experiment.

Returns:

ns – The namespace created by the chunk

Return type:

dict

xpdtools.pipelines.raw_pipeline.gen_mask(pol_corrected_img, cal_binner, img_counter, mask_setting=None, mask_kwargs=None, **kwargs)[source]

Pipeline chunk for creating masks

Parameters:
  • pol_corrected_img (Stream)

  • cal_binner (Stream)

  • img_counter (Stream)

  • mask_setting (dict, optional) – The setting for the frequency of the mask. If set to {'setting': 'auto'} each image gets a mask generated for it, if set to {'setting': 'first'} only the first image in the series has a mask generated for it and all subsequent images in the series use that mask, if set to {'setting': 'none'} then no image is masked. Defaults to {'setting': 'auto'}.

  • mask_kwargs (dict, optional) – The keyword arguments passed to xpdtools.tools.mask_img. Defaults to ``dict(edge=30, lower_thresh=0.0, upper_thresh=None,

    alpha=3, auto_type=”median”, tmsk=None,)``

Returns:

ns – The namespace created by the chunk

Return type:

dict

xpdtools.pipelines.raw_pipeline.image_process(raw_foreground, raw_foreground_dark, raw_background, raw_background_dark, bg_scale=1.0, **kwargs)[source]

Pipeline chunk to perform image processing, including dark and background subtraction.

Parameters:
  • raw_foreground (Stream)

  • raw_foreground_dark (Stream)

  • raw_background (Stream)

  • raw_background_dark (Stream)

  • bg_scale (float, optional) – The background scale factor. Defaults to 1

Returns:

ns – The namespace created by the chunk

Return type:

dict

xpdtools.pipelines.raw_pipeline.integration(map_res, mask, wavelength, pol_corrected_img, **kwargs)[source]

Pipeline chunk for computing azimuthal integration

Parameters:
  • map_res (Stream)

  • mask (Stream)

  • wavelength (Stream)

  • pol_corrected_img (Stream)

Returns:

ns – The namespace created by the chunk

Return type:

dict

xpdtools.pipelines.raw_pipeline.pdf_gen(q, mean, composition, **kwargs)[source]

Pipeline chunk for computing the Structure Factor S(Q), Reduced Structure Factor F(Q) and Atomic Pair Distribution Function (PDF).

Parameters:
  • q (Stream)

  • mean (Stream)

  • composition (Stream)

  • kwargs (Any) – The keyword arguments passed to the PDF creation, please see PDFgetx3 for more details

Returns:

ns – The namespace created by the chunk

Return type:

dict

xpdtools.pipelines.raw_pipeline.scattering_correction(geometry, img_shape, bg_corrected_img, polarization_factor=0.99, **kwargs)[source]

Pipeline chunk for performing scattering corrections on images, including the polarization correction.

Parameters:
  • geometry (Stream)

  • img_shape (Stream)

  • bg_corrected_img (Stream)

  • polarization_factor (float, optional) – The polarization factor used to correct the image. Defaults to .99

Returns:

ns – The namespace created by the chunk

Return type:

dict

Module contents