  We present the MATLAB code Spirality, a novel method for measuring spiral arm
pitch angles by fitting galaxy images to spiral templates of known pitch.
Computation time is typically on the order of 2 minutes per galaxy, assuming at
least 8 GB of working memory. We tested the code using 117 synthetic spiral
images with known pitches, varying both the spiral properties and the input
parameters. The code yielded correct results for all synthetic spirals with
galaxy-like properties. We also compared the code's results to two-dimensional
Fast Fourier Transform (2DFFT) measurements for the sample of nearby galaxies
defined by DMS PPak. Spirality's error bars overlapped 2DFFT's error bars for
26 of the 30 galaxies. The two methods' agreement correlates strongly with
galaxy radius in pixels and also with i-band magnitude, but not with redshift,
a result that is consistent with at least some galaxies' spiral structure being
fully formed by z=1.2, beyond which there are few galaxies in our sample. The
Spirality code package also includes GenSpiral, which produces FITS images of
synthetic spirals, and SpiralArmCount, which uses a one-dimensional Fast
Fourier Transform to count the spiral arms of a galaxy after its pitch is
determined. The code package is freely available online; see Comments for URL.
