MHISTOGRAM(1)

πŸ‘‘ MHISTOGRAM(1) β€” the mHistogram era πŸ’…

okay bestie, welcome to the Montage manual page for mHistogram, and yes this whole thing is filed under the manual name Montage so now you know. sit down, hydrate, let's get into it. 🫢


✨ NAME ✨

mHistogram β€” and the official description? it's None. literally. that's what it says. no notes, iconic, they simply did not write one. πŸ™ˆ


🌈 SYNOPSIS 🌈

mHistogram [-d] -file in.fits minrange maxrange
[logpower/gaussian/gaussian-log/asinh [asinh-beta]] -out out.hist

that's the shape of it. flags in, histogram out, slay. ✨


πŸ’– DESCRIPTION πŸ’–

so here's the lore. the mViewer application makes PNG/JPEG files using FITS images as input. and part of that whole processing situation involves analyzing the FITS files and creating a histogram, which is what gets used to inform the transformation from pixel values to display colors/intensities. that processing happens inside mViewer itself.

but β€” and this is the plot twist β€” there are situations where it helps to have the histogram earlier. for instance, maybe you have several images to process into PNGs and you wish to use the same histogram-based stretch for each one. or maybe you want to generate a set of pixel values that give the visual impression of a color bar (see mPad). sometimes you may just want the histogram itself, for display or analysis purposes. all valid, all understandable. πŸ’…

the mHistogram module contains the same histogram code as mViewer but writes the results out to an ASCII file which can then be read in by mHistogram, mPad or user programs. so it's the same brain, different output. periodt. πŸŽ€


πŸ¦‹ OPTIONS πŸ¦‹

  • -d β€” turn on debugging. that's it, that's the whole option. go off, king. πŸ”
  • -file in.fits minrange maxrange [logpower/gaussian/gaussian-log/asinh [asinh-beta]] β€” the FITS image file; the stretch range; and (optionally) the stretch mode. see the mViewer documentation for more details. iykyk. πŸ“
  • -out out.hist β€” output histogram (ASCII) file. the whole point, honestly. πŸ’Ύ

⭐ RESULT ⭐

if successful, the result is an ASCII file containing the histogram data, the color table lookup mapping, and some other information. so, you know, the goods. 🎁


πŸ’€ MESSAGES πŸ’€

these are the errors, bestie. read them and weep (or, like, debug). 😭

  • ERROR Too few arguments following -file flag
  • ERROR Image file badfile invalid FITS
  • ERROR Can't find HDU badHDU
  • ERROR Too few arguments following -out flag
  • ERROR No input FITS file name given
  • ERROR No output histogram file name given
  • ERROR Cannot open output histogram file.
  • ERROR Grayscale/pseudocolor mode but no gray image given
  • ERROR FITS library error
  • ERROR leading numeric term in 'string' cannot be converted to a finite floating point number
  • ERROR not a valid datatype
  • ERROR negative percentile
  • ERROR percentile context larger than 100
  • ERROR extra numeric term in context 'string' cannot be converted to a finite floating point number
  • ERROR context 'string' contains trailing junk

🌸 EXAMPLES 🌸

here's the vibe in action, copy it exactly bestie:

mHistogram -file SDSS_r.fits -2s max gaussian-log -out SDSS_r.hist
       [struct stat="OK"]

and yeah, that [struct stat="OK"] at the end is the happy little signal that everything went fine. we love to see it. 🫢


πŸ”₯ BUGS πŸ”₯

okay so, the not-so-fun parts. but we're gonna be honest about them because that's what besties do:

  • the drizzle algorithm has been implemented but has not been tested in this release. implemented and untested, a chaotic combo ngl. πŸ’€
  • 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"]. so, yeah. watch out for that. πŸͺŸπŸ˜­
  • 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). βœ‚οΈπŸ“

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, and you read the entire MHISTOGRAM(1) situation from top to bottom. so proud of you. go make some histograms. βœ¨πŸ¦‹πŸ’–