tools
Added in version 1.2.0.
Module for tools.
- nexus.tools.AreaSites(spectrum, sample, norm=False)
Returns the area of the single Hyperfine sites of a sample in units of linewidth (Gamma).
Added in version 1.2.0.
- Parameters:
spectrum (
EnergySpectrum
orEmissionSpectrum
) – The EnergySpectrum, EmissionSpectrum or MoessbauerSpectrum of the calculation.sample (
Sample
) – The sample for which the hyperfine site spectra should be calculated.norm (bool) – Normalize to relative contribution per site area. Default is False.
- Returns:
Returns a 2D list of relative areas, where the first index represents the layer and the second index the site in this layer.
- Return type:
array
- nexus.tools.CountRateEstimator(photon_flux, time, intensity, isotope, time_start=0, time_end=inf, detector_efficiency=1, attenuation=1)
Estimate the photon count rate of a time spectrum.
Added in version 1.2.0.
- Parameters:
photon_flux (float) – Number of photons per energy bandwidth and time. In photons/meV/s.
time (array) – Array of time from a
TimeSpectrum
. In ns.intensity (array) – Array of intensities from a
TimeSpectrum
. In \(\Gamma\)/ns.isotope (
MoessbauerIsotope
) – Moessbauer isotope for the calculation.time_start (float) – Time where the integration over the radiant flux starts in the time spectrum. In ns. Default is
0
. Should be set to the veto time of a time spectrum.time_stop (float) – Time where the integration over the radiant flux stops in the time spectrum. In ns. Default in
inf
meaning that time spectrum up to the last time provided. Should be set to the end of the measurement time of a histogram.detector_efficiency (float) – Efficiency of the detector. Default is
1
.attenuation (float) – Attenuation of the beam. Default is
1
. This includes attenuator, air, etc. Can also be applied in the TimeSpectrum calculation otherwise.
- Returns:
Estimated photon count rate (in photons per second).
- Return type:
float
- nexus.tools.GetSiteSpectra(spectrum, sample)
Returns the spectra of single Hyperfine sites of a sample.
Added in version 1.2.0.
- Parameters:
spectrum (
EnergySpectrum
orEmissionSpectrum
) – The EnergySpectrum, EmissionSpectrum or MoessbauerSpectrum of the calculation.sample (
Sample
) – The sample for which the hyperfine site spectra should be calculated.
- Returns:
Returns a 2D list of intensity values, where the first index represents the layer and the second index the site in this layer.
- Return type:
array
- nexus.tools.Mask(x, y, start, end)
Mask two arrays to a certain range. Both arrays are reduced to the start/end range, which is in units of the x array.
Added in version 1.2.0.
- Parameters:
x (array) – x array to be masked.
y (array) – y array to be masked.
start (float) – Start of the mask in units of x.
end (float) – End of the mask in units of x.
- Returns:
Masked x array, masked y array.
- Return type:
array, array