A repository for the new parallelized version of 2DFFT, a code that allows the user to isolate and measure the spiral arm pitch angle of galaxies.

View on GitHub


P2DFFT has simplified the user input and depending on the number of cores available, runs significantly faster than the older serial version, 2DFFT. Further enhancements include:

  • Allowing direct input of FITS images
  • Optionally outputting inverse Fourier transform FITS images
  • Ability to generate idealized logarithmic spiral test images of a specified size that have 1 to 6 arms with pitch angles of -75 degrees to 75 degrees
  • Ability to output Fourier amplitude versus inner radius and pitch angle versus inner radius for each Fourier component (m = 0 to m = 6)
  • Ability to calculate the Fourier amplitude weighted mean pitch angle across m = 1 to m = 6 versus inner radius


If you publish results using P2DFFT, please cite the following paper:

Mutlu-Pakdil, B., Seigar, M. S., Hewitt, I. B., Treuthardt, P., Berrier, J. C., & Koval, L. E., The Illustris Simulation: Supermassive Black Hole - Galaxy Connection Beyond the Bulge, MNRAS, 474, 2594 (2018).

2DFFT can be found here. If you publish results using this code, please cite the following paper:

Davis, B. L., Berrier, J. C., Shields, D. W, et al., Measurement of Galactic Logarithmic Spiral Arm Pitch Angle Using Two-Dimensional Fast Fourier Transform Decomposition, ApJS, 199: 33 (2012).

Available Versions

p2dfft-4.4.tgz (Rebase the code to Ubuntu 16.04 LTS and add options to spiral.c to set arm sweep and luminosity change)

p2dfft-4.2.tgz (Fix missing makefile and CHANGES files in V4.1 and add -a option to avg.py)

p2dfft-4.1.tgz (Minor bug fixes when using the -n [nautical mile] option on the avg.py tool)

p2dfft-4.0.tgz (Major update to switch to using the Harvard FFTW3 libraries for performance and better licensing terms. Also further updates to avg.py output plotting program, bug fixes, additional documentation, and more usuability enhancements)

p2dfft-3.5.tgz (Major updates to avg.py output plotting program, bug fixes, and usuability enhancements)

p2dfft-3.3.tgz (Updated instructions, add support for reentrant flag in CFITSIO libraries, and correct error in handling ASCII FITS files)

p2dfft-3.2.tgz (Eliminated compatibility issue between C++11 and GCC versions older than 4.9)