snat_sim.pipeline

The pipeline module defines the FittingPipeline class, which is built to provide a parallelized approach to simulating and fitting light-curves with atmospheric effects.

SubModules

Although the pipeline module provides a prebuilt data analysis pipeline, you can also build customized pipelines using any of the included nodes. Relevant documentation can be found in the following pages:

data_model

Defines a standardized data model for communication between pipeline nodes.

nodes

Defines the individual data processing nodes used to construct complete data analysis pipelines.

Usage Example

Instances of the FittingPipeline class can be run synchronously (by calling FittingPipeline.run) or asynchronously (with FittingPipeline.run_async). A pipeline instance can be created as follows:

>>> from snat_sim.models import SNModel
>>> from snat_sim.pipeline import FittingPipeline

>>> pipeline = FittingPipeline(
...     cadence='alt_sched',
...     sim_model=SNModel('salt2'),
...     fit_model=SNModel('salt2'),
...     vparams=['x0', 'x1', 'c'],
...     out_path='./demo_out_path.h5',
...     fitting_pool=6,
...     simulation_pool=3
... )

Module Docs

class snat_sim.pipeline.FittingPipeline(cadence, sim_model, fit_model, vparams, out_path, fitting_pool=1, simulation_pool=1, writing_pool=1, bounds=None, max_queue=100, iter_lim=inf, catalog=None, add_scatter=True, fixed_snr=None, write_lc_sims=False)[source]

Pipeline of parallel processes for simulating and fitting light-curves

__init__(cadence, sim_model, fit_model, vparams, out_path, fitting_pool=1, simulation_pool=1, writing_pool=1, bounds=None, max_queue=100, iter_lim=inf, catalog=None, add_scatter=True, fixed_snr=None, write_lc_sims=False)[source]

Fit light-curves using multiple processes and combine results into an output file

Parameters:
  • cadence (str) – Cadence to use when simulating light-curves

  • sim_model (SNModel) – Model to use when simulating light-curves

  • fit_model (SNModel) – Model to use when fitting light-curves

  • vparams (List[str]) – List of parameter names to vary in the fit

  • out_path (Union[str, Path]) – Path to write results to

  • fitting_pool (int) – Number of child processes allocated to simulating light-curves

  • simulation_pool (int) – Number of child processes allocated to fitting light-curves

  • bounds (Optional[Dict[str, Tuple[Number, Number]]]) – Bounds to impose on fit_model parameters when fitting light-curves

  • max_queue (int) – Maximum number of light-curves to store in pipeline at once

  • iter_lim (int) – Limit number of processed light-curves (Useful for profiling)

  • catalog (Optional[VariableCatalog]) – Reference star catalog to calibrate simulated supernova with

  • add_scatter (bool) – Add randomly generated scatter to simulated light-curve points

  • fixed_snr (Optional[float]) – Simulate light-curves with a fixed signal to noise ratio

  • write_lc_sims (bool) – Include simulated light_curves in the