LUTScatteredSolver

class nsb2.core.solver.LUTScatteredSolver[source]

Bases: ScatteredSolver

Scattered light interpolated from a pre-compiled lookup table.

The table is tabulated over the zenith angles of the evaluation point and of the source, their relative azimuth, and the parameter axes of the source’s spectral grid. compile() must be called before compute_rates().

Methods Summary

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

Tabulate band-integrated, in-scattered rates over the sky geometry.

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

Interpolate in-scattered rates from the compiled table.

Methods Documentation

compile(source, instrument, atmosphere, *, scattering_z_bins=10, scattering_theta_bins=10, **kwargs)[source]

Tabulate band-integrated, in-scattered rates over the sky geometry.

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 scattering kernel.

  • scattering_z_bins (int, optional) – Number of zenith angle samples, used for both the evaluation point and the source. Default is 10.

  • scattering_theta_bins (int, optional) – Number of relative azimuth samples. Default is 10. The samples are spaced quadratically, which concentrates them at small separations where the scattering kernel varies fastest.

  • **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, eval_coords)[source]

Interpolate in-scattered rates from the compiled table.

See ScatteredSolver.compute_rates() for the parameters.

Raises:

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

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