LUTDirectSolver¶
- class nsb2.core.solver.LUTDirectSolver[source]¶
Bases:
DirectSolverDirect 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 beforecompute_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
compilecall can carry the options of every solver in a pipeline.
- Returns:
Always zero; the table is stored on the solver.
- Return type:
- 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 forsource.
- classmethod __new__(*args, **kwargs)¶