# Image Processing in Python With Montage

**Authors:** John Good, G. Bruce Berriman  
**arXiv:** [1908.09753](https://arxiv.org/abs/1908.09753)  
**Date:** 2019-08-26  
**Summary page:** https://www.summarizepaper.com/en/arxiv-id/1908.09753v1/

## Key points

- Montage image mosaic engine is widely used in astronomy research and integration into processing environments
- The engine is written in C to provide performance and portability
- Users can take advantage of all the functionality in Python while running at compiled speeds by linking C/C++ libraries to the Python kernel at run time as binary extensions
- Authors have built Python binary extensions of the 59 ANSI-C modules that make up version 5 of the Montage toolkit, which can be used for various image processing tasks such as reprojecting and resampling images, rectifying background emission to a common level, creating image mosaics that preserve calibration and astrometric fidelity of input images, creating visualizations with an adaptive stretch algorithm, processing HEALPix images, analyzing and managing image metadata.
- The authors demonstrate how these Python binary extensions can be used within a Python environment through binary extensions that allow for efficient data processing while retaining full functionality within Python.

## Summary

In their paper "Image Processing in Python With Montage," authors John Good and G. Bruce Berriman discuss the Montage image mosaic engine which has become widely used in astronomy research and integration into processing environments. The engine is an exemplar application for the development of advanced cyber-infrastructure, written in C to provide performance and portability. By linking C/C++ libraries to the Python kernel at run time as binary extensions, users can take advantage of all the functionality in Python while running at compiled speeds. To further enhance the toolkit's capabilities, the authors have built Python binary extensions of the 59 ANSI-C modules that make up version 5 of the Montage toolkit. This involved turning the code into a C library with driver code fully separated to reproduce the calling sequence of command-line tools, then adding Python and C linkage code with Cython library acting as a bridge between general C libraries and the Python interface. The authors demonstrate how these Python binary extensions can be used for various image processing tasks such as reprojecting and resampling images, rectifying background emission to a common level, creating image mosaics that preserve calibration and astrometric fidelity of input images, creating visualizations with an adaptive stretch algorithm, processing HEALPix images, analyzing and managing image metadata. Overall, this paper provides valuable insights into using Montage's powerful image mosaic engine within a Python environment through binary extensions that allow for efficient data processing while retaining full functionality within Python.
