Using SNEWPY as a Front End for SNOwGLoBES

Install SNOwGLoBES

Important parts of SNEWPY’s functionality require the SNOwGLoBES (v1.2 recommended) and GLoBES libraries, which need to be installed separately. (See the respective documentation for instructions.)

Usage

The snewpy.snowglobes module contains functions for interacting with SNOwGLoBES.

SNOwGLoBES can estimate detected event rates from a given input supernova neutrino flux. It supports many different neutrino detectors, detector materials and interaction channels. There are three basic steps to using SNOwGLoBES from SNEWPY:

  • Generating input files for SNOwGLoBES:

    There are two ways to do this, either generate a time series or a fluence file. This is done taking as input the supernova simulation model. The first will evaluate the neutrino flux at each time step, the latter will compute the integrated neutrino flux (fluence) in the time bin. The result is a compressed .tar file containing all individual input files.

  • Running SNOwGLoBES:

    This step convolves the fluence generated in the previous step with the cross-sections for the interaction channels happening in various detectors supported by SNOwGLoBES. It takes into account the effective mass of the detector as well as a smearing matrix describing the energy-dependent detection efficiency. The output gives the number of events detected as a function of energy for each interaction channel, integrated in a given time window (or time bin), or in a snapshot in time.

  • Collating SNOwGLoBES outputs:

    This step puts together all the interaction channels and time bins evaluated by SNOwGLoBES in a single file (for each detector and for each time bin). The output tables allow to build the detected neutrino energy spectrum and neutrino time distribution, for each reaction channel or the sum of them.

snewpy.snowglobes.generate_time_series(model_path, model_type, transformation_type, d, output_filename=None, ntbins=30, deltat=None)[source]

Generate time series files in SNOwGLoBES format.

This version will subsample the times in a supernova model, produce energy tables expected by SNOwGLoBES, and compress the output into a tarfile.

Parameters
  • model_path (str) – Input file containing neutrino flux information from supernova model.

  • model_type (str) – Format of input file. Matches the name of the corresponding class in snewpy.models.

  • transformation_type (str) – Name of flavor transformation. See snewpy.flavor_transformation documentation for possible values.

  • d (int or float) – Distance to supernova in kpc.

  • output_filename (str or None) – Name of output file. If None, will be based on input file name.

  • ntbins (int) – Number of time slices. Will be ignored if deltat is also given.

  • deltat (astropy.Quantity or None) – Length of time slices.

Returns

str – Path of compressed .tar file with neutrino flux data.

snewpy.snowglobes.generate_fluence(model_path, model_type, transformation_type, d, output_filename=None, tstart=None, tend=None)[source]

Generate fluence files in SNOwGLoBES format.

This version will subsample the times in a supernova model, produce energy tables expected by SNOwGLoBES, and compress the output into a tarfile.

Parameters
  • model_path (str) – Input file containing neutrino flux information from supernova model.

  • model_type (str) – Format of input file. Matches the name of the corresponding class in snewpy.models.

  • transformation_type (str) – Name of flavor transformation. See snewpy.flavor_transformation documentation for possible values.

  • d (int or float) – Distance to supernova in kpc.

  • output_filename (str or None) – Name of output file. If None, will be based on input file name.

  • tstart (astropy.Quantity or None) – Start of time interval to integrate over, or list of start times of the time series bins.

  • tend (astropy.Quantity or None) – End of time interval to integrate over, or list of end times of the time series bins.

Returns

str – Path of compressed .tar file with neutrino flux data.

snewpy.snowglobes.simulate(SNOwGLoBESdir, tarball_path, detector_input='all', verbose=False)[source]

Takes as input the neutrino flux files and configures and runs the supernova script inside SNOwGLoBES, which outputs calculated event rates expected for a given (set of) detector(s). These event rates are given as a function of the neutrino energy and time, for each interaction channel.

Parameters
  • SNOwGLoBESdir (str) – Path to directory where SNOwGLoBES is installed.

  • tarball_path (str) – Path of compressed .tar file produced e.g. by generate_time_series() or generate_fluence().

  • detector_input (str) – Name of detector. If "all", will use all detectors supported by SNOwGLoBES.

  • verbose (bool) – Whether to generate verbose output, e.g. for debugging.

snewpy.snowglobes.collate(SNOwGLoBESdir, tarball_path, detector_input='all', skip_plots=False, verbose=False, remove_generated_files=True)[source]

Collates SNOwGLoBES output files and generates plots or returns a data table.

Parameters
  • SNOwGLoBESdir (str) – Path to directory where SNOwGLoBES is installed.

  • tarball_path (str) – Path of compressed .tar file produced e.g. by generate_time_series() or generate_fluence().

  • detector_input (str) – Name of detector. If "all", will use all detectors supported by SNOwGLoBES.

  • skip_plots (bool) – If False, it gives as output the plot of the energy distribution for each time bin and for each interaction channel.

  • verbose (bool) – Whether to generate verbose output, e.g. for debugging.

  • remove_generated_files (bool) – Remove the output files from SNOwGLoBES, collated files, and .png’s made for this snewpy run.

Returns

dict – Dictionary of data tables: One table per time bin; each table contains in the first column the energy bins, in the remaining columns the number of events for each interaction channel in the detector.