Julia Astro: Enabling Next-Generation Analysis in Astronomy

September 24, 2015

Data analysis in astronomy has traditionally fallen into two categories: work done in high-level dynamic programming languages, such as IDL or Python, and work done in low-level compiled languages, such as C, C++, and Fortran. Astronomers love high-level dynamic languages for their shallow learning curve and rapid development cycle, but on very large scale or for computationally intensive problems, they often become inadequate. Compiled low-level languages give the best performance but require a higher level of programming skill and have a slower development cycle with fewer easily available tools.

Enter Julia. Julia is a new programming language that promises the dynamic programming experience of a language like Python with the performance of a low-level compiled language like C. Programming in Julia, one can scale up a problem without ever switching languages or leaving familiar tools and libraries behind. As astronomers ask more complex questions with increasing amounts of data, this capability will become critical.

A good recent example of this is the Celeste project [1, 2], a new statistical analysis model for large-scale sky surveys. Designed for the next generation of telescopes, Celeste will need to process 8 TB of data nightly with a complex statistical model. "Celeste had to be fast, so we considered C++, a blend of Python and Cython, and Julia. Julia let us write most of our program in a high-level, math-inspired syntax, without requiring us to pass data structures between programming languages," says Jeffrey Regier (UC Berkeley Statistics), lead author on the paper presenting the method.

With a new programming language comes the need for the development of domain-specific software libraries for that language. Julia is distributed with commonly used libraries for numerical and scientific computing but lacks the large suite of astronomy-specific libraries already available for languages like IDL or Python. The Julia Astro organization was created to shepherd the development of such commonly used astronomy libraries. For example, the FITS format is the standard data-exchange format used in astronomy. The FITSIO.jl Julia package lets one easily read and write these files from Julia. There are packages for several other common tasks: converting between astronomical coordinate systems, precise time conversions, calculating cosmological distances, and calculating the effects of interstellar dust. All the code is developed openly on GitHub and is licensed under the permissive open-source MIT license.

It's still quite early for JuliaAstro and even for Julia itself, but Julia is already proving beneficial in real-world astronomical problems, and the future is bright!