.TH MBESTIMAGE 1 "Dec 2016" "Montage 5" "Montage" .SH NAME mBestImage \- Determine which image covers a location "best" .SH SYNOPSIS mBestImage [\-d \fIlevel\fP] images.tbl ra dec .SH DESCRIPTION Given a list of images and a position on the sky, determine which image covers the location "best" (i.e., the one where the position is farthest from the nearest edge). .SH OPTIONS .TP \-d \fIdebug\fP Turn on debugging to the specified level (1 or 2) .SH ARGUMENTS .TP images.tbl Input table of image metadata (as generated by \fBmImgtbl\fP). .TP ra RA of location of interest (in degrees) .TP dec Declination of location of interest (in degrees) .SH RESULT \fB[struct stat="OK", file="\fIfilename\fP", edgedist=\fIdistance\fP] \fIor\fP \fB[struct stat="OK", file="\fIfilename\fP", url="\fIfileurl\fP", edgedist=\fIdistance\fP]\fP\fP .PP where \fIfilename\fP is the name of the "best" image found in \fIimages.tbl\fP and \fIdistance\fP is measured from the point of interest to the nearest edge of the image. If the input table included a URL column, the output message will also include the image's URL. .SH MESSAGES .TP OK [struct stat="OK", file="\fIfilename\fP", url="\fIfileurl\fP", edgedist=\fIdistance\fP"] .TP OK [struct stat="OK", file="\fIfilename\fP", edgedist=\fIdistance\fP"] .TP ERROR Invalid image metadata file: \fIimages.tbl\fP .TP ERROR Need columns: cntr and fname; ctype1 ctype2 nl ns crval1 crval2 crpix1 crpix2 cdelt1 cdelt2 and crota2 or cd matrix / ra dec ra1 ... dec4 .TP ERROR Bad WCS for image \fIfitsfile\fP .TP ERROR No image covers this position. .SH EXAMPLES .PP Given a table of image metadata describing images covering a 0.5 by 0.5 degree area around m31 (\fB2mass_m31_j.tbl\fP), narrow it down to the image which includes the best coverage of one particular location: .TP mBestImage 2mass_m31_j.tbl 10.7 41.2 [struct stat="OK", file="2mass-atlas-971024n-j0080033.fits", edgedist=0.008436] .SH BUGS The drizzle algorithm has been implemented but has not been tested in this release. .PP If a header template contains carriage returns (i.e., created/modified on a Windows machine), the cfitsio library will be unable to read it properly, resulting in the error: [struct stat="ERROR", status=207, msg="illegal character in keyword"] .PP It is 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 is safer to turn on the "level only" background matching (the "\-l" flag in mBgModel. .SH COPYRIGHT 2001-2015 California Institute of Technology, Pasadena, California .PP 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." .PP The Montage distribution includes an adaptation of the MOPEX algorithm developed at the Spitzer Science Center.