Code for calculating actions, angles and frequencies in various ways
Jason Sanders -- jls at ast dot cam dot ac dot uk
Please cite the accompanying paper Sanders & Binney (2016) if you find the code useful.
- Make sure environment variable $(CXX) gives c++ compiler or specify compiler path in Makefile.inc (need a C++-11 compatible compiler, it compiles with clang 3.4 and g++ 4.8 or 4.9)
- Specify path to gsl in Makefile.inc
- Run make
This will install the basic package. To access all the features one should also install Torus and LAPACK:
- Some code uses Torus. To use this install Torus (use 'make CPP="$CXX -fPIC"' to ensure libraries are compiled with fPIC flag) , add path to Torus to Makefile.inc and run 'make TORUS=1'. Currently there are problems compiling with Torus using clang. This appears to be due to different compiler flags in Torus and tact. If users wish to use clang then they should make sure the compiler flags are the same for both.
- Some code uses LAPACK. To use this install LAPACK, add path to LAPACK to Makefile.inc and run 'make LAPACK=1'
- To do both run 'make TORUS=1 LAPACK=1'
One can also compile the code into a python module. This requires the boost library and the paths in Makefile.inc to python and boost to be correctly set. With these set either run 'make python' or use the setup.py in /aa like 'TORUS=1 LAPACK=1 python setup.py install'.
There is also test code that runs using googletest. However, there is a quick test to run detailed below.
- Analytic potentials (Isochrone and Harmonic oscillator)
- General spherical potentials
- Cylindrical Adiabatic Approximation (CAA), Schoenrich & Binney (2012)
- Spheroidal Adiabatic Approximation (SAA) (unpublished, in my thesis)
- Stackel fitting, Sanders (2012)
- Axisymmetric Stackel fudge, Binney (2012)
- Interpolation using Axisymmetric Stackel fudge, Binney (2012)
- Triaxial Stackel fudge, Sanders & Binney (2015)
- Generating function from orbit (axisymmetric and triaxial, O2GF), Sanders & Binney (2014)
- Average generating function from orbit (AvGF), Bovy (2014), Fox (2014)
- Iterative Torus Machine (ItTC), Sanders & Binney (2015)
There is some documentation that can be produced by doxygen by running
The python library also contains doc strings.
After successful compilation the command
cd aa; ./mains/test_actions.exe 8. 1. 0.2 40. 200. 50. acts.dat
should integrate an orbit with initial conditions X=(8. 1. 0.2) kpc and V = (40. 200. 50.)km/s in the potential
with Vc=220km/s and q=0.9 (or in the Piffl 2014 potential if Torus is installed) and compute the actions for each point using a variety of methods. The results are output in acts.dat with two columns per method (JR and Jz).
The accompanying paper is Sanders & Binney (2016). action_comp_plots.py reproduces all but one of the plots in the paper. To produce the data for these plots the following scripts are available.
- Fig. 2 data is produced by the command
- Fig. 3, 4, 5, 6 data are produced by the command
- Fig. 7 data are produced by