redback.simulate_transients.SimulateOpticalTransient

class redback.simulate_transients.SimulateOpticalTransient(model, parameters, pointings_database=None, survey='Rubin_10yr_baseline', sncosmo_kwargs=None, obs_buffer=5.0, survey_fov_sqdeg=9.6, snr_threshold=5, end_transient_time=1000, add_source_noise=False, population=False, model_kwargs=None, **kwargs)[source]

Bases: object

__init__(model, parameters, pointings_database=None, survey='Rubin_10yr_baseline', sncosmo_kwargs=None, obs_buffer=5.0, survey_fov_sqdeg=9.6, snr_threshold=5, end_transient_time=1000, add_source_noise=False, population=False, model_kwargs=None, **kwargs)[source]

Simulate an optical transient or transient population for an optical Survey like Rubin, ZTF, Roman etc

Parameters:
  • model – String corresponding to redback model or a python function that can evaluate an SED.

  • parameters – Dictionary of parameters describing a single transient or a transient population. This can either include RA and DEC or it is randomly drawn from the pointing database. Must include t0_mjd_transient or t0.

  • pointings_database – A pandas DataFrame containing the pointings of the survey.

  • survey – String corresponding to the survey name. This is used to look up the pointings database. Set to LSST 10 year baseline 3.0 by default. If None, the user must supply a pointings_database. Implemented surveys currently include a Rubin 10 year baseline 3.0 as ‘Rubin_10yr_baseline, and ZTF as ‘ztf’.

  • sncosmo_kwargs – Any kwargs to be passed to SNcosmo. SNcosmo is used to evaluate the bandpass magnitudes in different bands.

  • obs_buffer – A observation buffer in days to add to the start of the transient to allow for non-detections. Default is 5 days

  • survey_fov_sqdeg – Survey field of view. Default is 9.6 sqdeg for Rubin. 36” for ZTF as a circular approximation to the square FOV of ZTF.

  • snr_threshold – SNR threshold for detection. Default is 5.

  • end_transient_time – End time of the transient in days. Default is 1000 days. Note that SNCosmo will extrapolate past when the transient model evaluates the SED so these should really be the same.

  • add_source_noise – Boolean. If True, add an extra noise in quadrature to the limiting mag noise. The factor is a multiple of the model flux i.e. noise = (skynoise**2 + (model_flux*source_noise)**2)**0.5

  • population – Boolean. If True, the parameters are assumed to be for a population of transients.

  • model_kwargs – Dictionary of kwargs to be passed to the model.

  • kwargs – Dictionary of additional kwargs

  • source_noise – Float. Factor to multiply the model flux by to add an extra noise in quadrature to the limiting mag noise. Default value is 0.02, disabled by default.

__call__(**kwargs)

Call self as a function.

Methods

__init__(model, parameters[, ...])

Simulate an optical transient or transient population for an optical Survey like Rubin, ZTF, Roman etc

save_transient(name)

Save the transient observations to a csv file.

save_transient_population([transient_names])

Save the transient population to a csv file.

simulate_transient(model, parameters[, ...])

Constructor method to build simulated transient object for a single transient.

simulate_transient_in_rubin(model, parameters)

Constructor method to build simulated transient object for a single transient with Rubin.

simulate_transient_in_ztf(model, parameters)

Constructor method to build simulated transient object for a single transient with ZTF.

simulate_transient_population(model, parameters)

Constructor method to build simulated transient object for a single transient.

simulate_transient_population_in_rubin(...)

Constructor method to build simulated transient object for a single transient.

simulate_transient_population_in_ztf(model, ...)

Constructor method to build simulated transient object for a single transient.

Attributes

DEC

The DEC of the transient in radians.

RA

The RA of the transient in radians.

end_mjd

End of the survey in MJD

max_dec

Maximum dec of the survey in radians

min_dec

Minimum dec of the survey in radians

start_mjd

Start of the survey in MJD

survey_radius

Convert the circular field of view to a radius in radians.

t0_transient

The start time of the transient in MJD

property DEC

The DEC of the transient in radians. Draw randomly from the pointings database if not supplied.

Type:

return

property RA

The RA of the transient in radians. Draw randomly from the pointings database if not supplied.

Type:

return

property end_mjd

End of the survey in MJD

Type:

return

property max_dec

Maximum dec of the survey in radians

Type:

return

property min_dec

Minimum dec of the survey in radians

Type:

return

save_transient(name)[source]

Save the transient observations to a csv file. This will save the full observational dataframe including non-detections etc. This will save the data to a folder called ‘simulated’ with the name of the transient and a csv file of the injection parameters

Parameters:

name – name to save transient.

save_transient_population(transient_names=None, **kwargs)[source]

Save the transient population to a csv file. This will save the full observational dataframe including non-detections etc. This will save the data to a folder called ‘simulated’ with the name of the transient and a csv file of the injection parameters

Parameters:
  • transient_names – list of transient names. Default is None which will label transients as event_0, etc

  • kwargs – kwargs for the save_transient function

  • injection_file_path – path to save the injection file

Returns:

None

classmethod simulate_transient(model, parameters, pointings_database=None, survey='Rubin_10yr_baseline', sncosmo_kwargs=None, obs_buffer=5.0, survey_fov_sqdeg=9.6, snr_threshold=5, end_transient_time=1000, add_source_noise=False, model_kwargs=None, **kwargs)[source]

Constructor method to build simulated transient object for a single transient.

Parameters:
  • model – String corresponding to redback model or a python function that can evaluate an SED.

  • parameters – Dictionary of parameters describing a single transient or a transient population. This can either include RA and DEC or it is randomly drawn from the pointing database. Must include t0_mjd_transient or t0.

  • pointings_database – A pandas DataFrame containing the pointings of the survey.

  • survey – String corresponding to the survey name. This is used to look up the pointings database. Set to LSST 10 year baseline 3.0 by default.

  • sncosmo_kwargs – Any kwargs to be passed to SNcosmo. SNcosmo is used to evaluate the bandpass magnitudes in different bands.

  • obs_buffer – A observation buffer in days to add to the start of the transient to allow for non-detections. Default is 5 days

  • survey_fov_sqdeg – Survey field of view. Default is 9.6 sqdeg for Rubin.

  • snr_threshold – SNR threshold for detection. Default is 5.

  • end_transient_time – End time of the transient in days. Default is 1000 days. Note that SNCosmo will extrapolate past when the transient model evaluates the SED so these should really be the same.

  • add_source_noise – Boolean. If True, add an extra noise in quadrature to the limiting mag noise. The factor is a multiple of the model flux i.e. noise = (skynoise**2 + (model_flux*source_noise)**2)**0.5

  • population – Boolean. If True, the parameters are assumed to be for a population of transients.

  • model_kwargs – Dictionary of kwargs to be passed to the model.

  • kwargs – Dictionary of additional kwargs

  • source_noise – Float. Factor to multiply the model flux by to add an extra noise in quadrature to the limiting mag noise. Default value is 0.02, disabled by default.

classmethod simulate_transient_in_rubin(model, parameters, pointings_database=None, survey='Rubin_10yr_baseline', sncosmo_kwargs=None, obs_buffer=5.0, snr_threshold=5, end_transient_time=1000, add_source_noise=False, model_kwargs=None, **kwargs)[source]

Constructor method to build simulated transient object for a single transient with Rubin.

Parameters:
  • model – String corresponding to redback model or a python function that can evaluate an SED.

  • parameters – Dictionary of parameters describing a single transient or a transient population. This can either include RA and DEC or it is randomly drawn from the pointing database. Must include t0_mjd_transient or t0.

  • pointings_database – A pandas DataFrame containing the pointings of the survey.

  • survey – String corresponding to the survey name. This is used to look up the pointings database. Set to LSST 10 year baseline 3.0 by default.

  • sncosmo_kwargs – Any kwargs to be passed to SNcosmo. SNcosmo is used to evaluate the bandpass magnitudes in different bands.

  • obs_buffer – A observation buffer in days to add to the start of the transient to allow for non-detections. Default is 5 days

  • snr_threshold – SNR threshold for detection. Default is 5.

  • end_transient_time – End time of the transient in days. Default is 1000 days. Note that SNCosmo will extrapolate past when the transient model evaluates the SED so these should really be the same.

  • add_source_noise – Boolean. If True, add an extra noise in quadrature to the limiting mag noise. The factor is a multiple of the model flux i.e. noise = (skynoise**2 + (model_flux*source_noise)**2)**0.5

  • model_kwargs – Dictionary of kwargs to be passed to the model.

  • kwargs – Dictionary of additional kwargs

  • source_noise – Float. Factor to multiply the model flux by to add an extra noise in quadrature to the limiting mag noise. Default value is 0.02, disabled by default.

classmethod simulate_transient_in_ztf(model, parameters, pointings_database=None, survey='ztf', sncosmo_kwargs=None, obs_buffer=5.0, snr_threshold=5, end_transient_time=1000, add_source_noise=False, model_kwargs=None, **kwargs)[source]

Constructor method to build simulated transient object for a single transient with ZTF.

Parameters:
  • model – String corresponding to redback model or a python function that can evaluate an SED.

  • parameters – Dictionary of parameters describing a single transient or a transient population. This can either include RA and DEC or it is randomly drawn from the pointing database. Must include t0_mjd_transient or t0.

  • pointings_database – A pandas DataFrame containing the pointings of the survey.

  • survey – String corresponding to the survey name. This is used to look up the pointings database.

  • sncosmo_kwargs – Any kwargs to be passed to SNcosmo. SNcosmo is used to evaluate the bandpass magnitudes in different bands.

  • obs_buffer – A observation buffer in days to add to the start of the transient to allow for non-detections. Default is 5 days

  • snr_threshold – SNR threshold for detection. Default is 5.

  • end_transient_time – End time of the transient in days. Default is 1000 days. Note that SNCosmo will extrapolate past when the transient model evaluates the SED so these should really be the same.

  • add_source_noise – Boolean. If True, add an extra noise in quadrature to the limiting mag noise. The factor is a multiple of the model flux i.e. noise = (skynoise**2 + (model_flux*source_noise)**2)**0.5

  • model_kwargs – Dictionary of kwargs to be passed to the model.

  • kwargs – Dictionary of additional kwargs

  • source_noise – Float. Factor to multiply the model flux by to add an extra noise in quadrature to the limiting mag noise. Default value is 0.02, disabled by default.

classmethod simulate_transient_population(model, parameters, pointings_database=None, survey='Rubin_10yr_baseline', sncosmo_kwargs=None, obs_buffer=5.0, survey_fov_sqdeg=9.6, snr_threshold=5, end_transient_time=1000, add_source_noise=False, model_kwargs=None, **kwargs)[source]

Constructor method to build simulated transient object for a single transient.

Parameters:
  • model – String corresponding to redback model or a python function that can evaluate an SED.

  • parameters – Dictionary of parameters describing a single transient or a transient population. This can either include RA and DEC or it is randomly drawn from the pointing database. Must include t0_mjd_transient or t0.

  • pointings_database – A pandas DataFrame containing the pointings of the survey.

  • survey – String corresponding to the survey name. This is used to look up the pointings database. Set to LSST 10 year baseline 3.0 by default.

  • sncosmo_kwargs – Any kwargs to be passed to SNcosmo. SNcosmo is used to evaluate the bandpass magnitudes in different bands.

  • obs_buffer – A observation buffer in days to add to the start of the transient to allow for non-detections. Default is 5 days

  • survey_fov_sqdeg – Survey field of view. Default is 9.6 sqdeg for Rubin.

  • snr_threshold – SNR threshold for detection. Default is 5.

  • end_transient_time – End time of the transient in days. Default is 1000 days. Note that SNCosmo will extrapolate past when the transient model evaluates the SED so these should really be the same.

  • add_source_noise – Boolean. If True, add an extra noise in quadrature to the limiting mag noise. The factor is a multiple of the model flux i.e. noise = (skynoise**2 + (model_flux*source_noise)**2)**0.5

  • model_kwargs – Dictionary of kwargs to be passed to the model.

  • kwargs – Dictionary of additional kwargs

  • source_noise – Float. Factor to multiply the model flux by to add an extra noise in quadrature to the limiting mag noise. Default value is 0.02, disabled by default.

classmethod simulate_transient_population_in_rubin(model, parameters, pointings_database=None, survey='Rubin_10yr_baseline', sncosmo_kwargs=None, obs_buffer=5.0, snr_threshold=5, end_transient_time=1000, add_source_noise=False, model_kwargs=None, **kwargs)[source]

Constructor method to build simulated transient object for a single transient.

Parameters:
  • model – String corresponding to redback model or a python function that can evaluate an SED.

  • parameters – Dictionary of parameters describing a single transient or a transient population. This can either include RA and DEC or it is randomly drawn from the pointing database. Must include t0_mjd_transient or t0.

  • pointings_database – A pandas DataFrame containing the pointings of the survey.

  • survey – String corresponding to the survey name. This is used to look up the pointings database. Set to LSST 10 year baseline 3.0 by default.

  • sncosmo_kwargs – Any kwargs to be passed to SNcosmo. SNcosmo is used to evaluate the bandpass magnitudes in different bands.

  • obs_buffer – A observation buffer in days to add to the start of the transient to allow for non-detections. Default is 5 days

  • snr_threshold – SNR threshold for detection. Default is 5.

  • end_transient_time – End time of the transient in days. Default is 1000 days.

  • add_source_noise – Boolean. If True, add an extra noise in quadrature to the limiting mag noise. The factor is a multiple of the model flux i.e. noise = (skynoise**2 + (model_flux*source_noise)**2)**0.5

  • model_kwargs – Dictionary of kwargs to be passed to the model.

  • kwargs – Dictionary of additional kwargs

  • source_noise – Float. Factor to multiply the model flux by to add an extra noise in quadrature to the limiting mag noise. Default value is 0.02, disabled by default.

classmethod simulate_transient_population_in_ztf(model, parameters, pointings_database=None, survey='ztf', sncosmo_kwargs=None, obs_buffer=5.0, snr_threshold=5, end_transient_time=1000, add_source_noise=False, model_kwargs=None, **kwargs)[source]

Constructor method to build simulated transient object for a single transient.

Parameters:
  • model – String corresponding to redback model or a python function that can evaluate an SED.

  • parameters – Dictionary of parameters describing a single transient or a transient population. This can either include RA and DEC or it is randomly drawn from the pointing database. Must include t0_mjd_transient or t0.

  • pointings_database – A pandas DataFrame containing the pointings of the survey.

  • survey – String corresponding to the survey name. This is used to look up the pointings database.

  • sncosmo_kwargs – Any kwargs to be passed to SNcosmo. SNcosmo is used to evaluate the bandpass magnitudes in different bands.

  • obs_buffer – A observation buffer in days to add to the start of the transient to allow for non-detections. Default is 5 days

  • snr_threshold – SNR threshold for detection. Default is 5.

  • end_transient_time – End time of the transient in days. Default is 1000 days. Note that SNCosmo will extrapolate past when the transient model evaluates the SED so these should really be the same.

  • add_source_noise – Boolean. If True, add an extra noise in quadrature to the limiting mag noise. The factor is a multiple of the model flux i.e. noise = (skynoise**2 + (model_flux*source_noise)**2)**0.5

  • model_kwargs – Dictionary of kwargs to be passed to the model.

  • kwargs – Dictionary of additional kwargs

  • source_noise – Float. Factor to multiply the model flux by to add an extra noise in quadrature to the limiting mag noise. Default value is 0.02, disabled by default.

property start_mjd

Start of the survey in MJD

Type:

return

property survey_radius

Convert the circular field of view to a radius in radians. :return: survey_radius in radians

property t0_transient

The start time of the transient in MJD

Type:

return