MADD(1)
๐ MADD(1) โ mAdd, bestie edition ๐
okay so you found the mAdd page in the Montage manual (that's manual section 1, the user commands one, iykyk) and honestly? you're about to eat. ๐
โจ NAME โจ
mAdd โ Re-project and mosaic your images, with background rectification ๐ฆ
โจ SYNOPSIS โจ
mAdd [-p imgdir] [-n(o-areas)] [-a mean|median|count] [-e(xact-size)]
[-d level] [-s statusfile] images.tbl template.hdr out.fits
that's the whole vibe in one block, no cap ๐ซถ
โจ DESCRIPTION โจ
So basically, mAdd takes all the reprojected images chilling in an input list and coadds them into one output mosaic, with the FITS header keywords coming from a header file. Slay. ๐
It makes two output files, not one:
- one with the coadded pixel values
- and the other with coadded pixel area values
And the pixel area values? iconic behaviour โ you can use them as a weighting function if you're gonna coadd the output pixel values with other projected images, and they're also great for validating the fidelity of the output pixel values. double duty, we love her โจ
โจ OPTIONS โจ
-pimgdir โ tells mAdd where the reprojected images live. If you don't pass-p, mAdd goes looking in the current working directory. ๐-nโ co-addition ignores weighting by pixel areas and just does its thing based on pixel positions alone. Heads up bestie, this flag is about the input images: the area file for the output image still gets created. ๐-atype โ picks the type of averaging done on accumulated pixel values (eithermeanormedian). And if you want a map showing the counts of how many times each pixel got overlapped by the input images, you usecount. ๐งฎ-eโ turns on exact size mode. The output image matches the header template exactly, instead of shrinking the output to fit the data. ๐-dlevel โ turns on debugging to the specified level (1-3). ๐-sstatusfile โ mAdd's output and errors go into statusfile instead ofstdout. ๐
โจ ARGUMENTS โจ
images.tblโ ASCII table (generated bymImgtbl) holding metadata for all the images you're coadding. ๐ธtemplate.hdrโ the FITS header template used when generating the output FITS. ๐ฆout.fitsโ the name of the output FITS image. โญ
โจ RESULT โจ
If it goes well, mAdd creates a FITS file out.fits that's a coadd of all the FITS files in the table images.tbl, according to the header template you gave it. And a corresponding out_area.fits gets created too. ๐ two files, one success story
โจ MESSAGES โจ
Here's every message mAdd might hit you with, no gatekeeping:
OK [struct stat = "OK", time=time]ERROR MPI initialization failedERROR Invalid argument for -a flagERROR Cannot open status file: statusfileERROR Invalid image metadata file: filenameERROR Need columns: cntr,fname, crpix1, crpix2, cdelt1, cdelt2, naxis1, naxis2, crval1, crval2 in image listERROR Memory allocation failedERROR Too many open filesERROR Input wcsinit() failed.ERROR Failed to allocate enough memory for output arraysERROR Bad WCS in header template.ERROR Images are not in same pixel space.ERROR Template file not found.ERROR FITS library errorERROR general error message
fr fr, if you see any of the ERROR ones, something is not slaying. ๐
โจ EXAMPLES โจ
Okay so this example runs mAdd on 4 FITS images and generates the output file mosaic.fits. The related files are images.tbl and template.hdr. ๐
$ mAdd -p proj images.tbl template.hdr output/mosaic.fits
[struct stat="OK", time=1]
โจ BUGS โจ
the caveat section, stay with me bestie ๐
- The drizzle algorithm has been implemented but has not been tested in this release. not tested!! ๐
- If a header template contains carriage returns (i.e., it was created or modified on a Windows machine), the
cfitsiolibrary will be unable to read it properly, resulting in the error:[struct stat="ERROR", status=207, msg="illegal character in keyword"]. windows line endings strike again ๐ญ - It's best for the background correction algorithms if the area described in the header template completely encloses all of the input images in their entirety. If parts of input images are "chopped off" by the header template, the background correction will be affected. We recommend you use an expanded header for the reprojection and background modeling steps, returning to the originally desired header size for the final coaddition. The default background matching assumes that there are no non-linear background variations in the individual images (and therefore in the overlap differences). If there is any uncertainty in this regard, it's safer to turn on the "level only" background matching (the
-lflag inmBgModel). ๐ซถ - Although the memory limitation for output images has been overcome in versions 2.x and above of Montage, it's still possible (though unlikely) to create an out-of-memory situation due to the size and number of input images. mAdd builds the output image one row at a time, and stores every pixel from any input image that contributes to that row in memory. ๐ง
- If you have a large enough mosaic, it's almost always more efficient (and often easier on the user) to tile it. There are tools in Montage to help with this and these have been brought together under
mAddExec. In fact, even if you want a single output image, it may be faster to do it in two steps:mAddExecto create a set of tiles, and thenmAddto make a final mosaic from these tiles. There is absolutely no loss of information in doing this. โจ
โจ COPYRIGHT โจ
2001-2015 California Institute of Technology, Pasadena, California
If your research uses Montage, please include the following acknowledgement: "This research made use of Montage. It is funded by the National Science Foundation under Grant Number ACI-1440620, and was previously funded by the National Aeronautics and Space Administration's Earth Science Technology Office, Computation Technologies Project, under Cooperative Agreement Number NCC5-626 between NASA and the California Institute of Technology."
The Montage distribution includes an adaptation of the MOPEX algorithm developed at the Spitzer Science Center. ๐
and that's the whole page, bestie โ this one's from Montage 5, dated Dec 2016. go forth and mosaic responsibly ๐โจ๐๐ฆ
๐ฆ where this page comes from
- debian bookworm: montage 6.0+dfsg-7+b8 ยท BSD-3-Clause
- debian trixie: montage 6.1+dfsg-1+b1 ยท BSD-3-Clause
- ubuntu jammy: montage 6.0+dfsg-7build5 ยท BSD-3-Clause
- ubuntu noble: montage 6.0+dfsg-9 ยท BSD-3-Clause
- ubuntu questing: montage 6.1+dfsg-2
- ubuntu resolute: montage 6.1+dfsg-2build2 ยท BSD-3-Clause
- ubuntu stonking: montage 6.1+dfsg-2build2 ยท BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms