Defines a standardized data model for communication between pipeline nodes.
Data models are defined as Python data classes. All fields in the data model
are onptional except for the supernova identifier (snid
). Other fields
include the supernova model parameters used in a light-curve simulation / fit
and the cadence used in the simulation.
>>> import sncosmo
>>> from snat_sim.models import SNModel, LightCurve
>>> from snat_sim.pipeline.data_model import PipelinePacket
>>> # Load example data and an example supernova model
>>> example_data = sncosmo.load_example_data()
>>> light_curve = LightCurve.from_sncosmo(example_data)
>>> model_parameters = example_data.meta
>>> sn_model = SNModel('Salt2')
>>> # Set an initial guess for fitting the model parameters
>>> sn_model.update(model_parameters)
>>> fit_result = sn_model.fit_lc(light_curve, vparam_names=['x0', 'x1', 'c'])
>>> packet = PipelinePacket(
... snid=1234, # Unique SN identifier
... sim_params=model_parameters, # Parameters used to simulate the light-curve
... light_curve=light_curve, # The simulated light-curve
... fit_result=fit_result, # ``SNFitResult`` object
... message='This fit was a success!'
... )
Class representation of internal pipeline data products
snid: Unique identifier for the data packet sim_params: Parameters used to simulate the light-curve cadence: The observational cadence used to simulate the light-curve light_curve: The simulated light-curve fit_result: Fit result from fitting the light-curve fitted_model: Model used to fit the light-curve message: Status message
Return simulated parameters as a pandas Dataframe
DataFrame
Parameters used in the simulation of light-curves
Return fitted parameters as a pandas Dataframe
DataFrame
Parameters recovered from fitting a light-curve
Return the packet status message as a pandas DataFrame
DataFrame
Dataframe with the snid, fit success status, and result message