Solver¶
- class nsb2.core.solver.Solver[source]¶
Bases:
objectBase class for rate computation strategies.
Subclasses implement
compute_rates; seeDirectSolverandScatteredSolverfor the two signatures in use.Methods Summary
compile(source, instrument, atmosphere, **kwargs)Pre-compute whatever this solver needs before predicting.
Methods Documentation
- compile(source, instrument, atmosphere, **kwargs)[source]¶
Pre-compute whatever this solver needs before predicting.
The default implementation does nothing, which is correct for solvers that integrate explicitly at predict time.
- Parameters:
source (nsb2.core.sources.Source) – Source the pre-computation applies to.
instrument (nsb2.core.instrument.Instrument) – Instrument whose passband the spectra are restricted to.
atmosphere (nsb2.core.atmosphere.Atmosphere) – Atmosphere model to tabulate.
**kwargs – Solver-specific compilation options.
- Returns:
Compilation cost metric; zero when nothing was compiled.
- Return type:
- __init__()¶
- classmethod __new__(*args, **kwargs)¶