Welcome to analyzeSN’s documentation!

Contents:

A module for helper functions to read SNANA simulations

class analyzeSN.snanaSims.SnanaSims(headfile, photfile, snids=None, n=None)

class to hold data from SNANA simulations and methods to manipulate the data

snList

list of ~astropy.Table.Table with each Table containing a

light curve of a SN.

static addbandstoSN(sn, lsstbands, replacement)

add a column called ‘band’ to the ~astropy.Table.Table by applying the map of lsstbands to replacements to the content of a column called ‘FLT’

Parameters:
  • sn (~astropy.Table.Table obtained by reading an SNANA light curve) –
  • lsstbands (list of strings, mandatory) – list of strings representing the filters in sn, which can be found by `np.unique(sn[‘FLT’])
  • replacements (list of strings, mandatory) – list of strings representing the filters as registered in SNCosmo in the same order as lsstbands
Returns:

Return type:

~astropy.Table.Table with ‘FLT’ column removed and ‘band’ column added

classmethod fromSNANAfileroot(snanafileroot, location='./', snids=None, n=None)

Class constructor from a root file and a location

Parameters:
  • snanafileroot (string, mandatory) – root file name for the SNANA which is the prefix to ‘_HEAD.FITS’, or ‘_PHOT.FITS’
  • location (string, optional defaults to current working directory ‘./’) – directory where the head and phot files are located
  • snids (integer/string, optional defaults to None) – if not None, only SN observations corresponding to SNID snid are loaded
  • n (Integer, defaults to None) – if not None, only the first n SN light curves are loaded
static snanadatafile(snanafileroot, filetype='head', location='./')

obtain the name of the head or phot file of an SNANA simulation and dataset

Parameters:
  • snanafileroot (string, mandatory) – root file name for the SNANA which is the prefix to ‘_HEAD.FITS’, or ‘_PHOT.FITS’
  • filetype (string, optional defaults to ‘head’) – ‘head’ or ‘phot’ depending on whether a summary file or a photometry file is being used.
  • location (string, optional defaults to current working directory ‘./’) – directory in which the file is located
Returns:

string

Return type:

absolute path to the SNANA file

Indices and tables