MSUBCUBE(1)

πŸ’– MSUBCUBE πŸ’–

okay so this is the manual page for mSubCube, part of Montage (section 1 of the manual, bestie, iykyk) ✨


πŸŽ€ NAME πŸŽ€

mSubCube β€” literally just creates a subimage of a cube, no cap πŸ’…


✨ SYNOPSIS ✨

mSubCube [-d] [-D3 index-selection-string] [-D4 index-selection-string]
[-a] [-h hdu] [-s statusfile] in.fits out.fits ra dec xsize [ysize]
mSubCube -p [-d] [-D3 index-selection-string] [-D4 index-selection-string]
[-h hdu] [-s statusfile] in.fits out.fits xstartpix ystartpix
xpixsize [ypixsize]

🌸 DESCRIPTION 🌸

It makes a subimage (aka a "cutout", so cute) out of a FITS file πŸ¦‹

The way it works: in "normal" mode, every single parameter β€” both the location and the size β€” is in degrees. But in pixel (-p) mode, all of them are in pixels. That's the whole vibe shift, bestie, don't mix them up 😭


πŸ’… OPTIONS πŸ’…

  • -d β€” turns on debugging πŸ” (chaos mode: enabled)
  • -D3 β€” this argument is a string (quote it if it's got spaces in it, ok?) that defines which subset of indices you want. The string is an ordered set of comma-separated values, and each value is either an index or a range of indices. For instance, "2, 4:46, 58, 101:120" would copy dimension three planes 2, 4 through 46, 58, and 101 through 120 to the output cube. Heads up though: these numbers are indices in a FITS cube, so they're one-offset, not zero. And if you try to go outside the available data, you get an error, periodt. 🚫
  • -D4 β€” same sort of thing as -D3, but for the fourth dimension πŸŒ€
  • -a β€” All pixels β€” forces retrieval of the whole image (super useful if you wanna extract an entire HDU) πŸ‘‘
  • -h hdu β€” operate on the specified FITS header extension (HDU) πŸ—‚οΈ
  • -s statusfile β€” output and errors get sent to statusfile instead of to stdout πŸ“
  • -p β€” Pixel mode β€” creates the subimage using pixel locations instead of a location on the sky πŸŒŒβž‘οΈπŸ”’

🧚 ARGUMENTS 🧚

  • in.fits β€” input FITS file 🫢
  • out.fits β€” path to the output FITS file πŸ’Ύ
  • ra β€” in normal mode, the RA of the center of the output image 🌠
  • dec β€” in normal mode, the declination of the center of the output image 🌠
  • xstartpix β€” in pixel mode, the pixel along the x-axis where the cutout image will begin ➑️
  • ystartpix β€” in pixel mode, the pixel along the y-axis where the cutout image will begin ⬇️
  • xsize β€” in normal mode, the width of the output image in degrees πŸ“
  • ysize β€” in normal mode, the height of the output image in degrees (default is equal to xsize) πŸ“
  • xpixsize β€” in pixel mode, the width of the output image in pixels πŸ”²
  • ypixsize β€” in pixel mode, the height of the output image in pixels (default is equal to xpixsize) πŸ”²

⭐ RESULT ⭐

[struct stat="OK", content="blank, flat or normal"]

The content keyword tells you whether all pixels were NaN (blank), all pixels were the same value (flat), or the image appears to be normal. Vibe check passed or not, basically πŸ’€


😭 MESSAGES 😭

  • OK β€” [struct stat="OK", content="blank, flat or normal"]
  • ERROR β€” HDU value (hdu) must be a non-negative integer
  • ERROR β€” Cannot open status file: statusfile
  • ERROR β€” Center RA string (string) cannot be interpreted as a real number
  • ERROR β€” Center Dec string (string) cannot be interpreted as a real number
  • ERROR β€” X size string (string) cannot be interpreted as a real number
  • ERROR β€” Y size string (string) cannot be interpreted as a real number
  • ERROR β€” Invalid 'x' size
  • ERROR β€” Invalid 'y' size
  • ERROR β€” Image file filename missing or invalid FITS
  • ERROR β€” Cannot find HDU hdu
  • ERROR β€” Output wcsinit() failed.
  • ERROR β€” Location is off image
  • ERROR β€” Region outside image
  • ERROR β€” No pixels match area.
  • ERROR β€” Can't create output file: out.fits
  • ERROR β€” FITS library error

🌈 EXAMPLES 🌈

$ mSubCube image1.fits subimage.fits 307.9 37.29 .01 .01
       [struct stat="OK", content="normal"]

slay πŸ’… it worked


πŸ’€ BUGS πŸ’€

ok so here's the tea, and it's not all pretty:

  • The drizzle algorithm has been implemented but has not been tested in this release πŸ™ˆ (we love an untested feature, no we don't)
  • If a header template contains carriage returns (i.e., it was 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's safer to turn on the "level only" background matching (the "-l" flag in mBgModel). 🫢
fr fr, read the BUGS section before you run this on your precious data. it's giving "trust issues" πŸ”₯

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 lil manual is Montage 5, dated Dec 2016, and it's the MSUBCUBE(1) page β€” go make some iconic cutouts πŸŽ€πŸ¦‹πŸŒΈ