-
Notifications
You must be signed in to change notification settings - Fork 2
/
P95.tex
229 lines (172 loc) · 10.7 KB
/
P95.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
% This is the aspauthor.tex LaTeX file
% Copyright 2010, Astronomical Society of the Pacific Conference Series
\documentclass[11pt,twoside]{article}
\usepackage{asp2010}
\resetcounters
\bibliographystyle{asp2010}
\markboth{Bray}{Astropy}
\newcommand{\aspconf}{ASP Conf.\ Ser.}
\begin{document}
\title{Astropy: Building Blocks for Astronomy Software}
\author{Erik~M.~Bray
\affil{Space Telescope Science Institute, 3700 San Martin Drive, Baltimore, MD 21218, USA}}
\begin{abstract}
The Astropy Project is a community effort to develop an open source Python
package of common data structures and routines for use by other, more
specialized astronomy software in order to foster interoperability.
The project encompasses the ``core'' \texttt{astropy} Python package,
``affiliated packages'' that strive to implement Astropy's coding standards and
interoperability with other affiliated packages, and a broader community aimed
at implementing Pythonic solutions to astronomy computing problems while
minimizing duplication of effort. The project also provides a template for
other projects that use Astropy to reuse much of Astropy's development
framework without reinventing the wheel.
Here we present an overview of the key features of the core package (existing
and upcoming), current and planned affiliated packages, and how we manage a
large open source project with a diverse community of contributors.
\end{abstract}
\section{Core \texttt{astropy} Capabilities}
The \texttt{astropy} package for Python \citep{2013arXiv1307.6212T}, referred
to as the ``core'' package of the Astropy Project, contains classes and functions
to address common needs of other astronomy software as well as interactive data
analysis. It also includes a framework of sundry software development
utilities such as a test framework, documentation helpers, a configuration
system, and build and installation support.
Here we list some of the sub-packages that make up the functionality of the
core \texttt{astropy} package as of version 0.2, as well as some new
functionality that will debut in version 0.3.
\subsection{Core Data Structures and Transformations}
\altsubsubsection*{\texttt{astropy.units}}
Handles defining and converting between physical units, and performing
arithmetic with physical quantities (numerical scalars and arrays with
associated units) using a powerful \texttt{Quantity} class.
\altsubsubsection*{\texttt{astropy.constants}}
Contains a number of physical constants useful in astronomy and physics.
Constants are represented as \texttt{Quantity} objects with additional metadata
describing their provenance and uncertainties.
\altsubsubsection*{\texttt{astropy.nddata}}
Provides an \texttt{NDData} class for managing n-dimensional array-based data
with attached metadata, errors, and masking. Also provides new convolution
routines that treat NaN values properly.
\altsubsubsection*{\texttt{astropy.table}}
Provides a powerful \texttt{Table} class for storing and manipulating
heterogeneous tables of data in a way that is familiar to users of NumPy
\citep{oliphant2006guide,van2011numpy}, though with more flexibility than the
data structures built into NumPy, including support for metadata and masking.
\altsubsubsection*{\texttt{astropy.time}}
Provides functionality for manipulating times and dates. Specific emphasis is
placed on supporting time scales (e.g.~UTC, TAI, UT1) and time representations
(e.g.~JD, MJD, ISO 8601) that are used in astronomy. Wraps the ERFA library of
time and calendar routines, which is a fork of SOFA \citep{Hohenkerk:2010}
released under a more permissive license.
\altsubsubsection*{\texttt{astropy.coordinates}}
Provides classes for representing celestial coordinates and transformation
functions for converting between standard systems in a uniform way.
\altsubsubsection*{\texttt{astropy.wcs}}
Contains utilities for managing WCS transformations in FITS files. These
transformations map the pixel locations in an image to their real-world units.
This sub-package is an import of the already widely used PyWCS package.
\altsubsubsection*{\texttt{astropy.modeling}}
Provides a framework for representing models, performing model evaluation, and
fitting. It supports 1D and 2D models and fitting with parameter constraints
and an API for defining new models and fitting algorithms.
\subsection{File I/O}
One goal of Astropy is to minimize the effort of getting data into and out of
different file formats. To that end it supports a registry of I/O ``connectors''
that allow data from different formats to be transparently read into and
serialized from Astropy's generic \texttt{NDData} and \texttt{Table} classes.
For example, a \texttt{Table} can be read from a FITS file \citep{fits3},
modified as needed, and written out to an HDF5 file. Support for lower-level
operations on specific file formats is maintained as well.
\altsubsubsection*{\texttt{astropy.io.fits}}
A port of the already widely used PyFITS \citep{barrett1999pyfits} package,
supporting reading and writing FITS files including support for many
non-standard FITS conventions.
\altsubsubsection*{\texttt{astropy.io.ascii}}
A port of the popular asciitables package with support for reading from and
writing a wide range of plain text formats to and from Astropy \texttt{Table}
objects.
\altsubsubsection*{\texttt{astropy.io.votable}}
A port of the VOTable package for reading and writing the IVOA VOTable format
\citep{oschenbein2009votable} to and from Astropy \texttt{Table} objects, as
well as validating them.
\altsubsubsection*{\texttt{astropy.io.misc}}
Includes optional support for tables stored in HD5 where h5py is available.
\subsection{Astronomy Computations and Utilities}
\altsubsubsection*{\texttt{astropy.cosmology}}
Contains classes for representing cosmologies, and utility functions for
calculating commonly used quantities that depend on a cosmological model. This
includes distances, ages and lookback times corresponding to a measured
redshift or the transverse separation corresponding to a measured angular
separation.
\altsubsubsection*{\texttt{astropy.stats}}
Holds statistical functions and algorithms used in astronomy, some of which are
more specialized than one would find in \texttt{scipy.stats}.
\altsubsubsection*{\texttt{astropy.vo}}
Handles simple access for Virtual Observatory (VO) services.
\section{Affiliated Packages}
The Astropy Project includes the concept of ``affiliated packages''. An
affiliated package is an astronomy-related Python package that is not part of
the core \texttt{astropy} package, but has requested to be included under the
umbrella of the Astropy Project. Some affiliated packages may be considered
for inclusion in the core package once they reach a reasonable level of
maturity and usefulness. Others may be more specialized or have enough
external dependencies (GUI libraries, for example) that they make more sense as
separate packages. In general we hope that becoming an Astropy affiliated
package will be seen as a good way for new and existing packages to gain
exposure.
The standards for inclusion in the Astropy Project are not strict, but it does
imply interoperability with other affiliated packages through use of the common
classes and data structures provided by the core package. It also implies
adoption of similar coding standards, as well as high standards of
documentation, testing, ease of installation, and open access. To help
affiliated package developers achieve these goals we provide our framework in
the form of a package template that can be used to bootstrap new projects.
Some currently featured affiliated
packages\footnote{\url{http://www.astropy.org/affiliated/index.html}} include
Montage-wrapper, Ginga, APLpy, astroML, and Astropysics. A few additional
affiliated packages that are currently under development are photutils,
astroquery, specutils, and kcorrect.
\section{Community and Collaboration}
The Astropy Project was launched as a response to an increasing proliferation
of Python packages (often with ``astro'' in their names) that attempt to build
core sets of routines ported from IDL and/or IRAF. Many of these efforts are
maintained by one or two individuals or an individual institution, and have not
always involved much community support or feedback. We became concerned that
too much effort was being spent reinventing the wheel, rather than contributing
to a common, open source code base.
A primary guiding principle behind Astropy has been that it is developed by and
for the astronomy community, and that it strives to include contributions from
users and developers from around the world and from all sub-disciplines. It
also aims to encourage best practices from software engineering in the hope of
creating a clean, consistent, and stable API; thorough and well-maintained
documentation;\footnote{\url{http://docs.astropy.org}} and constant feedback
through careful issue tracking and continuous integration testing. All of our
development practices and guidelines are documented so that other
projects---whether affiliated with Astropy or not---may adopt them without
having to develop their own standards from scratch.
In order to better enable collaboration we have adopted the GitHub code hosting
service which provides an issue tracker and a git source code repository.
GitHub is designed around collaboration and enables a low barrier of entry to
submitting new code and bug fixes to open source projects.
Astropy's development process ensures that any bug fixes or new features that
are implemented are accompanied by tests and any relevant updates to the
documentation. Free documentation building and hosting by Read the Docs
ensures that the latest documentation builds correctly and is accessible
online. All new pull requests are tested against multiple Python and NumPy
versions using the continuous integration system Travis. Comprehensive testing
against multiple OS platforms (Linux, MacOS X, and Windows) is made possible by
Jenkins with hosting from Shining Panda. Multi-platform testing has made it
possible for system integrators to include Astropy in many other software
package bundles such as Enthought Canopy, Continuum Analytics' Anaconda, and OS
packaging systems like Debian's APT.
Having an accessible development workflow has attracted contributions from many
new developers (over 50 source code contributors at the time of writing). The
ease of contribution has blurred the line between developers and users---in
fact, we have even implemented a feature that allows anyone reading the
documentation to submit edits and improvements with just a few clicks in their
web browser and no prior knowledge of the git version control system. We
strive for continuous feedback and rework and hope to avoid a ``designed by
committee'' feel.
\bibliography{P95}
\end{document}