diff --git a/doc/scripts/SNEWS2.0_rate_table.py b/doc/scripts/SNEWS2.0_rate_table.py index 9369936d0..9368b01fb 100644 --- a/doc/scripts/SNEWS2.0_rate_table.py +++ b/doc/scripts/SNEWS2.0_rate_table.py @@ -1,6 +1,12 @@ import numpy as np import os -from snewpy import snowglobes + +from snewpy.rate_calculator import RateCalculator +from snewpy.models.ccsn import Bollig_2016, OConnor_2015 +from snewpy.neutrino import MassHierarchy, MixingParameters, ThreeFlavorMixingParameters +from snewpy.flavor_transformation import AdiabaticMSW + +from astropy import units as u #Select output format, Mathjax or LaTeX while True: @@ -14,59 +20,46 @@ else: print('Please enter 1 or 0.') -home_directory = os.getcwd() -SNOwGLoBES_path = None # change to SNOwGLoBES directory if using a custom detector configuration -SNEWPY_models_base = "Your/SNEWPY/Models/Path/Here" # local directory containing model input files ("SNEWPY_models") +models = { 's11.2' : Bollig_2016(progenitor_mass=11.2< 10000: @@ -149,15 +142,15 @@ def round_to_2(x): # the unweighted mass (the entry in SNOwGLoBES), see below for details. Here we take the # effective mass of the s27 normal scenario and discuss the range in the table caption. -dettype = 'icecube' +detector_type = 'icecube' mass = 51600 -data['Mass [kt]'][2] = "~"+str(int(round(mass*total_events['s27.0']['AdiabaticMSW_NMO'][dettype+"smeared"]/ - total_events['s27.0']['AdiabaticMSW_NMO'][dettype+"unsmeared"], -2)))+"*" +data['Mass [kt]'][2] = "~"+str(int(round(mass*total_events['smeared']['s27.0']['AdiabaticMSW_NMO'][detector_type]/ + total_events['unsmeared']['s27.0']['AdiabaticMSW_NMO'][detector_type], -2)))+"*" -dettype = 'km3net' +detector_type = 'km3net' mass = 69366 * 3 -data['Mass [kt]'][3] = "~"+str(int(round(mass*total_events['s27.0']['AdiabaticMSW_NMO'][dettype+"smeared"]/ - total_events['s27.0']['AdiabaticMSW_NMO'][dettype+"unsmeared"], -1)))+"*" +data['Mass [kt]'][3] = "~"+str(int(round(mass*total_events['smeared']['s27.0']['AdiabaticMSW_NMO'][detector_type]/ + total_events['unsmeared']['s27.0']['AdiabaticMSW_NMO'][detector_type], -1)))+"*" # Formatting the dictionary to be compatible with LaTeX & MathJax (useful for html) def dictArray(dictionary): @@ -208,4 +201,4 @@ def dictArray(dictionary): print("\\usepackage{amsmath}\n\\begin{document}") #loads forever without amsmath package print(f"$$\n{dictArray(data)}\n$$") print("\\end{document}") -#Just copy & paste the output into LaTeX! \ No newline at end of file +#Just copy & paste the output into LaTeX! diff --git a/doc/scripts/TimeSeries.py b/doc/scripts/TimeSeries.py index a9fc21c35..290855bf4 100644 --- a/doc/scripts/TimeSeries.py +++ b/doc/scripts/TimeSeries.py @@ -1,18 +1,29 @@ #!/usr/bin/env python -from snewpy import snowglobes +from snewpy.models.ccsn import Nakazato_2013 +from snewpy.neutrino import MassHierarchy, MixingParameters +from snewpy.flavor_transformation import AdiabaticMSW +from snewpy.rate_calculator import RateCalculator -SNOwGLoBES_path = None # change to SNOwGLoBES directory if using a custom detector configuration +import numpy as np +import astropy.units as u -# arguments for generate_time_series -model_file = "/path/to/snewpy/models/Nakazato_2013/nakazato-LS220-BH-z0.004-s30.0.fits" -modeltype = 'Nakazato_2013' -transformation = 'AdiabaticMSW_NMO' -d = 10 # Supernova distance in kpc +model = Nakazato_2013(progenitor_mass=30*u.solMass, revival_time=0*u.ms, metallicity=0.004, eos='LS220') -# Running the modules -outfile = snowglobes.generate_time_series(model_file, modeltype, transformation, d) -snowglobes.simulate(SNOwGLoBES_path, outfile, detector_input="icecube") -snowglobes.collate(SNOwGLoBES_path, outfile) +transformation = AdiabaticMSW(MixingParameters('NORMAL')) # Desired flavor transformation + +times = model.get_time() +energies = np.linspace(0,100,501)<