.TH MPAD 1 "Dec 2016" "Montage 5" "Montage" .SH NAME mPad \- None .SH SYNOPSIS mPad [\-nowcs][\-d \fIlevel\fP][\-val \fINaN-value\fP][\-bar \fIxmin xmax ymin ymax histfile\fP] in.fits out.fits left right top bottom .SH DESCRIPTION Occasionally we want to pad the border of an image so that there is room for annotation, a color bar, or just for visual effect. mPad does this and if a color bar is desired it adds one (wherever the user specifies, which might be in the pad or might be over the image). The pad around the edges is filled with NULLS (which will be rendered the same as the minimum in the color table but mJPEG/mViewer). However the user can optionally have NULLs translated to another value with the "\-val" argument. .SH OPTIONS .TP \-nowcs If the image has WCS values in the header, these need to be adjusted to compensate for the padding. This flag is used to tell the software that the image does not contain WCS keywords so not to try. .TP \-d \fIlevel\fP Set debugging level (default none) .TP \-val \fINaN-value\fP Value to which NULL pixels should be converted. .TP \-bar \fIxmin xmax ymin ymax histfile\fP Adding a color bar as part of the image is a little trickier than it might at first seem. A color bar is a rectangular region of pixels whose data values are set so that it gives the impression of the lookup-table used to render the image. To do this, we need the image histogram that mViewer (or whatever renderer) would use when displaying the data. The easiest way to do this is to 1) use mHistogram to generate the stretchl 2) use mPad to add the pixel array (usually in a pad added around the outside of the image(; and 3) use mViewer with the same pre-build histogram to render the image. .SH ARGUMENTS .TP in.fits Original FITS image. .TP out.fits Padded FITS image. .TP left right top bottom Number of pixels with which to pad the four sides of the image. .SH RESULT If successful, the result is a new image almost identical to the original but padded around the edges and possibly containing an embedded color bar. When sent to mViewer, that tool can optionally add annotation to the bar. .SH MESSAGES .TP ERROR No debug level given .TP ERROR Debug level string is invalid: '\fIbadstring\fP' .TP ERROR Debug level value cannot be negative .TP ERROR Not enough information given to draw color bar .TP ERROR Bar X min string is invalid: '\fIbadstring\fP' .TP ERROR Bar X max string is invalid: '\fIbadstring\fP' .TP ERROR Bar Y min string is invalid: '\fIbadstring\fP' .TP ERROR Bar Y max string is invalid: '\fIbadstring\fP' .TP ERROR Cannot open histogram file \fIbadfile\fP .TP ERROR No value given for NaN conversion .TP ERROR NaN conversion value string is invalid: '\fIbadstring\fP' .TP ERROR \fIFITS library error\fP .TP ERROR \fIgeneral error message\fP .SH EXAMPLES .TP (mHistogram \-file SDSS_r.fits \-2s max gaussian-log \-out SDSS_r.hist) mPad \-bar \-100 \-50 50 \-50 SDSS_r.hist SDSS_r.fits sdss.fits 50 250 50 50 [struct stat="OK"] .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.