mcsas3.osb.optimizeScalingAndBackground#

class mcsas3.osb.optimizeScalingAndBackground(measDataI=None, measDataISigma=None, xBounds=None)[source]#

Bases: object

small class derived from the McSAS mcsas/backgroundscalingfit.py class, quickly provides an optimized scaling and background value for two datasets.

TODO (maybe): include a porod background contribution? If so, Q should be available to this class.

Parameters:
  • measDataI – numpy array of measured intensities

  • measDataISigma – associated uncertainties

  • modelDataI – array of model intensities.

  • x0 – optional, two-element tuple with initial guess for scaling and background

  • xBounds – optional, constraints to the optimization, speeds up when appropriate constraints are given

Returns:

  • x – length 2 ndarray with optimized scaling parameter and background parameter

  • cs – final reduced chi-squared

Usage example:

o = optimizeScalingAndBackground(measDataI, measDataISigma) xOpt, rcs = o.match(modelDataI)

__init__(measDataI=None, measDataISigma=None, xBounds=None)[source]#

Methods

__init__([measDataI, measDataISigma, xBounds])

initialGuess(optI)

match(modelDataI[, x0])

optFunc(sc, measDataI, measDataISigma, ...)

validate()

Attributes

measDataI

measDataISigma

xBounds