LUTDirectSolver

class nsb2.core.solver.LUTDirectSolver[source]

Bases: DirectSolver

Direct extinction interpolated from a pre-compiled lookup table.

The table is tabulated over zenith angle and the parameter axes of the source’s spectral grid, which is exact for atmospheres without azimuthal structure. compile() must be called before compute_rates().

Methods Summary

compile(source, instrument, atmosphere, *[, ...])

Tabulate band-integrated, extinguished rates over zenith angle.

compute_rates(source, field, atmosphere, ...)

Interpolate per-source rates from the compiled table.

Methods Documentation

compile(source, instrument, atmosphere, *, extinction_z_bins=90, **kwargs)[source]

Tabulate band-integrated, extinguished rates over zenith angle.

Parameters:
  • source (nsb2.core.sources.Source) – Source whose spectral grid is tabulated.

  • instrument (nsb2.core.instrument.Instrument) – Instrument whose passband the spectra are restricted to.

  • atmosphere (nsb2.core.atmosphere.Atmosphere) – Atmosphere providing the extinction.

  • extinction_z_bins (int, optional) – Number of zenith angle samples between zenith and the horizon. Default is 90, i.e. one per degree.

  • **kwargs – Ignored; accepted so that a single compile call can carry the options of every solver in a pipeline.

Returns:

Always zero; the table is stored on the solver.

Return type:

float

compute_rates(source, field, atmosphere, bandpass)[source]

Interpolate per-source rates from the compiled table.

See DirectSolver.compute_rates() for the parameters.

Raises:

RuntimeError – If compile() has not been called for source.

__init__()[source]
classmethod __new__(*args, **kwargs)