This repository contains experimental implementations of grand.coordinates
.
It requires the ctypes
, grand
and pint
packages and at least Python 3.7.
There are two implementations:
-
coordinates.py
usesgrand.libs
for coordinates transforms (libturtle
). -
ccoordinates.py
is an interface to what could be a C implementation ofgrand_coordinates
. The corresponding C source is in the src/ directory. The interfacing to C is done with thecffi
package and data are exposed asnumpy.ndarray
.Note that there are no coordinates transforms as for now. This implementation simply illustrates how the same C data can be exposed as different views using numpy, e.g. as a single
xyz
array or as separatex
,y
andz
arrays. This approach would also provide the same coordinates objects at the C level with seamless interoperability with Python.
In both cases astropy
is not used. The pint
package is a perfect
replacement for astropy.units
and Earth coordinates transforms are available
from the C TURTLE
library also used in the neutrino simulation. It was
cross-checked to be consistent with the astropy
AltAz
, EarthLocation
and
ITRS
coordinates.
From the root of this repo and assuming that the grand
repo is available
aside:
source ../grand/env/setup.sh
pip install ctypes pint
python build_coordinates.py
Then the test.py and test-c.py can be used in order to test (showcase) the two implementations.