Skip to main content

A simulator for neutrino propagation through the earth.

Project description

Propagate neutrinos through the earth.

A python package and command line utility, including fortran for performance with openMP.

Installation

with pip

python3 -m pip install nupyprop

with conda

We recommend installing nupyprop into a conda environment like so. In this example the name of the environment is “nupyprop”

conda create -n nupyprop -c conda-forge -c nuspacesim nupyprop
conda activate nupyprop

Usage

nupyprop --help

Example for running tau propagation for 107 GeV neutrinos at 10 degrees with a statistics of 107 particles with stochastic energy loss & with all other parameters as defaults:

nupyprop -e 7 -a 10 -t stochastic -s 1e7

Run parameters are defined in run.py. Different switches are described as follows:

  1. -e or –energy: incoming neutrino energy in log_10(GeV). Works for single energy or multiple energies. For multiple energies, separate energies with commas eg. 7,8,9,10,11. Default energies are 107,107.25,107.5,…1011 GeV.

  2. -a or –angle: slant Earth angles in degrees. Works for single angle or multiple angles. For multiple angles, separate angles with commas eg. 1,3,5,7,10. Default angles are 1->35 degrees, in steps of 1 degree.

  3. -i or –idepth: depth of ice/water in km. Default value is 4 km.

  4. -l or –lepton: flavor of lepton used to propagate. Can be either muon or tau. Default is tau.

  5. -n or –nu_type: type of neutrino matter. Can be either neutrino or anti-neutrino. Default is Neutrino.

  6. -t or –energy_loss: energy loss type for lepton - can be stochastic or continuous. Default is stochastic.

  1. -x or –xc_model: neutrino/anti-neutrino cross-section model used. For a list of model names, see lookup_tables.h5/Neutrino_Cross_Sections. Default is ct18nlo.

  2. -p or –pn_model: photonuclear interaction energy loss model used. For now, can be either bb (Bezrukov-Bugaev), allm (Abramowicz, Levin, Levy, Maor), bdhm (Block, Durand, Ha, McKay) or ckmt (Capella, Kaidalov, Merino, Tran). Default is allm.

  3. -f or –fac_nu: rescaling factor for SM cross-sections. Default is 1.

  4. -s or –stat: statistics. Default is 1e7 particles.

[STRIKEOUT:WARNING: Running the code will replace the results of the output.h5 file. Backing up previous output files is recommended (or just ask me for a pre-populated output file if need be, for now, since the pre-populated output file is >25 MB). Future fixes include overwrite warnings for the user.] Fixed!

Viewing output results: output_*.h5 will contain the results of the code after it has finished running. In the terminal, run vitables and open the output_*.h5 file to view the output results.

output_*.h5 naming convention is as follows: output_A_B_C_D_E_F_G, where

A = Neutrino type: nu is for neutrino & anu is for anti-neutrino. B = Lepton_type: tau is for tau leptons & muon is for muons. C = idepth: depth of water layer in km. D = Neutrino (or anti-neutrino) cross-section model. E = Lepton photonuclear energy loss model. F = Energy loss type: can be stochastic or continuous. G = Statistics (ie. no. of neutrinos/anti-neutrinos injected).

Code Execution Timing Table for Taus:

Charged Lepton

Energy Loss Type

E|nu| [GeV]

Angles

N|nu|;;in

Time (hrs)

τ

Stochastic

107

1-35

108

1.07*, 0.26***

τ

Continuous

107

1-35

108

0.88*

τ

Stochastic

108

1-35

108

6.18*, 1.53***

τ

Continuous

108

1-35

108

5.51*

τ

Stochastic

109

1-35

108

27.96*, 5.08***

τ

Continuous

109

1-35

108

19.11*

τ

Stochastic

1010

1-35

108

49.80*, 12.43***

τ

Continuous

1010

1-35

108

35.59*

τ

Stochastic

1011

1-35

108

12.73***

τ

Continuous

1011

1-35

108

Code Execution Timing Table for Muons:

Charged Lepton

Energy Loss Type

E|nu| [GeV]

Angles

N|nu|;;in

Time (hrs)

μ

Stochastic

106

1,2,3,5,7,10,12,15,17,20,25,30,35

108

μ

Continuous

106

1,2,3,5,7,10,12,15,17,20,25,30,35

108

0.95*

μ

Stochastic

107

1,2,3,5,7,10,12,15,17,20,25,30,35

108

μ

Continuous

107

1,2,3,5,7,10,12,15,17,20,25,30,35

108

3.19*

μ

Stochastic

108

1,2,3,5,7,10,12,15,17,20,25,30,35

108

μ

Continuous

108

1,2,3,5,7,10,12,15,17,20,25,30,35

108

5.17*

μ

Stochastic

109

1,2,3,5,7,10,12,15,17,20,25,30,35

108

111.77**

μ

Continuous

109

1,2,3,5,7,10,12,15,17,20,25,30,35

108

7.42*

μ

Stochastic

1010

1,2,3,5,7,10,12,15,17,20,25,30,35

108

98.17*

μ

Continuous

1010

1,2,3,5,7,10,12,15,17,20,25,30,35

108

9.76*

μ

Stochastic

1011

1,2,3,5,7,10,12,15,17,20,25,30,35

108

μ

Continuous

1011

1,2,3,5,7,10,12,15,17,20,25,30,35

108

* - Intel Core i7-8750H; 6 cores & 12 threads. ** - Intel Core i5-10210; 4 cores & 8 threads. *** - UIowa Argon cluster; 56 cores.

For debugging/development: The correct order to look at the code is in the following order:

  1. data.py: contains the reading/writing modules from/to the hdf5 files.

  2. geometry_py.py: contains the Earth geometry modules (including PREM) for use with python.

  3. cross_section.py: contains neutrino/anti-neutrino cross_section models.

  4. energy_loss.py: contains lepton energy loss models.

  5. propagate.f90: heart of the code; contains fortran modules to interpolate between geometry variables, cross-sections, energy loss parameters & propagate neutrinos and leptons through the Earth.

  6. main.py: forms the main skeleton of the code; propagates the neutrinos and leptons, and calculates the p_exit and collects outgoing lepton energies.

  7. run.py: contains all the run parameters and variables needed for all the other .py files.

UML Diagram

UML Diagram

Developing the code on Ubuntu

These notes should help developers of this code build and install the package locally using a pep518 compliant build system (pip).

  1. Install the non-pypi required dependencies as described for users above.

  2. Install a fortran compiler. ex: sudo apt-get install gfortran

  3. git clone the source code: git clone git@github.com:NuSpaceSim/nupyprop.git

  4. cd nupyprop

  5. build and install the package in ‘editable’ mode python3 -m pip install -e .

Developing the code on MacOS

These notes should help developers of this code build and install the package locally using a pep518 compliant build system (pip). Currently we do not support the default system python3 on MacOS which is out of date and missing critical functionality. Use the homebrew python instead, or a virtualenv, or a conda environment.

  1. Install the non-pypi required dependencies as described for users above.

  2. Install a fortran compiler. ex: brew install gcc

  3. git clone the source code: git clone git@github.com:NuSpaceSim/nupyprop.git

  4. cd nupyprop

  5. build and install the package in ‘editable’ mode python3 -m pip install -e .

https://hitcounter.pythonanywhere.com/count/tag.svg?url=https%3A%2F%2Fgithub.com%2FNuSpaceSim%2Fnupyprop

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nupyprop-0.1.7.post38-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

nupyprop-0.1.7.post38-cp39-cp39-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

nupyprop-0.1.7.post38-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

nupyprop-0.1.7.post38-cp38-cp38-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

nupyprop-0.1.7.post38-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

nupyprop-0.1.7.post38-cp37-cp37m-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

File details

Details for the file nupyprop-0.1.7.post38-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nupyprop-0.1.7.post38-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 466fb263789f1d2cbc12146d4b7447d32597c98a29bd00ca81f232e7da39cfa7
MD5 19898f6242a322aaea97ff4217c4840a
BLAKE2b-256 23120eb032b63550951a67038e5e5e68508fe8d4d5a6813744ba84c36c4e1fd5

See more details on using hashes here.

File details

Details for the file nupyprop-0.1.7.post38-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: nupyprop-0.1.7.post38-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for nupyprop-0.1.7.post38-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 daddaebcab9ace372e8a37e33efc6ed0a3d30f9dd0dbc9b0600224c5d2eb2e6b
MD5 9886ab856064100d64f40d5f0afc9f46
BLAKE2b-256 a3df6eb18cd4c39b8de40c22d6fdf1ed4fb2e8d47ad8e73911c694e9bd2e2a99

See more details on using hashes here.

File details

Details for the file nupyprop-0.1.7.post38-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nupyprop-0.1.7.post38-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c299825465f7cedc82e4a54868ba2b3a0e5c2ec350ab8b55ea815e034a2e6085
MD5 da5a68604d4676eef170aab77e323883
BLAKE2b-256 9fd15ec6ad7358bbfef439449f4656867fde661e9d72eb9b6b39a053c451e198

See more details on using hashes here.

File details

Details for the file nupyprop-0.1.7.post38-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: nupyprop-0.1.7.post38-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for nupyprop-0.1.7.post38-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0e7ce67d5a42a18c7980ba693d26e783d9cb2be70e8f76d93fc1303396cfb383
MD5 b0592a3c1746e9b29b93717d8b9505ea
BLAKE2b-256 9a980df041e204774666c8329c6626d77aa036e5005fbc84d1ac057cc3ba5bb7

See more details on using hashes here.

File details

Details for the file nupyprop-0.1.7.post38-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nupyprop-0.1.7.post38-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 36f5b00aabe847847ea78a020ac18ccd7539370d8874c2c16415412c3cf47f95
MD5 f16ead5bd9892c5979abc9e3a017150a
BLAKE2b-256 be143ac465ee5f560f46e82d3d87d0de44edee09fc091787c61e78d899f708f0

See more details on using hashes here.

File details

Details for the file nupyprop-0.1.7.post38-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: nupyprop-0.1.7.post38-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for nupyprop-0.1.7.post38-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8c4372432642050cbf9c0567f85d9302b958b9e73aeae1f21bb622ba5ee04a92
MD5 38e2ebcfb03d5a78b0ee06e18d421300
BLAKE2b-256 9faabd94a9930241a580497e94a4410ad2fe3c1373cc8e9e3ebccda3e27202a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page