Upgrade to Pro — share decks privately, control downloads, hide ads and more …

State of the Astropy universe

State of the Astropy universe

Presentation on Astropy given at EuroScipy 2014.
https://www.euroscipy.org/2014/schedule/presentation/6/

Christoph Deil

August 29, 2014
Tweet

Other Decks in Science

Transcript

  1. The problem The Problem • astLib • astrolib • astropysics

    • pyephem • ephempy • pyast • pyastro • apwlib • chiantipy • pymidas • pandora • pyspec • pyraf • atpy • aplpy • pynovas • cosmopy • cosmolopy • kapteyn • cosmics.py • pyguide • astrogui • pyastronomy • pywcs • pyfits • sunpy • ...more? Monday, March 4, 13 4
  2. The solution • Start the Astropy project … a community

    effort to develop a core package for Astronomy in Python and foster interoperability between Python astronomy packages. • Astropy project coordinators: • Perry Greenfield, STScI • Thomas Robitaille, MPIA • Erik Tollerud, Yale • Astropy core package … useful for most astronomers. • Astropy affiliated packages … for more specialised astronomy applications. Leverage Astropy infrastructure (packaging, testing, documentation) by using a package template. 5
  3. 3 years later …
 it’s worked out very well! 6

    STScI has gotten substantial funding (several FTEs for 4+ years) to develop generic data analysis tools for Python to support JWST data analysis needs … most effort will go to Astropy and affiliated packages.
  4. Astropy core package (Since most of you aren’t astronomers, I

    focus on the sub-package that is probably most useful to scientists in general: astropy.units) 7
  5. Astropy core status • 3 major public releases (first release

    February 2013) • Latest stable version: 0.4.1 (released August 2014) • Astropy 0.2 paper in Astronomy & Astrophysics journal (a nice sign that an astronomy science journal accepts a paper only presenting a software, not a science application) • Astropy Proposal Enhancements (APEs) for significant changes to the Astropy core, similar to PEPs. • GSoC students (2 in 2013 and 6 in 2014) • Already 9,600 commits from 90 contributors. 8
  6. Astropy core functionality • Units, quantities, constants ! • Celestial

    coordinate representation and transformation • High-level Time class (very high precision: two float64, time scale transformations)! • WCS transformation • Extensible framework for reading/writing ASCII tables • FITS files and VO table handling • High-level Table class with easy reading/writing
 (difference to pandas dataframe: array columns, metadata, masks)! • Convolution/filtering utilities (with masks) • Cosmological calculations • Modeling / fitting framework (uses scipy.optimize)! • Astrostatistics • Virtual Observatory • And more! 9
  7. astropy.units • Many Python units / quantity packages exist, but

    none fit all the requirements for units in Astropy: • Separation and conversion between systems (e.g. SI and CGS) • Equivalencies (e.g. frequency to wavelength) • Multiple serialisation formats (e.g. FITS and VOUnit) • So the pynbody units code was taken as a starting point and developed into astropy.units.! • The following slides give a short introduction to some of the basic features … there’s much more and I’m not an expert, just a user / fan. 10
  8. 01/,-6Ȉ##&)&1"!ȉ- ($"0 +"ǿ ż 2+ 1&,+)&162+!"/!"3"),-*"+1#,/ ,/" ż ,/"0-" &)&7"!#2+

    1&,+)&16 ż  ($"04&1%&+ ,*-1&)")& "+0"0 !%"/"1,01/,-6 ,!&+$Ǿ1"01&+$Ǿ+!!, 0$2&!")&+"0 0"01/,-64%"/"3"/-,00&)"ț3,&!!2-)& 1&,+Ȝ 16
  9. Existing affiliated packages • APLpy – Plotting of Astronomical images

    • astroML – Machine learning and data mining in Astronomy • astropysics – Utilities for reducing, analyzing, and visualizing data • astroquery – Querying of online databases • ccdproc – Basic reduction of CCD data • gammapy – Gamma-ray astronomy! • ginga – Interactive FITS file viewer • montage-wrapper – Wrapper for the Montage image mosaicking engine • photutils – Photometry tools! • pydl – Library of IDL astronomy routines in Python • pyVO – Virtual observatory tools (complements astropy.vo) • sncosmo – Simulating, fitting, and typing of Supernova light curves • specutils – Spectroscopic analysis tools • wcsaxes – Extensible framework for plotting images with WCS! • … many more coming … 17
  10. • Example of an affiliated package that will be included

    into the Astropy core soon, because it’s useful for most astronomers. • WCSAxes is a framework for making plots of Astronomical data in Matplotlib. • WCS = “World coordinate system”
 = projections of the sky onto images. • Provides WCSAxes class, which subclasses matplotlib.axes.Axes and knows about Astropy coordinates and quantities. WCSAxes https://github.com/astrofrog/wcsaxes 18
  11. • source detection and characterisation on astronomical images • aperture

    and PSF photometry • currently high development activity (see GitHub) • version 0.1 release in August 2014 • might become astropy.photometry photutils https://github.com/astropy/photutils photutils https://github.com/astropy/photutils • Example of an Astropy affiliated package that might be included into the Astropy core, because it’s useful for a large fraction of astronomers. • Source detection and characterisation in astronomical images. • Aperture and PSF photometry • Uses scipy.ndimage and scikit-image 19
  12. https://github.com/gammapy/gammapy • Example of an Astropy affiliated package that will

    never be included into the Astropy core, because it’s useful only for a sub-community of astronomers. • Tools to simulate and analyse astronomical gamma-ray data from ground- and space-based telescopes. • 0.1 release a few days ago … I’m hoping a small community of scientific Python enthusiasts will start using and contributing to it. 20
  13. • airspeed velocity (asv) is a tool for benchmarking Python

    packages over their lifetime
 https://github.com/spacetelescope/asv • Check Astropy benchmarks as an example:
 http://mdboom.github.io/astropy- benchmark/ • Not Astropy-specific … can be useful for any Python package where performance matters. 21 Write benchmarks View results in web browser Set up and run benchmarks
  14. Next steps for Astropy • Improvements and additions to the

    Astropy core package.
 - Finish modeling, coordinates, …
 - Add generalised WCS, imageutils, sphere, …
 - Use quantities throughout Astropy … • Astropy 1.0 release scheduled for December 2014.
 Release cycle: 6 month, 2 year LTS • Extend the ecosystem of Astropy affiliated packages.
 A future of open and reproducible science in Astronomy? • “Python in Astronomy” workshop
 20-24 April 2015, Lorentz Center, Leiden
 http://python-in-astronomy.github.io/ 22