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

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

Built distribution (wheel)

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

Total release size: 245.0 kB

Release files / ntsim-0.4.2.tar.gz

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

Download URL ntsim-0.4.2-py3-none-any.whl
Size 135.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73da45a8e52f8c7eddb4c98c3727a64e0d134772033cfa79183e8a8f6f6ba14f
BLAKE2b-256 checksum
How to use checksums
376b44e047e221a91c0778a9e99ce933a90bde6a622b7c5e57b4535b2a66261b
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.2

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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