detectorUncertainty

fiducia.error.detectorUncertainty(channels, responseFile, responseUncertaintyFile=None, boundary='y0', npts=1000, samples=1000, MChistogram=False, saveDataset=True, csplineDatasetFile='')[source]

Finds the cspline detector matrix, it`s inverse matrix and std matrix using Monte Carlo uncertainty propagation.

Propagates response uncertainties through

Parameters
  • channels (numpy.ndarray) – Array of DANTE channel numbers.

  • responseFile (str) – Path to the .csv holding DANTE channel responses as a function of photon energy (not normalized).

  • responseUncertaintyFile (str, optional) – Path to the .csv holding DANTE channel response uncertainties as a function of photon energy. Uncertainty values provided as percentages.

  • boundary (str, optional) – Choose whether yGuess corresponds to \(y_0\) (lowest photon energy) or \(y_{n+1}\) (highest photon energy) boundary condition. This should correspond to the photon energy value given in knots. Options are y0 or yn+1. Default ‘y0’.

  • npts (int, optional) – Number of points used in computing the integral. Default is 1000.

  • samples (int, optional) – Number of samples to generate during Monte Carlo propagation. See error.detectorErrMC(). Default is 1000.

Returns

  • detArr (xarray.DataArray) – Matrix representing the spectrally integrated folding of the detector response with a cubic spline interpolation of the x-ray spectrum. 2D array of channels and knot points of shape (n, n).

  • detArrBoundaryCol (xarray.DataArray) – Column of cublic spline matrix corresponding to the knots at the boundary chosen with boundary.

  • detArrVarianceBoundaryCol (xarray.DataArray) – Column of variances in the cublic spline matrix corresponding to the knots at the boundary chosen with boundary.

  • detArrInv (xarray.DataArray) – Inversion of detArr, with the column corresponding to boundary removed so detArr is invertible.

  • stdDetArrInv (xarray.DataArray) – Array of the standard deviation of each element in detArrInv based on variance using the responseUncertaintyFrame propagated with Monte Carlo.

Notes

Examples