Using Astropy

Note

Changes to this document must be approved by the System Architect (RFC-24). To request changes to these policies, please file an RFC.

Integration of Astropy core into the LSST software stack is an ongoing process that will evolve over time as we work on enhancing interoperability of the current codebase with Astropy. This document is not discussing Astropy affiliated packages, use of which must go through the standard RFC process. Not all Astropy core packages can be used by default.

The following packages can be used internally in packages:

For reading and writing files in FITS format, both astropy.io.fits and fitsio are allowed. These libraries differ in the features available and in performance (with the latter usually surpassing the former). Developers must evaluate which works best for their use case and choose one accordingly.

Warning

lsst.afw.fits must not be used in any new Python code, as it is not considered memory safe.

If not interacting with C++ classes the use of astropy.table is encouraged. The interaction of Astropy with LSST C++ classes providing related functionality should be carefully monitored. If the code is already using afw it is strongly preferred that afw equivalents be used until such time as specific afw interfaces are deprecated. astropy.table views into afw.table tables can be used if required.

Changing any public APIs requires an RFC. Hence using Astropy in any public API must go through an RFC.

These items have functionality that is similar to that provided in LSST packages:

They are not allowed to be used in LSST code without special permission, such as submitting an RFC.

This advice will evolve as interoperability with Astropy develops.