The plasticc
module provides data access for PLAsTICC cadence
simulations stored on the local machine. Data is accessible by specifying
the cadence name and model number used in a given simulation.
The PLAsTICC
class is responsible for handling data access:
>>> from snat_sim.plasticc import PLAsTICC
>>> # Get a list of cadences available in the directory printed above
>>> print(PLAsTICC.get_available_cadences())
>>> [ 'alt_sched' ]
>>> # Count the number of light-curves for a given cadence and SN model
>>> lc_data = PLAsTICC('alt_sched', model=11)
>>> num_lc = lc_data.count_light_curves()
The class provides basic data access via the construction of an iterator over the observed cadence for each simulated light-curve. The iterator returns the unique Id, parameters, and cadecne used in each simulation.
Note
You should expect the first evaluation of the iterator to be slow since it has to load data into memory as chunks.
>>> lc_iterator = lc_data.iter_cadence(iter_lim=10, verbose=False)
>>> snid, sim_params, cadence = next(lc_iterator)
The light-curve simulated by PLAsTICC for each cadence can optionally be included with the iterator:
>>> lc_iterator = lc_data.iter_cadence(iter_lim=10, include_lc=True, verbose=False)
>>> snid, sim_params, cadence, lc = next(lc_iterator)
Data access object for PLAsTICC simulation data
Data access object for PLAsTICC simulations performed using a given cadence and SN model
cadence (str
) – The cadence to load data for
model (int
) – The numerical identifier of the PLAsTICC SN model used in the simulation
Return a list of all cadences available in the working environment
List
[str
]
Return a list of file paths for all simulation header files
List
[Path
]
Return the number of available light-curve simulations for the current cadence and model
int
Iterate over available cadence data for each supernova
iter_lim – Limit the number of iterated light-curves
include_lc – Include the PLAsTICC simulated light-curve with iterator outputs
verbose – Display a progress bar
The supernova identifier (SNID)
The parameters used in the simulation
The cadence of the simulation