Skip to main content

np2mcpl

License: MIT

np2mcpl is a low-key tool to help write mcpl-files directly from numpy-arrays.

Build/Install/Use

  1. Make sure you have installed the MCPL-library (and NumPy)
  2. Build the python/c module: python setup.py build
  3. Add the build directory to PYTHONPATH or run: python setup.py install
  4. In your python script: import np2mcpl
  5. Create a numpy array and save it. E.g. : np2mcpl.save("output",M)

Notes and limitations

  • np2mcpl takes as input a 2D NumPy array with 10 or 13 columns, where the columns are assumed to be:
PDG-code  x y z   ux uy uz   t e_kin weight    [ px py pz ]

where the PDG-code denotes which kind of particle it is, e.g. 2112 for neutrons, 22 for photon, ... as documented here: Particle Numbering Scheme

  • The vector ux,uy,uz must have unit length. The optional vector px,py,pz is the polarisation vector associated with the Monte Carlo-particle.
  • Units follow the MCPL-standard. I.e. x,y,z in cm, e_kin in MeV, t in ms.
  • The input array is expected to be made of floating point numbers (including the PDG-code) in either double or single precision. If the numpy array is in single precision, this will be reflected in the mcpl-file.

Metadata

Release files for np2mcpl 0.1.0

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

Source distribution (sdist)

Source distribution for np2mcpl 0.1.0
File Size Uploaded Provenance
np2mcpl-0.1.0.tar.gz 5.5 kB Without provenance Details

Release files / np2mcpl-0.1.0.tar.gz

Download URL np2mcpl-0.1.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
559463ef9e065a2edc0bcb7db0afc6a6bff758b0cfd3a35d013f25c38f0ae83c
BLAKE2b-256 checksum
How to use checksums
20e4ea4777961072ef37cfcea3129b31fdd54bcba4a72963a9e1b5da853c884a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Security for np2mcpl 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

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