fitsdiff(1)

πŸ’– fitsdiff β€” bestie edition πŸ’–

ok so this is fitsdiff from astropy 1.0.2, and it's literally the tool you want when you need to compare two FITS image files and spill the tea on every difference in header keywords and data. no cap. 🫢


✨ NAME ✨

fitsdiff β€” compare two FITS image files and report the differences in header keywords and data. πŸ’…


🌸 SYNOPSIS 🌸

fitsdiff [OPTION]... FILE1 FILE2

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so fitsdiff is a command line script based on pyfits, and its whole job is comparing two FITS image files and reporting the differences in header keywords and data. it's giving diff but for astronomy. ✨

FILE1 and FILE2 are the two files to be compared. they can also be wild cards β€” but bestie, if they are, they must be enclosed by double or single quotes. or, plot twist, they can be directory names. πŸ‘‘

  • if both are directory names, all files in each of the directories will be included πŸ—‚οΈ
  • if only one is a directory name, then the directory name will be prefixed to the file name(s) specified by the other argument

for example:

% fitsdiff "*.fits" "/machine/data1"

will compare all FITS files in the current directory to the corresponding files in the directory /machine/data1. lowkey iconic.

if the two files are identical within the specified conditions, it will report "No difference is found." β€” the most peaceful outcome fr fr. 😌

if the value(s) of -c and -k takes the form @filename, list is in the text file filename, and each line in that text file contains one keyword. πŸ“

fitsdiff commandline arguments can also be set using the environment variable FITSDIFF_SETTINGS. if the FITSDIFF_SETTINGS environment variable is present, each argument present will override the corresponding argument on the commandline. this environment variable exists to make it easier to change the behavior of fitsdiff on a global level, such as in a set of regression tests. it's the "set it once, forget it" queen. πŸ’…


πŸ’œ GENERIC OPTIONS πŸ’œ

  • -h, --help β€” display terse usage information (help). the "just tell me what to do" button πŸ™ˆ
  • -q, --quiet β€” produce no output and just return a status code. silent but the exit code speaks volumes. 🀫
  • -n INTEGER, --num-diffs=INTEGER β€” max number of data differences (image pixel or table element) to report per extension (default 10). keeps the receipts from overflowing. 🧾
  • -d NUMBER, --difference-tolerance=NUMBER β€” the relative tolerance for comparison of two numbers, specifically two floating point numbers. this applies to data in both images and tables, and to floating point keyword values in headers (default 0.0). so like, tiny float drama can be forgiven. ✨
  • -b, --no-ignore-blanks β€” don't ignore trailing blanks (whitespace) in string values. otherwise trailing blanks both in header keywords/values and in table column values) are not treated as significant i.e. without this option 'ABC ' and 'ABC' are considered equivalent. with it? not equivalent, bestie. 🫒
  • --no-ignore-blank-cards β€” don't ignore entirely blank cards in headers. normally fitsdiff does not consider blank cards when comparing headers, but this will ensure that even blank cards match up. yes, even the empty ones have to show up. πŸ’€
  • -o FILE, --output-file=FILE β€” output results to this file; otherwise results are printed to stdout. take the notes somewhere else, main character. πŸ““

πŸŽ€ HEADER COMPARISON OPTIONS πŸŽ€

  • -k KEYWORDS, --ignore-keywords=KEYWORDS β€” comma-separated list of keywords not to be compared. keywords may contain wildcard patterns. to exclude all keywords, use "*"; make sure to have double or single quotes around the asterisk. quote the star, protect the star. ⭐
  • -c KEYWORDS, --ignore-comments=KEYWORDS β€” comma-separated list of keywords whose comments will not be compared. wildcards may be used as with --ignore-keywords. the comments get a hall pass. 🎫

🌈 TABLE COMPARISON OPTIONS 🌈

  • -f COLUMNS, --ignore-fields=COLUMNS β€” comma-separated list of fields (i.e. columns) not to be compared. all columns may be excluded using "*" as with --ignore-keywords. bye bye columns, not your problem anymore. πŸ‘‹

πŸ”₯ EXAMPLES πŸ”₯

% fitsdiff -k filename,filtnam1 -n 5 -d 1.e-6 test1.fits test2

this command will compare files test1.fits and test2.fits, report maximum of 5 different pixels values per extension, only report data values larger than 1.e-6 relative to each other, and will neglect the different values of keywords FILENAME and FILTNAM1 (or their very existence). periodt. πŸ’…βœ¨


heads up bestie: if a file pair is identical within the conditions you specified, fitsdiff says "No difference is found." β€” so a quiet run is a good run. πŸ’–

and that's the whole vibe check! this page came from astropy version 1.0.2, dated April 2015, and it's your girl fitsdiff on manual page fitsdiff(1) saying slay, go compare some FITS files, ily, bye πŸ«ΆπŸ’–πŸŒˆ