mcsas3.mccore.McCore#
- class mcsas3.mccore.McCore(measData: dict | None = None, model: McModel | None = None, opt: McOpt | None = None, loadFromFile: Path | None = None, loadFromRepetition: int | None = None, resultIndex: int = 1)[source]#
Bases:
object
The core of the MC procedure.
- Parameters:
modelFunc – SasModels function
measData (dict) – measurement data dictionary with Q, I, ISigma containing arrays. For 2D data, Q is a two-element list with [Qx, Qy]. This is why it’s not a Pandas Dataframe.
pickParameters (dict) – dict of values with new random picks, named by parameter names
modelParameterLimits (dict) – dict of value pairs (tuples) with random pick bounds, named by parameter names
x0 – continually updated new guess for total scaling, background values.
weighting – volume-weighting / compensation factor for the contributions
nContrib – number of contributions
- __init__(measData: dict | None = None, model: McModel | None = None, opt: McOpt | None = None, loadFromFile: Path | None = None, loadFromRepetition: int | None = None, resultIndex: int = 1)[source]#
Methods
__init__
([measData, model, opt, ...])accept
()accept pick
contribIndex
()evaluate
([testData])scale and calculate goodness-of-fit (GOF) from all contributions
calculate the total intensity from all contributions
iterate
()pick, re-evaluate and accept/reject
load
(loadFromFile, loadFromRepetition[, ...])loads the configuration and set-up from the extended NXcanSAS file
optimize
()iterate until target GOF or maxiter reached
replace single contribution with new contribution, recalculate intensity and GOF
reject
()reject pick
store
(filename)stores the resulting model parameter-set of a single repetition in the NXcanSAS object, ready for histogramming
- evaluate(testData: dict | None = None) float [source]#
scale and calculate goodness-of-fit (GOF) from all contributions
- load(loadFromFile: Path, loadFromRepetition: int, resultIndex: int = 1) None [source]#
loads the configuration and set-up from the extended NXcanSAS file