ArticleslgStudy

computer science

Astropy

Astropy is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Astropy rather than just read about it. In short: Astropy is a collection of software packages written in the Python programming language and designed for use in astronomy. The software is a single, free, core package for astronomical utilities due to the increasingly widespread usage of Python by astronomers, and to foster interoperability between various extant Python astronomy packages.

Astropy — main illustration
Astropy — illustration

Key takeaways

  • Astropy belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Astropy to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Astropy from memory before moving on to harder problems.

Reference excerpt

Astropy is a collection of software packages written in the Python programming language and designed for use in astronomy. The software is a single, free, core package for astronomical utilities due to the increasingly widespread usage of Python by astronomers, and to foster interoperability between various extant Python astronomy packages. Astropy is included in several large Python distributions; it is listed in package managers for Linux and macOS, the Anaconda Python Distribution, Enthought Canopy and Ureka.

Development Around the turn of the 21st century, the Space Telescope Science Institute (STScI) started developing Python-based utilities to extend or substitute existing astronomical data analysis tools on a modern, object-oriented platform. Among the first projects were a replacement of the command language for the Image Reduction and Analysis Facility (IRAF) with a Python frontend, and the PyFITS interface to the Flexible Image Transport System. Since the existing Numeric module for handling vectors and arrays in Python turned out to be inadequate for large astronomical datasets, a new library better tuned for large array sizes was subsequently developed at STScI. Both libraries were merged into a new array package by Travis Oliphant in 2005–2006, creating NumPy, as of 2013 the de facto standard for numerical data handling in Python. In the following years the existing software packages maintained by STScI as part of their stsci_python suite were ported to NumPy as well. This, together with the more extensive SciPy computing environment, provided a platform to develop customized scripts and applications for a variety of astronomical tasks. By 2011, the use of Python in astronomy had reached significant levels. At the 2012 Astronomy meeting, 42% of attendees preferred Python according to an informal survey. Many astronomy-related Python packages have been developed over the years, albeit without cooperation or coordination, which led to duplication and difficult interoperability between packages. There was also no easy way to install all the required packages needed in an astronomer’s toolkit. A number of smaller packages are sometimes no longer maintained or unavailable. The Astropy project started in 2011, motivated by these difficulties, and a desire to unite developers in astronomy to coordinate the development of a unified set of Python modules for astronomers, and reduce the confusion of available packages. The Space Telescope Science Institute, operators of the Hubble Space Telescope, are merging the work on Astropy into stsci_python releases. PyFITS and PyWCS will be maintained solely within Astropy, with separate releases of these packages stopping, after the next release. PyFITS has been included as part of the Astropy project, and as a result, the next release of STScI_Python will depend on Astropy for the PyFITS library instead of using this standalone release.

Use The National Virtual Observatory Python integration includes support for the Astropy VOTable class The Subaru Telescope Hyper Suprime-Cam, a 900-megapixel ultra-wide-field camera A data mining toolkit for exploring large data cubes in radioastronomy from facilities like ALMA or CARMA. pcigale, the port to Python of CIGALE (Code Investigating Galaxy Emission) Analyzing the optical afterglow of gamma-ray bursts The High Energy Astrophysics Science Archive Research Center (HEASARC) refers to Astropy as "A single core package for Astronomy in Python" Project PANOPTES "makes extensive use of the Astropy package" Astropy has been accepted to the Astrophysics Source Code Library – Starship Asterisk*

Video sources There are several videos recorded in seminars and conferences. These are intended to help beginners learn how Astropy works. The .Astronomy 4 meeting (9–11 July 2012) held a session on Astropy.

Core functionality

Core data structures and operations

Generalized container classes for representing gridded and tabular data as multidimensional arrays or tables Unit and physical quantity conversions Physical constants specific to astronomy Celestial coordinate and time transformations World coordinate system (WCS) support, implementing PyWCS, the Python wrapper to WCSLIB. WCSLIB is a C library which implements the WCS standard in the Flexible Image Transport System (FITS) standard. File I/O

FITS files, implementing the former standalone PyFITS interface Virtual Observatory (VO) tables Common ASCII table formats, e.g. for online catalogues or data supplements of scientific publications Hierarchical Data Format (HDF5) files Computational utilities

Framework for cosmological transformations and conversions Toolset for statistical analyses

Affiliated packages A major part of the Astropy project is the concept of affiliated packages. An affiliated package is an astronomy-related Python package that is not part of the Astropy core but has been suggested for inclusion as part of the project’s community. Such packages are intended to improve reuse, interoperability, and interface standards for Python astronomy and astrophysics packages. Current affiliated packages include:

montage-wrapper ginga APLpy astroML: tools for machine learning and data mining in astronomy Astropysics: library of IDL astronomy routines converted to Python astroplan: observation planning for astronomers A few additional affiliated packages are currently in development, including:

photutils: photometry tools astroquery: online database querying specutils: spectroscopic analysis utilities kcorrect: Python bindings to k-correct code of Blanton et al. 2007 gammapy: high-level gamma-ray astronomy data analysis

See also

List of numerical-analysis software Planetarium software List of observatory software

References

External links Official website GitHub repository Scipy2013 presentation video ADASS Poster abstract[link removed] MPIK Astropy workshop Topical software – scipy.org

Publications Books and scientific publications citing Astropy:

… excerpt ends here. Continue reading the full article.

Illustrations

Astropy illustration

Worked examples

Example 1 — a first encounter with Astropy

Start with the simplest possible case. Write down what Astropy claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Astropy before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Astropy ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Astropy

In research
Astropy appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Astropy in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Astropy is common in secondary-school and first-year university syllabi. It links to neighbouring topics Free astronomy software, Free software programmed in Python, Numerical analysis software for Linux, so understanding it makes those chapters shorter.
In everyday life
Look for Astropy outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Astropy” →

How to study Astropy in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Astropy means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Astropy out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Astropy in simple terms?

Astropy is a collection of software packages written in the Python programming language and designed for use in astronomy. The software is a single, free, core package for astronomical utilities due to the increasingly widespread usage of Python by astronomers, and to foster interoperability betwee…

Why does Astropy matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Astropy?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Astropy.

Tags

  • Free astronomy software
  • Free software programmed in Python
  • Numerical analysis software for Linux
  • Numerical analysis software for Windows
  • Numerical analysis software for macOS
  • Python (programming language) scientific libraries
  • Software using the BSD license

Keep exploring