analyzeSpectrum

fiducia.main.analyzeSpectrum(channels, knots, detArr, detArrBoundaryCol, detArrVarianceBoundaryCol, detArrInv, stdDetArrInv, measurementFrame, time, signalsUncertainty=None, yGuess=0, boundary='y0', nPtsIntegral=100, nPtsSpectrum=100, plotSignal=False, plotKnots=False, plotSpectrum=True)[source]

Given the response function file and the DANTE measurement data file, run cubic spline analysis to reconstruct spectrum for a given time.

Parameters
  • channels (list, numpy.ndarray) – List or array of relevant DANTE channel numbers.

  • responseFrame (pandas.core.frame.DataFrame) – Pandas dataFrame containing response functions for each DANTE channel. See loadResponses().

  • knots (list, numpy.ndarray) – List or array of knot point photon energy value. See knotFind().

  • 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.

  • measurementFrame (pandas.core.frame.DataFrame) – Pandas dataframe containing DANTE measurement data. See readDanteData() and readDanProcessed().

  • time (float) – Time for which we want DANTE signals (in ns).

  • signalsUncertainty (numpy.ndarray, optional) – One dimensional array with each element corresponding to the uncertainty each signal. The default is None.

  • yGuess (float, optional) – Guess for position of boundary knot point. Default 0.

  • 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’.

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

  • nPtsSpectrum (int, optional) – Number of points to use in reconstructing the spectrum. Default is 100.

  • plotKnots (Bool, optional) – Flag for plotting the Dante signal at the given time across all channels. Default is False.

  • plotKnots – Flag for plotting just the solved knot points. Default is False.

  • plotSpectrum (Bool, optional) – Flag for plotting the unfolded spectrum. Default is True.

Returns

  • knotsYAll (numpy.ndarray) – Array of knot point intensity values with yGuess appended. See knotSolve() and analyzeSpectrum().

  • knotsYVariance (numpy.ndarray) – Array of knot point intensity uncertainty values with yGuess appended. See knotSolve() and analyzeSpectrum().

  • photonEnergies (numpy.ndarray) – Photon energy axis of unfolded spectrum.

  • intensities (numpy.ndarray) – Spectral intensity axis of unfolded spectrum.

  • intensitiesVariance (numpy.ndarray) – Uncertaitny (1 \(\sigma\)) on spectral intensity values.

Notes

Examples