MCOVERAGECHECK(1)

πŸ’« MCOVERAGECHECK πŸ’« β€” a Montage manual page, bestie edition

okay so this is mCoverageCheck(1) from Montage 5, and no cap, it's lowkey one of the most useful little tools in the whole suite. let's get into it 🫢


✨ NAME ✨

mCoverageCheck β€” filter an image metadata table down to only the records that represent FITS files overlapping a footprint on the sky πŸ¦‹

like... it looks at your table, it looks at your sky region, and it goes "these ones. only these ones. periodt."


🌸 SYNOPSIS 🌸

mCoverageCheck [-s statusfile] in.tbl out.tbl -mode <parameters>

that's the whole vibe. one command, one table in, one table out, one region mode. πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

so here's the tea, bestie: mCoverageCheck subsets an image metadata table (the kind stuffed with FITS/WCS info, or with image corners) by figuring out which records in that table represent images that overlap a region definition β€” and that region can be a box or a circle in the sky β€” which you hand it right there on the command line. πŸ‘‘

it's giving "who's actually in this neighborhood" energy and honestly? iconic.


✨ OPTIONS ✨

  • -s statusfile β€” output and errors get sent to statusfile instead of to stdout. so if you don't want the chatter in your terminal, you send it elsewhere. very demure, very mindful. πŸ™ˆ
  • -mode β€” can be one of:
    • points β€” used to describe a convex polygon πŸ¦‹
    • box β€” a box on the sky 🎁
    • circle β€” a circle on the sky β­•
    • header β€” the area is described in a header file πŸ“„
    • point β€” find images that overlap one particular point on the sky πŸ“
    • cutout β€” operates like box mode, but returns metadata that represents what the input images would look like after being subset to exactly match the cutout area βœ‚οΈ
  • in.tbl β€” the input metadata table. your raw material. your source of truth. πŸ’–
  • out.tbl β€” the output metadata table, which will contain the subset of in.tbl. the chosen ones. the main characters. 🌟
  • parameters β€” depends on mode, as follows:
    • points: ra1 dec1 ra2 dec2 ... raN decN (must be at least 3 vertices) πŸ”Ί
    • box: ra dec xsize [ysize [rotation]]

where ra, dec is the center of the box, and size is in degrees. πŸ“

  • circle: ra dec radius

where ra, dec is the center of the circle, and radius is in degrees (default is 0, in which case it's treated like a point search). 🍩

  • point: ra dec 🎯
  • header: region.hdr (path to an ASCII header template that defines the region of interest) πŸ“
  • cutout: ra dec xsize [ysize]

where ra, dec is the center of the cutout area, and size is in degrees. βœ‚οΈ


🌈 RESULT 🌈

the output file out.tbl gets created, with nimages records. that's it, that's the payoff, and it ate. πŸ’…


πŸ’œ MESSAGES πŸ’œ

here's every message this thing can throw at you, fr fr. some are happy, some are... not. 😭

  • OK [struct stat="OK", count=n] ✨
  • ERROR Cannot open status file: statusfile
  • ERROR Invalid region definition mode: string
  • ERROR Too few vertices for region (must be at least three)
  • ERROR Longitude n (string) cannot be interpreted as a real number
  • ERROR Latitude n (string) cannot be interpreted as a real number
  • ERROR Failed to find bounding polygon for points
  • ERROR Too few arguments for box or cutout (must at least have center and size)
  • 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 box size string (string) cannot be interpreted as a real number
  • ERROR X box size (string) must be a positive number
  • ERROR Y box size string (string) cannot be interpreted as a real number
  • ERROR Y box size (string) must be a positive number
  • ERROR Box rotation string (string) cannot be interpreted as a real number
  • ERROR Must give header file name
  • ERROR Failed to find bounding polygon for points
  • ERROR Too few arguments for circle (must at least have center)
  • ERROR Circle radius string (string) cannot be interpreted as a real number
  • ERROR Too few arguments for point (must have coordinates)
  • ERROR Point RA string (string) cannot be interpreted as a real number
  • ERROR Point Dec string (string) cannot be interpreted as a real number
  • ERROR Error opening table filename
  • ERROR Cannot create output file filename
  • ERROR Need either WCS or corner columns.
  • ERROR Failed to create wcs structure for record n
yes, Failed to find bounding polygon for points really is listed twice in the original. i'm not deleting it, i'm not merging it, i'm just telling you it's there twice. that's canon. πŸ’€

πŸ”₯ EXAMPLES πŸ”₯

okay bestie, storytime. as input, we use this table of 2MASS atlas images. the images in this table are in two "clumps" on the sky: 3 overlapping images separated by several degrees from the other 12 overlapping images. and here we're gonna show you several ways of isolating the group of 3 images. 🧚

$ mCoverageCheck images.tbl circle.tbl -circle 262.78208 -35.03049 1.0
       [struct stat="OK", count="3"]
$ mCoverageCheck images.tbl box.tbl -box 262.84948 -34.81197 1.0
       [struct stat="OK", count="3"]
$ mCoverageCheck images.tbl points.tbl -points 263.3796 -34.48881
262.15127 -34.51032 262.90267 -35.38753
       [struct stat="OK", count="3"]
$ mCoverageCheck images.tbl point.tbl -point 262.78208 -35.03049
       [struct stat="OK", count="3"]

each of these methods results in this output table containing only 3 records out of the original 15. slay. πŸ‘‘


πŸ¦‹ BUGS πŸ¦‹

gonna keep it real with you, these are the rough edges:

  • the drizzle algorithm has been implemented but has not been tested in this release. (yes really. it's just... sitting there.) πŸ™ˆ
  • 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). ⚠️
that last one is a real "read it twice" situation, bestie. expanded header for reprojection + background modeling, then back to the size you actually wanted for the final coaddition. the -l flag in mBgModel is your safe-space option if you're unsure. 🫢

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 was Montage 5, dated Dec 2016 β€” so if you're reading this in the future, hi, hope the clumps are still clumping. go subset some tables. you got this. πŸ’…βœ¨