Outputs#
This module contains the Results objects and the relevant objects to retrieve results data from the C++ module.
Converts outputs from the compiled RAT code to python dataclasses
- class RATapi.outputs.BayesResults(reflectivity: list, simulation: list, shiftedData: list, backgrounds: list, resolutions: list, layerSlds: list, sldProfiles: list, resampledLayers: list, calculationResults: RATapi.outputs.CalculationResults, contrastParams: RATapi.outputs.ContrastParams, fitParams: numpy.ndarray, fitNames: list[str], predictionIntervals: RATapi.outputs.PredictionIntervals, confidenceIntervals: RATapi.outputs.ConfidenceIntervals, dreamParams: RATapi.outputs.DreamParams, dreamOutput: RATapi.outputs.DreamOutput, nestedSamplerOutput: RATapi.outputs.NestedSamplerOutput, chain: numpy.ndarray)#
- Parameters:
reflectivity (list)
simulation (list)
shiftedData (list)
backgrounds (list)
resolutions (list)
layerSlds (list)
sldProfiles (list)
resampledLayers (list)
calculationResults (CalculationResults)
contrastParams (ContrastParams)
fitParams (ndarray)
fitNames (list[str])
predictionIntervals (PredictionIntervals)
confidenceIntervals (ConfidenceIntervals)
dreamParams (DreamParams)
dreamOutput (DreamOutput)
nestedSamplerOutput (NestedSamplerOutput)
chain (ndarray)
- class RATapi.outputs.CalculationResults(chiValues: numpy.ndarray, sumChi: float)#
- Parameters:
chiValues (ndarray)
sumChi (float)
- class RATapi.outputs.ConfidenceIntervals(percentile95: numpy.ndarray, percentile65: numpy.ndarray, mean: numpy.ndarray)#
- Parameters:
percentile95 (ndarray)
percentile65 (ndarray)
mean (ndarray)
- class RATapi.outputs.ContrastParams(scalefactors: numpy.ndarray, bulkIn: numpy.ndarray, bulkOut: numpy.ndarray, subRoughs: numpy.ndarray, resample: numpy.ndarray)#
- Parameters:
scalefactors (ndarray)
bulkIn (ndarray)
bulkOut (ndarray)
subRoughs (ndarray)
resample (ndarray)
- class RATapi.outputs.DreamOutput(allChains: numpy.ndarray, outlierChains: numpy.ndarray, runtime: float, iteration: float, modelOutput: float, AR: numpy.ndarray, R_stat: numpy.ndarray, CR: numpy.ndarray)#
- Parameters:
allChains (ndarray)
outlierChains (ndarray)
runtime (float)
iteration (float)
modelOutput (float)
AR (ndarray)
R_stat (ndarray)
CR (ndarray)
- class RATapi.outputs.DreamParams(nParams: float, nChains: float, nGenerations: float, parallel: bool, CPU: float, jumpProbability: float, pUnitGamma: float, nCR: float, delta: float, steps: float, zeta: float, outlier: str, adaptPCR: bool, thinning: float, epsilon: float, ABC: bool, IO: bool, storeOutput: bool, R: numpy.ndarray)#
- Parameters:
nParams (float)
nChains (float)
nGenerations (float)
parallel (bool)
CPU (float)
jumpProbability (float)
pUnitGamma (float)
nCR (float)
delta (float)
steps (float)
zeta (float)
outlier (str)
adaptPCR (bool)
thinning (float)
epsilon (float)
ABC (bool)
IO (bool)
storeOutput (bool)
R (ndarray)
- class RATapi.outputs.NestedSamplerOutput(logZ: float, logZErr: float, nestSamples: numpy.ndarray, postSamples: numpy.ndarray)#
- Parameters:
logZ (float)
logZErr (float)
nestSamples (ndarray)
postSamples (ndarray)
- class RATapi.outputs.PredictionIntervals(reflectivity: list, sld: list, sampleChi: numpy.ndarray)#
- Parameters:
reflectivity (list)
sld (list)
sampleChi (ndarray)
- class RATapi.outputs.Results(reflectivity: list, simulation: list, shiftedData: list, backgrounds: list, resolutions: list, layerSlds: list, sldProfiles: list, resampledLayers: list, calculationResults: RATapi.outputs.CalculationResults, contrastParams: RATapi.outputs.ContrastParams, fitParams: numpy.ndarray, fitNames: list[str])#
- Parameters:
reflectivity (list)
simulation (list)
shiftedData (list)
backgrounds (list)
resolutions (list)
layerSlds (list)
sldProfiles (list)
resampledLayers (list)
calculationResults (CalculationResults)
contrastParams (ContrastParams)
fitParams (ndarray)
fitNames (list[str])
- RATapi.outputs.get_field_string(field, value, array_limit)#
Returns a string representation of class fields where large and multidimensional arrays are represented by their shape.
- Parameters:
field (str) – The name of the field in the RAT output class.
value (Any) – The value of the given field in the RAT output class.
array_limit (int) – The maximum length of 1D arrays which will be fully displayed.
- Returns:
field_string – The string representation of the field in the RAT output class.
- Return type:
str
- RATapi.outputs.make_results(procedure, output_results, bayes_results=None)#
Initialise a python Results or BayesResults object using the outputs from a RAT calculation.
- Parameters:
procedure (Procedures)
output_results (OutputResult)
bayes_results (BayesResults | None)
- Return type: