Configuration input yaml file¶
The input file is a .yml with the following structure:
data:
write_path: '/PATH/TO/OUTPUT'
sim_name: 'NAME OF SIMULATION'
write_format: 'format' or ['format1','format2'] # Opt, default pkl, parquet
survey_config:
survey_file: '/PATH/TO/FILE'
band_dic: {'r':'ztfr','g':'ztfg','i':'ztfi'} # Opt, use if bandname in the database doesn't correpond to those in sncosmo registery
add_data: ['keys1', 'keys2', ...] COLUMNS TO KEEP IN FINAL SIMUALTED DATA # Opt
survey_cut: {'key1': ["conditon1","conditon2",...], 'key2':["conditon1"],...} # Optional SQL conditions on key
key_dic: {'column_name': 'new_column_name', etc} # Opt, to change columns names
zp: INSTRUMENTAL ZEROPOINT # Opt, default given by survey file)
sig_zp: UNCERTAINTY ON ZEROPOINT # Opt, default given by survey file)
sig_psf: GAUSSIAN PSF SIGMA # Opt, default given by survey file as FWHMeff
noise_key: [key, type] type can be 'mlim5' or 'skysigADU'
ra_size: RA FIELD SIZE in DEG
dec_size: DEC FIELD SIZE in DEG
gain: CCD GAIN e-/ADU # Optional, default given by survey file
start_day: MJD NUMBER or 'YYYY-MM-DD' # Opt, default given by survey file
end_day: MJD NUMBER or 'YYYY-MM-DD' # Opt, default given by survey file
duration: SURVEY DURATION (DAYS) # Opt, default given by survey file
field_map: FIELD MAP FILE # Opt, default is rectangle field
sub_field: 'sub_field_key' # Used to divided observation in CCD quadrant for example
cdd_noise : sig_ccd_noise # Optional, default is 0 ADU
sim_par:
z_range: [ZMIN, ZMAX] REDSHIFT RANGE
randseed: RANDSEED TO REPRODUCE SIMULATION # Optional
nep_cut: [[nep_min1,Tmin,Tmax], [nep_min2,Tmin2,Tmax2,'filter1'], ...] EP CUTS # Opt
duration_for_rate: FAKE DURATION ONLY USE TO GENERATE N OBJ # Opt
snia_gen:
force_n: NUMBER OF OBJ TO GENERATE # Opt
sn_rate: SN RATE in SN/Mpc^3/year # Opt, default=3e-5
M0: SN ABSOLUT MAGNITUDE
mag_sct: SN INTRINSIC COHERENT SCATTERING
mass_step: ['threshold', 'value'] # Opt, default=[0, 0]
sct_model: 'SCATTERING_MODEL_NAME' USE WAVELENGHT DEP MODEL FOR SN INT SCATTERING
mod_fcov: True or False, Use the covariance of simulation model to scatter flux # Opt, default = False
model_name: MODEL NAME
model_version: VERSION OF THE SNCOSMO MODEL # Opt, default = None
model_dir: PATH TO THE MODEL # Opt, default = None
# Model parameters : here example for salt
alpha: STRETCH CORRECTION = alpha*x1
beta: COLOR CORRECTION = -beta*c
dist_x1: SALT Strectch parameter distribution
dist_c: SALT color parameter distribution
cosmology: # Follow astropy formalism
Om0: MATTER DENSITY
H0: HUBBLE CONSTANT
cmb:
v_cmb: OUR PECULIAR VELOCITY # Opt, default = 369.82 km/s
l_cmb: GAL L OF CMB DIPOLE # Opt, default = 264.021
b_cmb: GAL B OF CMB DIPOLE # Opt, default = 48.253
mw_dust: # Opt, default no mw dust
model: MOD_NAME
rv: RV Value # Optional, default = 3.1
vpec_dist: # Opt
mean_vpec: MEAN SN PECULIAR VEL
sig_vpec: SIGMA VPEC
host: # Opt
host_file: '/PATH/TO/HOSTFILE'
reweight_vol: True or False # To remove the volume dist of the host when draw
keep_cols: ['key1', 'key2', ...] # Opt, column keys to keep at the end
distrib: DISTRIBUTION TO USE TO DRAW HOST # Opt, default = 'rate'
key_dic: {'column_name': 'new_column_name', ...} # Opt, to change columns names
dask: # Opt, to use dask parallelization
use: True or False
nworkers: NUMBER OF WORKERS # used to adjust work distribution
data¶
This section of the yaml file only contains information about output files of the simulation :
write_path is the path to the output directory. type : str
sim_name is the simulation file name. type : str
write_format is the desired output format(s), only parquet or pkl are available. type : str or list(str). Optional : default is parquet and pkl. Note that parquet working only if you have pyarrow and json python modules installed.
survey_config¶
This section contains informations about the survey configuration :
survey_file is the path to the SQL database or the CSV file that describe observations.
ra_size is the Right Ascension size of the field in DEG.
dec_size is the Declinaison size of the field in DEG.
noise_key is a list that contains the key used in the SQL database for the noise, and the type of noise : skysigADU if it’s directly the sky noise in ADU units, mlim5 if it’s the limiting magnitude at 5 \(\sigma\). type : list(str).
key_dic is a dictionary to use if you use csv file in order to change columns names.
gain is the gain of the CCD in \(e^-\) / ADU. type : float. Optional : If not set, gain is taken in the SQL database.
zp is a constant zero point to use in simulation. type : float. Optional : If not set, zero point is taken in the SQL database.
sig_zp is the error on zero point. type : float. Optional : If not set, this parameter is taken in the SQL database.
sig_psf is the PSF scale. type : float. Optional : If not set, the PSF is taken in the SQL database, to following LSST OpSim structure the PSF in the database is take has the FWHM (\(FWHM = 2 \sqrt{2 \ln(2)} \sigma_{PSF}\)).
start_day is the starting day in MJD or in formated str ‘YYYY-MM-DD’. type : float or str. Optional : default is the first day of the SQL database.
end_day same as start_day but for the end of the survey. type : float or str. Optional : default is the last day of the observations.
duration : instead of setting an end_day you can specify a duration in days. type : float. Optional : the duration is ignored if an end_day is configured.
field_map is a file that describe the field geometry, more information here. type : str. Optional : default is a rectangle ra_size \(\times\) dec_size field.
sub_field correspond to the sub_field key of the database, it’s allow to have a database with observations indexed by subfield and not by field. type : str. Optional : If you don’t use a database with subfields, however the code will run but all subfields observations will be take into account.
band_dic is a dictionnary that map bands names in the database to bands names in sncosmo . type dic. Optional
survey_cut is used to put cuts on the SQL query of the observations, it’s a dictionary : {‘key1’: [“conditon1”,“conditon2”,…], ‘key2’:[“conditon1”],…} where keys are any database keys and condition are str SQL queries. type : dic. Optional
add_data is a list of database key that you want to retrieve in lightcurves tables. type : list(str). Optional
ccd_noise is the noise from instrument in ADU / pixels. Optional : default is 0
sim_par¶
z_range cosmological redshift range in which generate obj. type : list(float).
randseed the randseed used to produce the simulation. type : int. Optional : default is random.
duration_for_rate allow to use a different duration for the survey and the number of SN, it must be in days. type : float. Optional
nep_cut is a filter function to only generate SN with a minimum number of epochs. It can be just a number or you can specify different requirements for each band. type int or list. Optional
astrobj_gen¶
Here we present how to generate different astrobj : each astrobj configuration us represented by a yaml section named astrobj_gen.
Common properties¶
Common properties to all astro obj
force_n force the number of SN to generate. type int. Optional
rate is the rate of SN in units of SN/Mpc\(^3\)/year. type : float or str. Optional : default value is \(3 \times 10^{-5}\ SN.Mpc^{-3}.year^{-1}\) .
mod_fcov use or not the simulation model covariance to scatter flux. type : boolean. Optional : default is False.
Flux covariance come from sncosmo.Model.bandfluxcov() and is apply using :
flux += np.random.multivariate_normal(np.zeros(len(fluxcov)),
fluxcov,
check_valid='ignore',
method='eigh')
model_name give the name of your model.
- model_dir give the path to the model files. typestr.
Optional : if not given, use model_name as sncosmo built-in source.
snia_gen¶
This section concern the type Ia supernovae properties.
M0 is the absolute magnitude of Supernovae in rest-frame Bessell B band. type : float or str.
Possibilities are :
Directly give a float value
Give ‘jla’ : use the JLA best fit value \(M_0 = -19.05\) for \(H_0 = 70\) km/s/Mpc. \(M_0\) is rescale in function of the \(H_0\) set in cosmology.
mag_sct the SN Ia coherent intrinsic scattering. For each SN \(M_0 \rightarrow M_0 + \sigma_M\). type : float.
rate
Additional possibilities are:
Give ‘ptf19’ : use the PTF19 SN Ia rate \(r_v = 2.43 \times 10^{-5} \ SN.Mpc^{-3}.year^{-1}\) for \(H_0 = 70\) km/s/Mpc. \(r_v\) is rescale in function of the \(H_0\) set in cosmology.
Give ‘ztf20’ : use the PTF20 SN Ia rate \(r_v = 2.35 \times 10^{-5} \ SN.Mpc^{-3}.year^{-1}\) for \(H_0 = 70\) km/s/Mpc. \(r_v\) is rescale in function of the \(H_0\) set in cosmology.
Note that the rate is used to generate the redshift distribution.
sct_mod a model of wavelength dependant scattering. Follow nomanclature of Kessler et al. 2012. type : str. Optional
Possibilities are:
‘G10’ for Guy et al. 2010 model.
‘C11’ or ‘C11_0’ for Chotard et al. 2011 model with correlation between U’ and U = 0, ‘C11_1’ for Cor(U’,U) = 1 and ‘C11_2’ for Cor(U’,U) = -1.
Available model for model_config:
all sncosmo salt models.
Salt 2 / 3¶
alpha correspond to the stretch correction in Tripp relation : \(\alpha x_1\). type float.
beta correspond to the color correction in Tripp relation : \(\beta c\). type : float.
dist_x1 represents the parameters of the stretch’s distribution. type : list(float) or str.
Possibilities are:
[MEAN, SIGMA] for gaussian distribution.
[MEAN, SIGMA-, SIGMA+] for asymmetric gaussian distribution.
‘N21’ to use the distribution of Nicolas et al. 2021
dist_c represents the parameters of the color’s distribution. type : list(float) .
Possibilities are:
[MEAN, SIGMA] for gaussian distribution.
[MEAN, SIGMA-, SIGMA+] for asymmetric gaussian distribution.
mw_dust¶
The model of Milky Way dust to apply. Optional : not set, no dust.
model the name of the MW dust to use. type : str. Possibilities are :
CCM89
OD94
F99
rv MW \(R_V\) value. type : float. Optional : default \(R_v=3.1\).
For more information go to the sncosmo documentation.
cosmology¶
This section is about the cosmological model used in the simulation.
The first way of use is to just write the parameters following the astropy.cosmology.w0waCDM parameters names. At least you need to give the Hubble constant : H0 and the matter density at z=0 : Om0. If you don’t give any other parameters the Universe is assumed flat with a cosmological constant.
The second way is to use the key name and load one of built-in astropy cosmological model:
Possibilities are:
‘planck18’
‘planck15’
‘planck13’
‘wmap9’
‘wmap7’
‘wmap5’
cmb optional¶
This section set the CMB reference frame. Defaults values come from Planck18
v_cmb is our peculiar velocity in the CMB frame in km/s. type : float. Optional : default is 620 km/s
l_cmb is the galactic longitude of the CMB dipole. type : float. Optional : default is 264.021 deg
b_cmb is the galactic longitude of the CMB dipole. type : float. Optional : default is 48.253 deg
vpec_dist optional¶
This section describe the distribution of peculiar velocities. Peculiar velocities are taken from a gaussian distribution.
Default is all vpec = 0.
mean_vpec is the mean of the gaussian distribution. type float
sig_vpec is the scale of the gaussian distribution. type float
host optional¶
The host configuration to place SN in host, see here.
host_file is the path to the host_file, used to generate SN in hosts. type str
key_dic is a dictionary to change column name in order to correspond to what is needed (cf host file doc)
distrib is the distribution to use for redshift. type str.
The possibilities are:
‘rate’ : the simulation use the host distribution to generate redshifts