API

Types

    Functions

    Documentation

    RadiationSpectra.calibrate_spectrumMethod
    calibrate_spectrum(h_uncal::Histogram, photon_lines::Array{Real, 1}; <keyword arguments>)

    Returns the calibrated histogram, the deconvoluted spectrum, the found (uncalibrated) peak positions and the final threshold value.

    Keywords

    • σ::Real = 2.0: The expected sigma of a peak in the spectrum. In units of bins.
    • threshold::Real = 10.0: Threshold for being identified as a peak in the deconvoluted spectrum. A single bin is identified as a peak when its weight exceeds the threshold and the previous bin was not identified as an peak.
    • min_n_peaks::Int = 0: If the number of found peaks is smaller than min_n_peaks the functions lowers the parameter threshold until enough peaks are found.
    • max_n_peaks::Int = 50: Use only the first (strongest) max_n_peaks peaks for peak identification.
    • α::Real = 0.005: = 0.5%. Acceptance level in the comparison of the peak position ratios in the peak indentification step. When the difference between the ratio of two found peak positions and the ratio of two photon lines (photon_lines) is smaller than α, the found peaks are identified as the two photon lines.
    • rtol::Real = 5e-3: = 5e-3. Acceptance level for tolerance of the absolute difference between true and found line position.

    Calibrate the spectrum h_uncal. This is done by:

    1. finding peaks through devoncolution
    2. identifying them through comparison of the ratios of their positions with the ratios of the known lines
    3. fitting all identified peaks (with a gaussian plus first order polynomial) to get their position more precisely
    4. performe a linear fit (offset forced to 0) of these positions vs the true positions (lines) to get the calibration constant
    source
    RadiationSpectra.opt_fitFunction
    # opt_fit(DT::Type{<:UvSpectrumDensity}, h::Histogram{<:Any, 1},
             p0::AbstractVector, lower_bounds::AbstractVector, upper_bounds::AbstractVector)

    Maximum Likelihood Estimation Fit of model density d on the histogram h.

    source
    RadiationSpectra.opt_fitFunction
    # opt_fit(DT::Type{<:UvSpectrumDensity}, h::Histogram{<:Any, 1},
             p0::NamedTuple, lower_bounds::NamedTuple, upper_bounds::NamedTuple)

    Maximum Likelihood Estimation Fit of model density d on the histogram h.

    source
    RadiationSpectra.peakfinderMethod
    peakfinder(h::Histogram; <keyword arguments>)::Tuple{Histogram, Array{Float64, 1}}

    Returns a deconvoluted spectrum and an array of peak positions.

    Keywords

    • σ::Real=2.0: The expected sigma of a peak in the spectrum. In units of bins.
    • threshold::Real=10.0: Threshold for being identified as a peak in the deconvoluted spectrum. A single bin is identified as a peak when its weight exceeds the threshold and the previous bin was not identified as an peak.
    • backgroundRemove::Bool=true
    • deconIterations::Int=3
    • markov::Bool=true
    • averWindow::Int=3

    Source

    This function is basically a copy of TSpectrum::SearchHighRes from ROOT.

    • M.A. Mariscotti: A method for identification of peaks in the presence of background and its application to spectrum analysis. NIM 50 (1967), 309-320.
    • M. Morhac;, J. Kliman, V. Matouoek, M. Veselsky, I. Turzo.:Identification of peaks in multidimensional coincidence gamma-ray spectra. NIM, A443 (2000) 108-125.
    • Z.K. Silagadze, A new algorithm for automatic photopeak searches. NIM A 376 (1996), 451.
    source