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

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, mArchiveList, which is used to search for images from a given archive in a region of the sky.

Visit Building a Mosaic with Montage to see how mArchiveList 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 mArchiveList

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

mArchiveList(...)
    mArchiveList retrieves a list of images (and download URLs) from the Montage metadata service based on archive/band/location/size.
    
    Parameters
    ----------
    survey : str
        Survey (2MASS, SDSS, WISE, etc.
    band : str
        Wavelength band (e.g. J for 2MASS).
    locstr : str
        A (quoted if necessary) string containing a coordinate or the name of an object on the sky.
    width : float
        Region width in degrees.
    height : float
        Region height in degrees.
    outfile : str
        Output table file.
    debug : int, optional
        Debugging output flag.
    
    
    Returns
    -------
    status : int
        Return status (0: OK, 1:ERROR).
    msg : str
        Return message (for errors).
    count : int
        Number of images in list.

mArchiveList Example

mArchiveList can be used to retrieve a list of images overlapping a region on the sky for the following missions: 2MASS, SDSS, WISE and DSS. These were chosen because they are all-sky or at least very large contiguous areas of the sky. This list contains some metadata describing the image coverage, a URL to retrieve the image, and a suggested name for a local file name to use on download.

The following call retrieves a list of 2MASS J-band images for a 0.5 degree region around M17. NOTE: Not all archive metadata searches are equally good about matching the sky coverage you intend. We find it best to ask for metadata for a larger area than you need, then narrow the list down using the header for the region you want and mCoverageCheck.

In [2]:
rtn = mArchiveList('2MASS', 'J', 'M17', 2., 2., 'work/M17/archive.tbl')
 
print(rtn)
{'status': '0', 'count': 418}

Montage modules return JSON structures. They always include a status (0: success; 1: error) and a variable number of informational parameters. Here it shows the count for the returned list of images.

Archive List Data

The returned table is in IPAC ASCII format, the default for Montage. You can read it into a Pandas dataframe with AstroPy. Here we extract the URL used to download each data file and the local file name.

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

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

ipactable
Out[3]:
cntr ctype1 ctype2 naxis1 naxis2 crval1 crval2 crpix1 crpix2 cdelt1 ... ra1 dec1 ra2 dec2 ra3 dec3 ra4 dec4 URL file
0 126520 RA---SIN DEC--SIN 512 1024 274.255734 -15.978760 256.5 512.5 -0.000278 ... 274.329764 -16.120966 274.181720 -16.120974 274.181810 -15.836529 274.329643 -15.836521 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1290092.fits
1 337546 RA---SIN DEC--SIN 512 1024 274.874918 -16.033347 256.5 512.5 -0.000278 ... 274.948972 -16.175551 274.800888 -16.175563 274.800969 -15.891118 274.948843 -15.891106 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1340186.fits
2 339263 RA---SIN DEC--SIN 512 1024 274.380120 -15.764745 256.5 512.5 -0.000278 ... 274.454074 -15.906950 274.306188 -15.906960 274.306270 -15.622515 274.453948 -15.622505 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1300174.fits
3 380802 RA---SIN DEC--SIN 512 1024 274.874872 -15.494458 256.5 512.5 -0.000278 ... 274.948728 -15.636662 274.801040 -15.636674 274.801118 -15.352229 274.948603 -15.352218 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1340162.fits
4 427643 RA---SIN DEC--SIN 512 1024 274.131910 -15.226637 256.5 512.5 -0.000278 ... 274.205651 -15.368851 274.058155 -15.368844 274.058268 -15.084399 274.205566 -15.084406 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-001012s-j0150150.fits
5 166739 RA---SIN DEC--SIN 512 1024 275.628041 -15.225215 256.5 512.5 -0.000278 ... 275.701808 -15.367416 275.554312 -15.367435 275.554374 -15.082990 275.701670 -15.082971 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1460150.fits
6 376169 RA---SIN DEC--SIN 512 1024 275.494407 -15.439468 256.5 512.5 -0.000278 ... 275.568246 -15.581671 275.420597 -15.581685 275.420669 -15.297240 275.568116 -15.297226 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1450115.fits
7 438609 RA---SIN DEC--SIN 512 1024 276.116557 -14.630347 256.5 512.5 -0.000278 ... 276.190128 -14.772544 276.043043 -14.772572 276.043082 -14.488127 276.189975 -14.488099 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990811s-j0180151.fits
8 444462 RA---SIN DEC--SIN 512 1024 276.486912 -14.686031 256.5 512.5 -0.000278 ... 276.560478 -14.828240 276.413356 -14.828244 276.413442 -14.543799 276.560372 -14.543795 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000805s-j0210127.fits
9 125562 RA---SIN DEC--SIN 512 1024 274.503528 -14.630843 256.5 512.5 -0.000278 ... 274.577097 -14.773041 274.430013 -14.773067 274.430054 -14.488622 274.576948 -14.488596 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1310151.fits
10 126301 RA---SIN DEC--SIN 512 1024 274.255663 -14.631538 256.5 512.5 -0.000278 ... 274.329213 -14.773745 274.182128 -14.773753 274.182208 -14.489308 274.329103 -14.489300 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1290151.fits
11 317731 RA---SIN DEC--SIN 512 1024 274.380079 -15.225856 256.5 512.5 -0.000278 ... 274.453838 -15.368061 274.306342 -15.368072 274.306419 -15.083627 274.453717 -15.083616 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1300150.fits
12 475064 RA---SIN DEC--SIN 512 1024 273.884372 -15.493839 256.5 512.5 -0.000278 ... 273.958230 -15.636042 273.810542 -15.636056 273.810615 -15.351611 273.958100 -15.351598 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1200162.fits
13 35367 RA---SIN DEC--SIN 512 1024 274.875054 -17.650014 256.5 512.5 -0.000278 ... 274.949749 -17.792217 274.800383 -17.792228 274.800477 -17.507783 274.949607 -17.507772 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1340257.fits
14 46712 RA---SIN DEC--SIN 512 1024 274.131830 -16.843304 256.5 512.5 -0.000278 ... 274.206178 -16.985516 274.057468 -16.985510 274.057594 -16.701065 274.206080 -16.701072 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-001012s-j0150221.fits
15 102749 RA---SIN DEC--SIN 512 1024 274.628113 -16.574205 256.5 512.5 -0.000278 ... 274.702358 -16.716417 274.553860 -16.716412 274.553978 -16.431967 274.702257 -16.431971 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-001012s-j0140209.fits
16 142243 RA---SIN DEC--SIN 512 1024 274.131857 -16.304415 256.5 512.5 -0.000278 ... 274.205995 -16.446628 274.057705 -16.446621 274.057827 -16.162176 274.205901 -16.162183 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-001012s-j0150198.fits
17 240176 RA---SIN DEC--SIN 512 1024 274.255778 -16.787094 256.5 512.5 -0.000278 ... 274.330118 -16.929299 274.181453 -16.929307 274.181549 -16.644862 274.329992 -16.644855 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1290056.fits
18 467640 RA---SIN DEC--SIN 512 1024 274.503939 -16.786399 256.5 512.5 -0.000278 ... 274.578299 -16.928595 274.429634 -16.928621 274.429691 -16.644176 274.578132 -16.644150 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1310056.fits
19 92815 RA---SIN DEC--SIN 512 1024 273.884453 -16.302173 256.5 512.5 -0.000278 ... 273.958611 -16.444376 273.810323 -16.444389 273.810402 -16.159945 273.958475 -16.159931 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1200198.fits
20 8078 RA---SIN DEC--SIN 512 1024 275.752651 -17.055251 256.5 512.5 -0.000278 ... 275.827107 -17.197452 275.678228 -17.197468 275.678308 -16.913023 275.826960 -16.913007 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1470044.fits
21 18095 RA---SIN DEC--SIN 512 1024 275.123069 -17.112820 256.5 512.5 -0.000278 ... 275.197550 -17.255020 275.048625 -17.255038 275.048702 -16.970593 275.197400 -16.970575 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1420233.fits
22 150111 RA---SIN DEC--SIN 512 1024 274.874986 -16.841681 256.5 512.5 -0.000278 ... 274.949352 -16.983884 274.800644 -16.983896 274.800732 -16.699451 274.949216 -16.699439 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1340221.fits
23 172667 RA---SIN DEC--SIN 512 1024 275.123138 -17.651709 256.5 512.5 -0.000278 ... 275.197840 -17.793909 275.048472 -17.793926 275.048554 -17.509481 275.197686 -17.509464 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1420257.fits
24 243416 RA---SIN DEC--SIN 512 1024 276.611995 -17.593885 256.5 512.5 -0.000278 ... 276.686674 -17.736084 276.537354 -17.736103 276.537434 -17.451658 276.686518 -17.451639 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990811s-j0280021.fits
25 333119 RA---SIN DEC--SIN 512 1024 276.115750 -17.651788 256.5 512.5 -0.000278 ... 276.190426 -17.794000 276.041058 -17.793992 276.041192 -17.509548 276.190324 -17.509556 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000928s-j0140257.fits
26 49474 RA---SIN DEC--SIN 512 1024 275.123035 -16.843376 256.5 512.5 -0.000278 ... 275.197408 -16.985576 275.048699 -16.985594 275.048774 -16.701149 275.197260 -16.701131 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1420221.fits
27 70491 RA---SIN DEC--SIN 512 1024 276.239515 -16.518157 256.5 512.5 -0.000278 ... 276.313738 -16.660369 276.165283 -16.660364 276.165401 -16.375919 276.313637 -16.375923 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000928s-j0150068.fits
28 112312 RA---SIN DEC--SIN 512 1024 276.363813 -16.785530 256.5 512.5 -0.000278 ... 276.438172 -16.927726 276.289509 -16.927752 276.289565 -16.643307 276.438006 -16.643281 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990811s-j0200056.fits
29 287402 RA---SIN DEC--SIN 512 1024 275.122966 -16.304487 256.5 512.5 -0.000278 ... 275.197129 -16.446688 275.048839 -16.446705 275.048911 -16.162260 275.196985 -16.162243 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1420198.fits
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
388 4136257 RA---SIN DEC--SIN 512 1024 276.611602 -14.629996 256.5 512.5 -0.000278 ... 276.685162 -14.772198 276.538079 -14.772216 276.538137 -14.487771 276.685030 -14.487753 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990811s-j0280151.fits
389 4138940 RA---SIN DEC--SIN 512 1024 276.363405 -14.629974 256.5 512.5 -0.000278 ... 276.436974 -14.772172 276.289890 -14.772198 276.289932 -14.487753 276.436825 -14.487727 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990811s-j0200151.fits
390 3460976 RA---SIN DEC--SIN 512 1024 276.116773 -15.708125 256.5 512.5 -0.000278 ... 276.190723 -15.850321 276.042880 -15.850349 276.042926 -15.565904 276.190563 -15.565876 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990811s-j0180103.fits
391 3721893 RA---SIN DEC--SIN 512 1024 276.487426 -15.494486 256.5 512.5 -0.000278 ... 276.561285 -15.636689 276.413596 -15.636703 276.413669 -15.352258 276.561154 -15.352244 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990811s-j0210162.fits
392 4362712 RA---SIN DEC--SIN 512 1024 275.992233 -15.764831 256.5 512.5 -0.000278 ... 276.066188 -15.907035 275.918302 -15.907047 275.918382 -15.622602 276.066060 -15.622590 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000727s-j0190174.fits
393 4808915 RA---SIN DEC--SIN 512 1024 276.487453 -15.763931 256.5 512.5 -0.000278 ... 276.561410 -15.906134 276.413525 -15.906148 276.413600 -15.621703 276.561277 -15.621689 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990811s-j0210174.fits
394 2791348 RA---SIN DEC--SIN 512 1024 276.115814 -16.574010 256.5 512.5 -0.000278 ... 276.190054 -16.716223 276.041557 -16.716215 276.041683 -16.431770 276.189961 -16.431778 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000928s-j0140209.fits
395 3251799 RA---SIN DEC--SIN 512 1024 275.992325 -16.842609 256.5 512.5 -0.000278 ... 276.066692 -16.984812 275.917983 -16.984824 275.918070 -16.700379 276.066555 -16.700367 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000727s-j0190221.fits
396 3375566 RA---SIN DEC--SIN 512 1024 276.487564 -16.841709 256.5 512.5 -0.000278 ... 276.561933 -16.983911 276.413225 -16.983925 276.413307 -16.699480 276.561792 -16.699466 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990811s-j0210221.fits
397 3495506 RA---SIN DEC--SIN 512 1024 276.611886 -16.785552 256.5 512.5 -0.000278 ... 276.686237 -16.927752 276.537573 -16.927770 276.537646 -16.643325 276.686088 -16.643307 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990811s-j0280056.fits
398 4416330 RA---SIN DEC--SIN 512 1024 276.362645 -16.786731 256.5 512.5 -0.000278 ... 276.436974 -16.928942 276.288309 -16.928939 276.288428 -16.644493 276.436870 -16.644497 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000805s-j0200056.fits
399 4465996 RA---SIN DEC--SIN 512 1024 276.240939 -16.842092 256.5 512.5 -0.000278 ... 276.315305 -16.984296 276.166596 -16.984307 276.166685 -16.699862 276.315170 -16.699851 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000727s-j0210221.fits
400 2961809 RA---SIN DEC--SIN 512 1024 276.115782 -17.112899 256.5 512.5 -0.000278 ... 276.190236 -17.255112 276.041311 -17.255104 276.041442 -16.970659 276.190139 -16.970667 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000928s-j0140233.fits
401 3520557 RA---SIN DEC--SIN 512 1024 276.116619 -17.055576 256.5 512.5 -0.000278 ... 276.191059 -17.197785 276.042180 -17.197785 276.042293 -16.913340 276.190945 -16.913340 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000727s-j0200044.fits
402 3917499 RA---SIN DEC--SIN 512 1024 276.240143 -17.111446 256.5 512.5 -0.000278 ... 276.314605 -17.253655 276.165681 -17.253655 276.165795 -16.969210 276.314491 -16.969210 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990811s-j0190233.fits
403 3948128 RA---SIN DEC--SIN 512 1024 276.486996 -17.111031 256.5 512.5 -0.000278 ... 276.561463 -17.253238 276.412539 -17.253242 276.412643 -16.968797 276.561339 -16.968792 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000805s-j0210233.fits
404 4646158 RA---SIN DEC--SIN 512 1024 276.239498 -17.057046 256.5 512.5 -0.000278 ... 276.313934 -17.199257 276.165054 -17.199253 276.165176 -16.914808 276.313829 -16.914812 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000928s-j0150044.fits
405 3373608 RA---SIN DEC--SIN 512 1024 276.487015 -17.649920 256.5 512.5 -0.000278 ... 276.561703 -17.792126 276.412337 -17.792131 276.412445 -17.507686 276.561575 -17.507681 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000805s-j0210257.fits
406 2947753 RA---SIN DEC--SIN 512 1024 276.115766 -17.382343 256.5 512.5 -0.000278 ... 276.190330 -17.524556 276.041185 -17.524548 276.041318 -17.240103 276.190231 -17.240111 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000928s-j0140245.fits
407 3601007 RA---SIN DEC--SIN 512 1024 276.239490 -17.326491 256.5 512.5 -0.000278 ... 276.314035 -17.468702 276.164936 -17.468698 276.165060 -17.184253 276.313928 -17.184257 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000928s-j0150033.fits
408 4129208 RA---SIN DEC--SIN 512 1024 276.116620 -17.594465 256.5 512.5 -0.000278 ... 276.191280 -17.736673 276.041960 -17.736674 276.042077 -17.452229 276.191162 -17.452228 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000727s-j0200021.fits
409 4707015 RA---SIN DEC--SIN 512 1024 276.487006 -17.380475 256.5 512.5 -0.000278 ... 276.561582 -17.522681 276.412440 -17.522686 276.412545 -17.238241 276.561457 -17.238236 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000805s-j0210245.fits
410 4725409 RA---SIN DEC--SIN 512 1024 276.362631 -17.325620 256.5 512.5 -0.000278 ... 276.437176 -17.467830 276.288078 -17.467827 276.288201 -17.183382 276.437068 -17.183385 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-000805s-j0200033.fits
411 4301207 RA---SIN DEC--SIN 512 1024 273.884426 -16.032728 256.5 512.5 -0.000278 ... 273.958482 -16.174931 273.810398 -16.174945 273.810475 -15.890500 273.958348 -15.890486 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1200186.fits
412 4387828 RA---SIN DEC--SIN 512 1024 273.760326 -15.707336 256.5 512.5 -0.000278 ... 273.834266 -15.849537 273.686423 -15.849555 273.686489 -15.565110 273.834126 -15.565092 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1190103.fits
413 4781559 RA---SIN DEC--SIN 512 1024 274.008224 -15.976942 256.5 512.5 -0.000278 ... 274.082268 -16.119141 273.934226 -16.119163 273.934285 -15.834718 274.082117 -15.834696 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1210092.fits
414 4642570 RA---SIN DEC--SIN 512 1024 273.884346 -15.224395 256.5 512.5 -0.000278 ... 273.958108 -15.366599 273.810612 -15.366612 273.810684 -15.082167 273.957980 -15.082154 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1200150.fits
415 4732578 RA---SIN DEC--SIN 512 1024 274.008397 -17.054720 256.5 512.5 -0.000278 ... 274.082859 -17.196918 273.933981 -17.196940 273.934048 -16.912495 274.082700 -16.912473 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1210044.fits
416 2678665 RA---SIN DEC--SIN 512 1024 274.627372 -16.303121 256.5 512.5 -0.000278 ... 274.701522 -16.445328 274.553233 -16.445333 274.553330 -16.160888 274.701404 -16.160883 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1320198.fits
417 2680438 RA---SIN DEC--SIN 512 1024 274.132013 -16.572023 256.5 512.5 -0.000278 ... 274.206269 -16.714229 274.057773 -16.714236 274.057867 -16.429791 274.206144 -16.429784 http://irsa.ipac.caltech.edu/ibe/data/twomass/... 2mass-atlas-990502s-j1220209.fits

418 rows × 23 columns

mArchiveList Error Handling

If mArchiveList encounters an error, the return structure will just have two elements: a status of 1 ("error") and a message string that tries to diagnose the reason for the error.

For instance, if the user asks for an unsupported dataset:

In [4]:
rtn = mArchiveList('OtherMission', 'A', 'M51', 0.5, 0.5, 'remote.tbl')

print(rtn)
{'status': '1', 'msg': b'Invalid survey name: OTHERMISSION A'}

 

Classic Montage: mArchiveList as a Stand-Alone Program

Unix/Windows Command-line Arguments

mArchiveList can also be run as a command-line tool in Linux, OS X, and Windows:

Usage: mArchiveList [-d] survey band object|location width height outfile (object/location must be a single argument string)

 

mArchiveList as a Library Call

If you are writing in C/C++ on Linux or OSX, mArchiveList can be accessed as a library function:

/*-***********************************************************************/
/*                                                                       */
/* mArchiveList -- Given a location on the sky, archive name, and size   */
/* in degrees contact the IRSA server to retreive a list of archive      */
/* images.  The list contains enough information to support mArchiveGet  */
/* downloads.                                                            */
/*                                                                       */
/*   char  *survey         Data survey to search (e.g. 2MASS, SDSS,      */
/*                         WISE, etc.)                                   */
/*                                                                       */
/*   char  *band           Wavelength band (e.g. J for 2MASS, g for      */
/*                         SDSS)                                         */
/*                                                                       */
/*   char  *locstr         A (quoted if necessary) string containing     */
/*                         a coordinate or the name of an object on      */
/*                         the sky                                       */
/*                                                                       */
/*   double width          Image width in degrees                        */
/*   double height         Image height in degrees                       */
/*                                                                       */
/*   char  *outfile        Output FITS header file                       */
/*                                                                       */
/*   int    debug          Debugging output flag                         */
/*                                                                       */
/*************************************************************************/


struct mArchiveListReturn *mArchiveList(char *survey, char *band, char *location,  
                                        double width, double height,
                                        char *outfile, int debug)

Return Structure

struct mArchiveListReturn
{
   int    status;        // Return status (0: OK, 1:ERROR)
   char   msg [1024];    // Return message (for error return)
   char   json[4096];    // Return parameters as JSON string
   int    count;         // Number of lines in output file.
};