redback.simulate_transients.SimulateFullOpticalSurvey
- class redback.simulate_transients.SimulateFullOpticalSurvey(model, prior, rate, survey_start_date, survey_duration, 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]
Bases:
SimulateOpticalTransient
- __init__(model, prior, rate, survey_start_date, survey_duration, 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]
Simulate a full optical survey. This requires a rate and a prior for the population. The rate is used to draw events in a period of time, placing them isotropically on the sky and uniform in comoving volume. The prior is used to draw the parameters of the individual events. We can then simulate observations of all these events and understand the rate of detections etc.
- Parameters:
model – String corresponding to redback model or a python function that can evaluate an SED.
prior – A redback prior corresponding to the model. The prior on the redshift is forced to be uniform in comoving volume. With maximum what the user sets in their prior.
rate – Rate of the population in Gpc^-3 yr^-1
survey_start_date – Start date of the survey in MJD.
survey_duration – Duration of the survey in years. This can be set arbitrarily high if one wants to look at detection efficiencies. Or to a real number if wanting to look at a volume/flux limited survey.
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
cosmology – Cosmology to use. Default is Planck18. Users can pass their own cosmology class here as long as it works like astropy.cosmology. Users should ensure they use the same cosmology in the model. Or deliberately choose not to.
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, prior, rate, ...[, ...])Simulate a full optical survey.
get_event_times
()save_survey
([survey])Save the transient population to a csv file.
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.
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
The DEC of the transient in radians.
The RA of the transient in radians.
End of the survey in MJD
Maximum dec of the survey in radians
Minimum dec of the survey in radians
rate_per_sec
Start of the survey in MJD
survey_duration_seconds
Convert the circular field of view to a radius in radians.
The start time of the transient in MJD
time_window
- 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_survey(survey=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
- save_transient(name)
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)
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)
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)
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)
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)
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)
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)
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