snat_sim.pipeline.nodes

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

Note

Nodes are built on the egon framework. For more information see the official Egon Documentation.

Module Docs

class snat_sim.pipeline.nodes.LoadPlasticcCadence(plasticc_dao, iter_lim=inf, override_zp=30, verbose=True, num_processes=1)[source]

Pipeline node for loading PLAsTICC cadence data from disk

Connectors:

output: Emits a pipeline packet decorated with the snid, simulation parameters, and cadence

__init__(plasticc_dao, iter_lim=inf, override_zp=30, verbose=True, num_processes=1)[source]

Source node for loading PLAsTICC cadence data from disk

This node can only be run using a single process. This can be the main process (num_processes=0) or a single forked process (num_processes=1.)

Parameters:
  • plasticc_dao (PLAsTICC) – A PLAsTICC data access object

  • iter_lim (int) – Exit after loading the given number of light-curves

  • override_zp (float) – Overwrite the zero-point used by plasticc with this number

  • verbose (bool) – Display a progress bar

  • num_processes (int) – Number of processes to allocate to the node (must be 0 or 1 for this node)

action()[source]

Load PLAsTICC cadence data from disk

Return type:

None

class snat_sim.pipeline.nodes.SimulateLightCurves(sn_model, catalog=None, num_processes=1, add_scatter=True, fixed_snr=None, abs_mb=-19.05, cosmo=FlatLambdaCDM(H0=70 km / (Mpc s), Om0=0.295, Tcmb0=0 K, Neff=3.04, m_nu=None, Ob0=None))[source]

Pipeline node for simulating light-curves based on PLAsTICC cadences

Connectors:

input: A Pipeline Packet success_output: Emits pipeline packets successfully decorated with a simulated light-curve failure_output: Emits pipeline packets for cases where the simulation procedure failed

__init__(sn_model, catalog=None, num_processes=1, add_scatter=True, fixed_snr=None, abs_mb=-19.05, cosmo=FlatLambdaCDM(H0=70 km / (Mpc s), Om0=0.295, Tcmb0=0 K, Neff=3.04, m_nu=None, Ob0=None))[source]

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

Parameters:
  • sn_model (SNModel) – Model to use when simulating light-curves

  • catalog (Optional[VariableCatalog]) – Optional reference start catalog to calibrate simulated flux values to

  • num_processes (int) – Number of processes to allocate to the node

  • abs_mb (float) – The absolute B-band magnitude of the simulated SNe

  • cosmo (Cosmology) – Cosmology to assume in the simulation

simulate_lc(params, cadence)[source]

Duplicate a plastic light-curve using the simulation model

Parameters:
  • params (Dict[str, float]) – The simulation parameters to use with self.model

  • cadence (ObservedCadence) – The observed cadence of the returned light-curve

Return type:

Tuple[LightCurve, SNModel]

action()[source]

Simulate light-curves with atmospheric effects

Return type:

None

class snat_sim.pipeline.nodes.FitLightCurves(sn_model, vparams, bounds=None, num_processes=1)[source]

Pipeline node for fitting simulated light-curves

Connectors:

input: A Pipeline Packet success_output: Emits pipeline packets with successful fit results failure_output: Emits pipeline packets for cases where the fitting procedure failed

__init__(sn_model, vparams, bounds=None, num_processes=1)[source]

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

Parameters:
  • sn_model (SNModel) – Model to use when fitting light-curves

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

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

  • num_processes (int) – Number of processes to allocate to the node

fit_lc(light_curve, initial_guess)[source]

Fit the given light-curve

Parameters:
  • light_curve (LightCurve) – The light-curve to fit

  • initial_guess (Dict[str, float]) – Parameters to use as the initial guess in the chi-squared minimization

Return type:

SNFitResult

Returns:

  • The optimization result

  • A copy of the model with parameter values set to minimize the chi-square

action()[source]

Fit light-curves

Return type:

None

class snat_sim.pipeline.nodes.WritePipelinePacket(out_path, write_lc_sims=False, num_processes=1)[source]

Pipeline node for writing pipeline packets to disk

Connectors:

input: A pipeline packet

__init__(out_path, write_lc_sims=False, num_processes=1)[source]

Output node for writing HDF5 data to disk

This node can only be run using a single process.

Parameters:
  • out_path (Union[str, Path]) – Path to write data to in HDF5 format

  • write_lc_sims (bool) – Whether to include simulated light-curves in the data written to disk

setup()[source]

Open a file accessor object

Return type:

None

teardown()[source]

Close any open file accessors

Return type:

None

action()[source]

Write data from the input connector to disk

Return type:

None