Montage Montage is an astronomical image toolkit with components for reprojection, background matching, coaddition and visualization of FITS files. It can be used as a set of command-line tools (Linux, OS X and Windows), C library calls (Linux and OS X) and as Python binary extension modules.

The Montage source is written in ANSI-C and code can be downloaded from GitHub ( https://github.com/Caltech-IPAC/Montage ). The Python package can be installed from PyPI ("</i>pip install MontagePy"). The package has no external dependencies. See http://montage.ipac.caltech.edu/ for details on the design and applications of Montage.

MontagePy.main modules: mCoverageCheck

The Montage modules are generally used as steps in a workflow to create a mosaic of a set of input images. These steps are: determine the geometry of the mosaic on the sky, reproject the images to a common frame and spatial sampling; rectify the backgrounds to a common level, and coadd the images into a mosaic. This page illustrates the use of one Montage module, mCoverageCheck, which is used to check the overlap between a set of images and a region of interest.

Visit Building a Mosaic with Montage to see how mCoverageCheck is used as part of a workflow to creage a mosaic (or the one shot version if you just want to see the commands). See the complete list of Montage Notebooks here.

In [1]:
from MontagePy.main import mCoverageCheck, mViewer

Help on built-in function mCoverageCheck in module MontagePy.main:

    mCoverageCheck finds the subset of an image list that overlaps a region of interest.
    infile : str
        Table of image metadata.
    outfile : str
        Output table of matching records.
    mode : int, optional
        There are six 'modes' of use, depending on the region to be checked is defined: 0 (POINTS), a set of convex polygon vertices; 1 (BOX), box center and sizes; 2 (CIRCLE), center and radius of a cone on the sky; 3 (POINT), a single point on the sky; 4 (HEADER), a FITS header template (file); and 5 (CUTOUT), like box but uses the full image file WCS and updates the record to indicate what subset of each image overlaps the box.
    hdrfile : str, optional
        FITS header template file; only used by mode 4 (HEADER) above.
    narray : int, optional
        Size of the 'array' of real numbers to use.
    array : np.ndarray, optional
        Array of real numbers.  The size and use depend on mode.  For instance for mode 0 (POINTS) the number is twice the number of vertices in the polygon.
    path : str, optional
        Path to the data files (if we have them and want a double check on WCS info).
    debug : int, optional
        Debugging output level.
    status : int
        Return status (0: OK, 1:ERROR).
    msg : str
        Return message (for errors).
    count : int
        Number of images matching region.


mCoverageCheck Example

The M17 dataset we are using has 48 images.We would like know which of them overlap a 0.20 degree radius circle centered on M17 itself.

In [2]:
rtn = mCoverageCheck('M17/rimages.tbl', 
                     narray=3, array = [275.19629, -16.17153, 0.2], 
{'status': '0', 'count': 8}


Here is a mosaic of the full dataset with the images identified above as overlapping with a 0.3 degree circle centered on M17 outlined:

In [3]:
from IPython.display import Image

rtn = mViewer('-color black -imginfo work/M17/subset.tbl \
               -ct 1 -gray M17/mosaic.fits -2s max gaussian-log \
              -out work/M17/coverage.png', '', mode=2)