MPROJECTPP(1)

πŸ’– MPROJECTPP πŸ’–

okay bestie, welcome to the Montage manual, section 1 β€” yes this is MPROJECTPP(1), the reprojection girlie of the family. buckle up πŸŽ€


✨ NAME ✨

mProjectPP β€” re-project FITS images. that's it, that's the job. slay.


✨ SYNOPSIS ✨

mProjectPP [-z factor] [-d level] [-b border] [-s statusfile] [-o
altout.hdr] [-i altin.hdr] [-h hdu] [-x scale] [-w weightfile] [-W
fixed-weight] [-t threshold] [-X] [-b border-string] in.fits out.fits
template.hdr

like... look at all those flags. she's flexible πŸ’…


✨ DESCRIPTION ✨

so mProjectPP takes ONE image and reprojects it onto the scale that's defined in an alternate FITS header template β€” and that template is usually made by mTANhdr. she gives you a pair of images back: the reprojected image, and an "area" image. that area image is literally the fraction of input pixel sky area that landed in each output pixel 🫢. and here's the cute part: that area image goes through all the same subsequent processing as the reprojected image does, so it can be properly coadded at the end. no cap.

mProjectPP does a plane-to-plane transform on the input image. it's an adaptation of the Mopex algorithm, developed in collaboration with the Spitzer Space Telescope, and it is approximately 30Γ— faster than the general-purpose mProject. obsessed. BUT β€” and this is a big but β€” mProjectPP is only suitable for projections that can be approximated by tangent-plane projections (TAN, SIN, ZEA, STG, ARC), which means it is NOT suited for images covering large portions of the sky. also note she does not directly support changes in coordinate system (like equatorial β†’ galactic), though you can facilitate those changes by using an alternate header. iykyk πŸ’œ


🚨 one situation that has happened often enough to warrant special note 🚨

it is possible to define a FITS header with the reference location off the image. in particular, people often reference cylindrical projections (e.g., CAR, CEA) to location (0.,0.) (e.g., the Galactic center). this is not wrong in itself, but it does lead to extremely large pixel offsets (like, in the hundreds of thousands 😭). related to this: if you extract a header from an image with large offsets of this type, it is unlikely that you can simply change projection types without also adjusting the reference location/offsets. most likely you will end up with the reproject data all being off-scale. periodt. πŸ’€


✨ OPTIONS ✨

  • -z factor β€” processing is done utilizing the drizzle algorithm. factor is a floating point number; recommended drizzle factors are from 0.5 to 1. 🌧️
  • -d level β€” causes additional debugging information to be printed to stdout. valid levels are 1-5; for levels greater than 1, it's recommended to redirect the output into a text file. (fr fr, redirect it.)
  • -b border β€” ignores border pixels around the image edge when performing calculations. πŸ–ΌοΈ
  • -s statusfile β€” output and errors are written to statusfile instead of being written to stdout.
  • -[i|o] alternate.hdr β€” specifies an alternate FITS header for use in mProjectPP calculations; allows substitution of psuedo-TAN headers created by mTANhdr. (yes, "psuedo". we keep the typo, it's iconic ✨)
  • -h hdu β€” specify the FITS extension to re-project if the FITS image is multi-extension.
  • -x scale β€” multiple the pixel values by scale when reprojecting. for instance, each 2MASS image has a different scale factor (very near 1.0) to correct for varying magnitude-zero points.
  • -w weightfile β€” path to a weight map to be used when reading values from the input image.
  • -W fixed-weight β€” use constant weight value for the whole image.
  • -t threshold β€” pixels with weights below threshold will be treated as blank.
  • -X β€” makes the output region (originally defined in the header template) big enough to include all of the input images. main character energy, honestly πŸ‘‘
  • -b border-string β€” define a border width or border pixel corners outside of which all pixels are set to NaN. (yes there are two -bs. we don't make the rules, we just report them πŸ’…)

✨ ARGUMENTS ✨

  • in.fits β€” input FITS file to be reprojected.
  • out.fits β€” path to output FITS file to be created.
  • template.hdr β€” FITS header template to be used in generation of output FITS

✨ RESULT ✨

two files are created as output, bestie: the reprojected FITS file (out.fits), and an "area" image (out_area.fits). see the image reprojection algorithm for more information. πŸ¦‹


✨ MESSAGES ✨

here's everything she might yell at you. read them, love them.

  • OK [struct stat="OK", time=seconds]
  • ERROR Drizzle factor string (string) cannot be interpreted as a real number
  • ERROR Cannot open status file: statusfile
  • ERROR Weight threshold string (threshold) cannot be interpreted as a real number
  • ERROR Flux scale string (scale) cannot be interpreted as a real number
  • ERROR Border value string (string) cannot be interprted as an integer or a set of polygon vertices
  • ERROR Border value (value) must be greater than or equal to zero
  • ERROR HDU value (hdu) must be a non-negative integer
  • ERROR Could not set up plane-to-plane transform. Check for compliant headers.
  • ERROR No overlap
  • ERROR Not enough memory for output data image array
  • ERROR Not enough memory for output area image array
  • ERROR Output wcsinit() failed.
  • ERROR Input wcsinit() failed.
  • ERROR Input and output must be in the same coordinate system for fast reprojection
  • ERROR All pixels are blank
  • ERROR Input image projection (projection) must be TAN, SIN, ZEA, STG or ARC for fast reprojection
  • ERROR Output image projection (projection) must be TAN, SIN, ZEA, STG or ARC for fast reprojection
  • ERROR Template file [template.hdr] not found
  • ERROR Image file in.fits is missing or invalid FITS
  • ERROR Weight file weightfile is missing or invalid FITS
  • ERROR FITS library error

✨ EXAMPLES ✨

look at her go πŸŽ€

$ mProjectPP rawdir/real_orig.fits projdir/base_unity.fits
templates/galactic_orig.txt
       [struct stat="OK", time=14]

✨ BUGS ✨

the drizzle algorithm has been implemented but has not been tested in this release. πŸ’€

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"]

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).

mProjectPP is only suitable for use on projections which can be approximated by tangent-plane projections (TAN, SIN, ZEA, STG, ARC), and is therefore not suited for images covering large portions of the sky. also note that it does not directly support changes in coordinate system (i.e. equatorial to galactic coordinates), though these changes can be facilitated by the use of an alternate header.


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. 🌈


okay that's the whole page bestie, no skips, no summaries, every single flag accounted for πŸ’– this was Montage 5, dated Dec 2016, and honestly? iconic. go reproject something. mwah 🫢✨