M

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: mOverlaps

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, mOverlaps, which is used to determine the set of overlap areas for a collection of images.

Visit Building a Mosaic with Montage to see how mOverlaps 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 [5]:
from MontagePy.main import mOverlaps, mViewer

help(mOverlaps)
Help on built-in function mOverlaps in module MontagePy.main:

mOverlaps(...)
    mOverlaps takes a list of images (with WCS/corner information) and generates a list of image overlaps.
    
    Parameters
    ----------
    tblfile : str
        Image metadata file.
    difftbl : str
        Output table of overlap areas.
    quickmode : bool, optional
        Use faster but fairly accurate overlap check rather than full geometry calculation.
    debug : int, optional
        Debugging output level.
    
    
    Returns
    -------
    status : int
        Return status (0: OK, 1:ERROR).
    msg : str
        Return message (for errors).
    count : int
        Number of overlaps.

mOverlaps Example

In a test region near M17 we have 48 J-band images. Here we use mOverlaps to determine which of these overlap and by how much.

In [6]:
rtn = mOverlaps("M17/pimages.tbl", "work/M17/diffs.tbl")

print(rtn)
{'status': '0', 'count': 128}

 

Here is the output

In [7]:
import os
import numpy as np
import pandas as pd
from astropy.io import ascii

ipactable = ascii.read('work/M17/diffs.tbl').to_pandas()

ipactable
Out[7]:
cntr1 cntr2 plus minus diff
0 0 8 hdu0_2mass-atlas-990502s-j1330068.fits hdu0_2mass-atlas-990502s-j1320209.fits diff.000000.000008.fits
1 0 9 hdu0_2mass-atlas-990502s-j1330068.fits hdu0_2mass-atlas-990502s-j1320198.fits diff.000000.000009.fits
2 0 13 hdu0_2mass-atlas-990502s-j1330068.fits hdu0_2mass-atlas-990502s-j1340198.fits diff.000000.000013.fits
3 0 14 hdu0_2mass-atlas-990502s-j1330068.fits hdu0_2mass-atlas-990502s-j1340209.fits diff.000000.000014.fits
4 0 21 hdu0_2mass-atlas-990502s-j1330068.fits hdu0_2mass-atlas-990502s-j1330080.fits diff.000000.000021.fits
5 0 24 hdu0_2mass-atlas-990502s-j1330068.fits hdu0_2mass-atlas-990502s-j1330056.fits diff.000000.000024.fits
6 0 29 hdu0_2mass-atlas-990502s-j1330068.fits hdu0_2mass-atlas-001012s-j0140198.fits diff.000000.000029.fits
7 0 31 hdu0_2mass-atlas-990502s-j1330068.fits hdu0_2mass-atlas-001012s-j0140209.fits diff.000000.000031.fits
8 1 6 hdu0_2mass-atlas-990502s-j1430080.fits hdu0_2mass-atlas-990502s-j1440198.fits diff.000001.000006.fits
9 1 11 hdu0_2mass-atlas-990502s-j1430080.fits hdu0_2mass-atlas-990502s-j1420198.fits diff.000001.000011.fits
10 1 20 hdu0_2mass-atlas-990502s-j1430080.fits hdu0_2mass-atlas-990502s-j1430068.fits diff.000001.000020.fits
11 1 27 hdu0_2mass-atlas-990502s-j1430080.fits hdu0_2mass-atlas-990502s-j1430092.fits diff.000001.000027.fits
12 1 34 hdu0_2mass-atlas-990502s-j1430080.fits hdu0_2mass-atlas-990502s-j1440186.fits diff.000001.000034.fits
13 1 41 hdu0_2mass-atlas-990502s-j1430080.fits hdu0_2mass-atlas-990502s-j1420186.fits diff.000001.000041.fits
14 2 5 hdu0_2mass-atlas-990502s-j1450068.fits hdu0_2mass-atlas-990502s-j1440209.fits diff.000002.000005.fits
15 2 6 hdu0_2mass-atlas-990502s-j1450068.fits hdu0_2mass-atlas-990502s-j1440198.fits diff.000002.000006.fits
16 2 18 hdu0_2mass-atlas-990502s-j1450068.fits hdu0_2mass-atlas-990502s-j1450080.fits diff.000002.000018.fits
17 2 25 hdu0_2mass-atlas-990502s-j1450068.fits hdu0_2mass-atlas-990502s-j1460209.fits diff.000002.000025.fits
18 2 26 hdu0_2mass-atlas-990502s-j1450068.fits hdu0_2mass-atlas-990502s-j1460198.fits diff.000002.000026.fits
19 2 28 hdu0_2mass-atlas-990502s-j1450068.fits hdu0_2mass-atlas-990502s-j1450056.fits diff.000002.000028.fits
20 3 11 hdu0_2mass-atlas-990502s-j1350080.fits hdu0_2mass-atlas-990502s-j1420198.fits diff.000003.000011.fits
21 3 13 hdu0_2mass-atlas-990502s-j1350080.fits hdu0_2mass-atlas-990502s-j1340198.fits diff.000003.000013.fits
22 3 17 hdu0_2mass-atlas-990502s-j1350080.fits hdu0_2mass-atlas-990502s-j1350068.fits diff.000003.000017.fits
23 3 23 hdu0_2mass-atlas-990502s-j1350080.fits hdu0_2mass-atlas-990502s-j1350092.fits diff.000003.000023.fits
24 3 38 hdu0_2mass-atlas-990502s-j1350080.fits hdu0_2mass-atlas-990502s-j1340186.fits diff.000003.000038.fits
25 3 41 hdu0_2mass-atlas-990502s-j1350080.fits hdu0_2mass-atlas-990502s-j1420186.fits diff.000003.000041.fits
26 4 15 hdu0_2mass-atlas-990502s-j1460186.fits hdu0_2mass-atlas-990502s-j1470092.fits diff.000004.000015.fits
27 4 18 hdu0_2mass-atlas-990502s-j1460186.fits hdu0_2mass-atlas-990502s-j1450080.fits diff.000004.000018.fits
28 4 19 hdu0_2mass-atlas-990502s-j1460186.fits hdu0_2mass-atlas-990502s-j1460174.fits diff.000004.000019.fits
29 4 26 hdu0_2mass-atlas-990502s-j1460186.fits hdu0_2mass-atlas-990502s-j1460198.fits diff.000004.000026.fits
... ... ... ... ... ...
98 25 37 hdu0_2mass-atlas-990502s-j1460209.fits hdu0_2mass-atlas-990502s-j1470068.fits diff.000025.000037.fits
99 26 37 hdu0_2mass-atlas-990502s-j1460198.fits hdu0_2mass-atlas-990502s-j1470068.fits diff.000026.000037.fits
100 26 42 hdu0_2mass-atlas-990502s-j1460198.fits hdu0_2mass-atlas-990502s-j1470080.fits diff.000026.000042.fits
101 27 33 hdu0_2mass-atlas-990502s-j1430092.fits hdu0_2mass-atlas-990502s-j1430103.fits diff.000027.000033.fits
102 27 34 hdu0_2mass-atlas-990502s-j1430092.fits hdu0_2mass-atlas-990502s-j1440186.fits diff.000027.000034.fits
103 27 35 hdu0_2mass-atlas-990502s-j1430092.fits hdu0_2mass-atlas-990502s-j1420174.fits diff.000027.000035.fits
104 27 41 hdu0_2mass-atlas-990502s-j1430092.fits hdu0_2mass-atlas-990502s-j1420186.fits diff.000027.000041.fits
105 27 43 hdu0_2mass-atlas-990502s-j1430092.fits hdu0_2mass-atlas-990502s-j1440174.fits diff.000027.000043.fits
106 29 30 hdu0_2mass-atlas-001012s-j0140198.fits hdu0_2mass-atlas-990502s-j1320186.fits diff.000029.000030.fits
107 29 31 hdu0_2mass-atlas-001012s-j0140198.fits hdu0_2mass-atlas-001012s-j0140209.fits diff.000029.000031.fits
108 30 44 hdu0_2mass-atlas-990502s-j1320186.fits hdu0_2mass-atlas-990502s-j1320174.fits diff.000030.000044.fits
109 30 45 hdu0_2mass-atlas-990502s-j1320186.fits hdu0_2mass-atlas-990502s-j1330092.fits diff.000030.000045.fits
110 32 35 hdu0_2mass-atlas-990502s-j1350103.fits hdu0_2mass-atlas-990502s-j1420174.fits diff.000032.000035.fits
111 32 36 hdu0_2mass-atlas-990502s-j1350103.fits hdu0_2mass-atlas-990502s-j1340174.fits diff.000032.000036.fits
112 33 35 hdu0_2mass-atlas-990502s-j1430103.fits hdu0_2mass-atlas-990502s-j1420174.fits diff.000033.000035.fits
113 33 43 hdu0_2mass-atlas-990502s-j1430103.fits hdu0_2mass-atlas-990502s-j1440174.fits diff.000033.000043.fits
114 34 43 hdu0_2mass-atlas-990502s-j1440186.fits hdu0_2mass-atlas-990502s-j1440174.fits diff.000034.000043.fits
115 34 47 hdu0_2mass-atlas-990502s-j1440186.fits hdu0_2mass-atlas-990502s-j1450092.fits diff.000034.000047.fits
116 35 41 hdu0_2mass-atlas-990502s-j1420174.fits hdu0_2mass-atlas-990502s-j1420186.fits diff.000035.000041.fits
117 36 38 hdu0_2mass-atlas-990502s-j1340174.fits hdu0_2mass-atlas-990502s-j1340186.fits diff.000036.000038.fits
118 36 39 hdu0_2mass-atlas-990502s-j1340174.fits hdu0_2mass-atlas-990502s-j1330103.fits diff.000036.000039.fits
119 36 45 hdu0_2mass-atlas-990502s-j1340174.fits hdu0_2mass-atlas-990502s-j1330092.fits diff.000036.000045.fits
120 37 42 hdu0_2mass-atlas-990502s-j1470068.fits hdu0_2mass-atlas-990502s-j1470080.fits diff.000037.000042.fits
121 38 45 hdu0_2mass-atlas-990502s-j1340186.fits hdu0_2mass-atlas-990502s-j1330092.fits diff.000038.000045.fits
122 39 44 hdu0_2mass-atlas-990502s-j1330103.fits hdu0_2mass-atlas-990502s-j1320174.fits diff.000039.000044.fits
123 39 45 hdu0_2mass-atlas-990502s-j1330103.fits hdu0_2mass-atlas-990502s-j1330092.fits diff.000039.000045.fits
124 40 43 hdu0_2mass-atlas-990502s-j1450103.fits hdu0_2mass-atlas-990502s-j1440174.fits diff.000040.000043.fits
125 40 47 hdu0_2mass-atlas-990502s-j1450103.fits hdu0_2mass-atlas-990502s-j1450092.fits diff.000040.000047.fits
126 43 47 hdu0_2mass-atlas-990502s-j1440174.fits hdu0_2mass-atlas-990502s-j1450092.fits diff.000043.000047.fits
127 44 45 hdu0_2mass-atlas-990502s-j1320174.fits hdu0_2mass-atlas-990502s-j1330092.fits diff.000044.000045.fits

128 rows × 5 columns

and here is a coverage map illustrating the overlaps:

In [8]:
from IPython.display import Image

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

Image(filename='work/M17/mosaic.png')
Out[8]: