Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.2rc2

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.2rc2
File Size Uploaded Provenance
ntsim-0.4.2rc2.tar.gz 109.8 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 245.5 kB

Release files / ntsim-0.4.2rc2.tar.gz

Download URL ntsim-0.4.2rc2.tar.gz
Size 109.8 kB
Tags Source
SHA-256 checksum
How to use checksums
351d769a0c3e28dd03ca9e3bd213272abaacea5697b02605a9cedea7cb239e58
BLAKE2b-256 checksum
How to use checksums
ceb168b29578d63d8d1e40692d3e563c4a8fe67b4cbb6675b0553d30d68f16de
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.2rc2-py3-none-any.whl

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

Security for ntsim 0.4.2rc2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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