Metadata-Version: 2.1
Name: np2mcpl
Version: 0.0.1
Summary: Package to convert a Monte Carlo particle in the form of a numpy-array to a MCPL-file.
Author-email: Erik B Knudsen <erik.knudsen@copenhagenatomics.com>
Project-URL: Homepage, https://github.com/ebknudsen/np2mcpl
Project-URL: Bug Tracker, https://github.com/ebknudsen/np2mcpl/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy

# np2mcpl

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