opsimsummaryv2.sim_io#
Class to write simulations input files.
Attributes#
Classes#
A class to write SNANA simulation output from OpSimSurvey object. |
|
Module Contents#
- class opsimsummaryv2.sim_io.SNANA_Simlib(OpSimSurvey, out_path=None, author_name=None, file_suffix='', ZPTNoise=0.005, CCDgain=1.0, CCDnoise=0.25, NOTES={})[source]#
Bases:
SimWriterA class to write SNANA simulation output from OpSimSurvey object.
- OpSimSurvey#
The OpSimSurvey object
- dataline#
A vectorized function to write SIMLIB dataline
- Type:
- LIBdata(opsimdf)[source]#
Give the string of a LIB entry.
- Parameters:
opsimdf (pandas.DataFrame) – LIB entry observations
- Returns:
The str of the LIB entry.
- Return type:
Give the string of a LIB entry footer.
- LIBheader(LIBID, ra, dec, opsimdf, mwebv=0.0, groupID=None, field_label=None)[source]#
Give the string of the header of a LIB entry.
- Parameters:
LIBID (int) – The LIBID of the entry.
ra (float) – RA [deg] coordinate of the entry
dec (float) – Dec [deg] coordinate of the entry
opsimdf (pandas.DataFrame) – LIB entry observations
mwebv (float, optional) – MWEBV of the entry, default = 0.0
groupID (int, optional) – GROUPID of the entry used to match with HOSTLIB hosts.
- Returns:
The LIB entry header string.
- Return type:
- get_HOSTLIB_doc()[source]#
Give docstring for HOSTLIB file.
- Returns:
Docstring of the HOSTLIB file
- Return type:
- get_HOSTLIB_header(hostdf)[source]#
Give HOSTLIB header.
- Parameters:
hostdf (pandas.DataFrame) – Hosts dataframe
- Returns:
Header of HSOTLIB file
- Return type:
- get_SIMLIB_doc()[source]#
Give the DOCUMENTATION string for SIMLIB.
- Returns:
DOCUMENTATION string
- Return type:
Give SIMLIB footer.
- write_HOSTLIB(hostdf, buffer_size=8192)[source]#
Write the HOSTLIB file. Called in write_SIMLIB.
- Parameters:
hostdf (pandas.DataFrame) – Hosts dataframe
buffer_size (int) – buffering option for open() function
- write_SIMLIB(write_batch_size=10, buffer_size=8192)[source]#
write the SIMLIB (and the HOSTLIB) file(s).
- NOTES#
- dataline#
- class opsimsummaryv2.sim_io.SNSIM_obsfile(OpSimSurvey, out_path=None, author_name=None, ZPTNoise=0.005, CCDgain=1.0, CCDnoise=0.25)[source]#
Bases:
SimWriter
- class opsimsummaryv2.sim_io.SimWriter(OpSimSurvey, out_path=None, author_name=None, ZPTNoise=0.005, CCDgain=1.0, CCDnoise=0.25, outfile_ext='.SIMLIB', file_suffix='')[source]#
- _init_out_path(out_path, outfile_ext, file_suffix='')[source]#
Format output path for SIMLIB and HOSTLIB.
- Parameters:
out_path (str) – Output directory or file.
- Returns:
Path to the output SIMLIB.
- Return type:
- CCDgain = 1.0#
- CCDnoise = 0.25#
- OpSimSurvey#
- ZPTNoise = 0.005#
- author_name = None#
- date_time#
- out_path#
- opsimsummaryv2.sim_io.use_pyarrow = True#