Skip to main content

NeutrinoTelescopeSimulation

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install ntsim

If you also want to run the GUI utils (see #Viewer section), you need to install the optional dependencies:

pip install ntsim[gui]

Simulation

Getting Started

Starting from the version v0.4 NTSim has become a toolkit, so the user can define the simulation pipeline in a separate runnable python script. Examples of such scripts are located in ntsim/run/run_*.py.

Each of these scripts defines a command-line interface, allowing user to set some of the parameters with arguments.

Check the list of available options:

python run/run_toygen.py -h

For example, running a simulation of 10 events with 1 TeV protons and saving it to "sim_proton_1TeV.h5":

python run/run_toygen.py -E 1000 --primary_gen.pdg=2212 -o "sim_proton_1TeV.h5" 10

For more detailed explanation see Getting_started in the documentation.

Analysis

NTSim provides h5Reader to read the output files and obtain events from the file and analyze them:

Read the hdf5 file using h5Reader

from ntsim.IO.h5Reader import h5Reader

with h5Reader('ntsim_run_smt.h5') as f:
    geometry = f.geometry
    for e in range(len(f.events)):
        event = f.events[e]
        primary = event.particles["Primary"]
        track0 = event.tracks["g4_tracks_0"]
        hits = event.hits["Hits"]
        ...

Output format

The main output format is the hdf5 file with the following tree structure:

  • Header/:
    • run_configuration/:
    • geometry/
      • Geometry: dataset describing the individual modules position and geometry
  • event_<n>/: group for each simulated event
    • header/ general event information (metadata)
      • id: event number
      • timestamp: time information (seconds since epoch)
    • particles/ information about primary particles.
      • Primary dataset for primary particles, to be processed by ParticlePropagator
      • g4_cascade_starters_<n> datasets, containing secondary particles which start the parametrized cascades
    • tracks/g4_tracks_<n> track segments, results of the Geant4 propagation
    • photons/photons_<n>/ groups for photons information
    • hits/Hits: dataset with the hits in the sensitive detectors

3D Viewer

Viewer reads ntsim_events.h5 file and displays information from file. It allows to watch animation of particles propagation in 3D, it also can build histograms of physical parametres. Viewer helps to analyse results of simulation.

Running

python3 -m ntsim.Viewer  

this will run an "open file" dialog to choose the simulation file to display.

python3 -m ntsim.Viewer h5_output/events.h5 

This will open defaut file named "h5_output/events.h5" produced by NTSim.

Some Options

If the display works slow, try to set minimal track length bigger.

python3 -m ntsim.Viewer h5_output/events.h5 --min_length_for_tracks 1

This will show only tracks bigger than 1 m.

To increase speed of animation try to set less amount of frames.

python3 -m ntsim.Viewer h5_output/events.h5 --animation_frames 10 0 3000

This will show only 10 frames in time interval from 0 to 3000

License

ntsim is distributed under the terms of the MIT license.

Metadata

Release files for ntsim 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ntsim 0.4.1
File Size Uploaded
ntsim-0.4.1.tar.gz 109.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ntsim 0.4.1
File Interpreter ABI Platform
ntsim-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 245.4 kB

Release files / ntsim-0.4.1.tar.gz

Download URL ntsim-0.4.1.tar.gz
Size 109.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7aa0839b8e1437dd393c5f9ea4d086a5abd7240ffe38f36a3a12164f278c08aa
BLAKE2b-256 checksum
How to use checksums
efdd7ed8b8ecf64a868ea752a1482823f94be51635d8db6d1977303924d0f1ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release files / ntsim-0.4.1-py3-none-any.whl

Download URL ntsim-0.4.1-py3-none-any.whl
Size 135.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e30d1369b1af1c85e14425c6c17bbe3f6549d29c74222163a9bba615410699a
BLAKE2b-256 checksum
How to use checksums
30c5b8d94a1e8410e47a6f90ccbfe5f1ed95502f0c0256761ae3da7acd0cbf07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page