find_ranges_without_overlap

Returns the part of r1 that does not contain r2 When summing pixels for reflectivity, include the full range, which means that for a range [a, b], b is included. The range that we return must always exclude the pixels included in r2.

Parameters:
  • r1 (list) –

    Range of pixels to consider

  • r2 (list) –

    Range of pixels to exclude

Returns:
  • list

    List of ranges that do not overlap with r2

functional_background

Estimate background using a linear function over a background range that may include the specular peak. In the case where the peak is included in the background range, the peak is excluded from the background.

Parameters:
  • ws (Mantid workspace) –

    Workspace containing the data

  • event_reflectivity (EventReflectivity) –

    EventReflectivity object

  • peak (list) –

    Range of pixels that define the peak

  • bck (list) –

    Range of pixels that define the background. It contains 4 pixels, defining up to two ranges.

  • low_res (list) –

    Range in the x direction on the detector

  • normalize_to_single_pixel (bool, default: False ) –

    If True, the background is normalized to the number of pixels used to integrate the signal

  • q_bins (ndarray, default: None ) –

    Array of Q bins

  • wl_dist (ndarray, default: None ) –

    Wavelength distribution for the case where we use weighted events for normatization

  • wl_bins (ndarray, default: None ) –

    Array of wavelength bins for the case where we use weighted events for normatization

  • q_summing (bool, default: False ) –

    If True, sum the counts in Q bins

Returns:
  • ndarray

    Reflectivity background

  • ndarray

    Reflectivity background error

side_background

Original background substration done using two pixels defining the area next to the specular peak that are considered background.

Parameters:
  • ws (Mantid workspace) –

    Workspace containing the data

  • event_reflectivity (EventReflectivity) –

    EventReflectivity object

  • peak (list) –

    Range of pixels that define the peak

  • bck (list) –

    Range of pixels that define the background

  • low_res (list) –

    Range in the x direction on the detector

  • normalize_to_single_pixel (bool, default: False ) –

    If True, the background is normalized to the number of pixels used to integrate the signal

  • q_bins (ndarray, default: None ) –

    Array of Q bins

  • wl_dist (ndarray, default: None ) –

    Wavelength distribution for the case where we use weighted events for normatization

  • wl_bins (ndarray, default: None ) –

    Array of wavelength bins for the case where we use weighted events for normatization

  • q_summing (bool, default: False ) –

    If True, sum the counts in Q bins

Returns:
  • ndarray

    Reflectivity background

  • ndarray

    Reflectivity background error