MSHRINK(1)
π« mShrink β bestie edition π«
okay so this is a page from the Montage manual, and today we're learning about mShrink(1). she's a lil utility, she's lowkey iconic, and she's about to make your FITS files β¨smallerβ¨. sit down, grab a strawberry, let's go π
πΈ NAME πΈ
mShrink β re-size a FITS image. that's it, that's the whole vibe. resizing. slay.
β¨ SYNOPSIS β¨
mShrink [-f] [-d level] [-h hdu] [-s statusfile] in.fits out.fits factor
like, that's the whole thing. flags first, then your two files, then the factor. periodt π
π¦ DESCRIPTION π¦
so basically: this is a utility for reducing the size of a FITS file, by averaging blocks of pixels. no cap. that's genuinely what she does. blocks of pixels go in, one averaged pixel comes out, the file gets smol. it's giving β¨shrinkβ¨.
π OPTIONS π
-fβ the fixed-size flag π«Ά instead of telling her how big the blocks of pixels should be that you want averaged, you tell her the output size of the image. flip the whole thing around. main character energy.-d levelβ turns on debugging to the specified level, and the levels go1-4. so like,-d 1is a lil peek,-d 4is full unhinged verbose mode π-s statusfileβ output and errors get sent tostatusfileinstead of tostdout. so if you're tired of the terminal yelling at you, send it somewhere else bestie π
π ARGUMENTS π
in.fitsβ the input FITS file. the one you're feeding her. the before picture πΈout.fitsβ the path to the output FITS file. the after picture, the glow-up, the transformation β¨-h hduβ use the specified FITS extension. default is to use the first HDU with image data. so if you don't say anything, she just grabs the first one that has actual image data in it. no drama.factorβ this is the size of the blocks, in pixels, to average. your file size will be reduced by1/factorsquared. BUT!! if you used the-f(fixed-size) flag, thenfactormeans something completely different: it's the desired width of the output image. same name, different job, she contains multitudes π
π RESULT π
- [Normal mode]: you get a FITS output image, reduced in size by a factor of
(1/factor)^2. math is mathing π - [Fixed-size mode]: you get a FITS output image of width
factor. exactly that width. she said what she said.
π₯ MESSAGES π₯
here's the group chat, here's what she might say back to you:
OKβ[struct stat="OK"]π we love a success storyERRORβCannot open status file: statusfileπ couldn't open the status file you namedERRORβImage size factor cannot be interpreted as an real number(yes that's literally how it's spelled, i don't make the rules π)ERRORβShrink factor factor cannot be interpreted as an real numberERRORβ[struct stat="ERROR", msg=ERRORβImage file in.fits missing of inavlid FITS.ERRORβFITS library error
ngl if you're seeing a wall of ERROR lines, that's the vibe check failing. check your file paths and your numbers fr fr π
π§ EXAMPLES π§
okay here's what it actually looks like in the wild:
$ mShrink final/out.fits final/out-lowres_5.fits 5
[struct stat="OK"]
she ate and left no crumbs. [struct stat="OK"] is the sound of a job well done π
π BUGS π
okay this is the part where we keep it real, because besties don't lie to each other:
- the drizzle algorithm has been implemented but has not been tested in this release. so like, she's there, she exists, nobody has taken her for a walk yet. proceed accordingly π«£
- 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"]. windows line endings strike again, we been knew π - 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 β that's the
-lflag inmBgModel. iykyk π
π COPYRIGHT π
2001-2015 California Institute of Technology, Pasadena, California
if your research uses Montage, please include the following acknowledgement, and yes you have to include the whole thing, she said it with her whole chest:
"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. shoutout π«Ά
and that's the whole page bestie!! go forth, average some pixel blocks, make your FITS files smol πβ¨ this was Montage 5, dated Dec 2016 β mwah, love u, bye ππ¦πΈ
π¦ where this page comes from
- debian bookworm: montage 6.0+dfsg-7+b8 Β· BSD-3-Clause
- debian trixie: montage 6.1+dfsg-1+b1 Β· BSD-3-Clause
- ubuntu jammy: montage 6.0+dfsg-7build5 Β· BSD-3-Clause
- ubuntu noble: montage 6.0+dfsg-9 Β· BSD-3-Clause
- ubuntu questing: montage 6.1+dfsg-2
- ubuntu resolute: montage 6.1+dfsg-2build2 Β· BSD-3-Clause
- ubuntu stonking: montage 6.1+dfsg-2build2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms