replacekey(1)

✨ replacekey β€” the manual, but make it cute ✨

okay bestie, welcome to replacekey(1) from the General Commands Manual section πŸ’– this is the glow-up of your FITS headers, and i'm gonna walk you through every single bit of it, no skips, no cap.


🌸 NAME 🌸

replacekey β€” replace keywords in a FITS header πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

replacekey [options] <in>

that's it. one input file, some options, and a whole new header vibe ✨


πŸŽ€ DESCRIPTION πŸŽ€

so like, replacekey is aimed at replacing keywords in a FITS file's header with new keywords that you, the user, hand it right there on the command-line. it's giving "out with the old, in with the new" 🫢


πŸ’œ ALGORITHM πŸ’œ

okay here's the tea, this is literally the whole personality of the program β˜•

you can provide a new_keyword, an old_keyword, a value and a comment. here's what happens:

  1. replacekey first searches for old_keyword, if you provided one. πŸ‘€
  2. if it finds it, it replaces the associated card with the new one (new_keyword=value/comment). slay. πŸ”₯
  3. if old_keyword is either not found or not provided, replacekey searches for new_keyword, and if it finds it, it replaces the associated card with the new one (new_keyword=value/comment).
  4. new_keyword has to be provided. periodt. no new_keyword, no deal. πŸ’€

🌈 examples, because we love a demonstration 🌈

Exhibit A: you want to change the value of VALUE from 32 to 16 in myfile.fits:

% replacekey -k "VALUE" -v "16" myfile.fits

Exhibit B: if you want to replace the card with the keyword OLD by NEW = 3.14 / This is a usefull key in myfile.fits:

% replacekey -k "NEW" -v "3.14" -c "This is a usefull key" -K "OLD" myfile.fits

Exhibit C: if you do not care about the HISTORY cards you have in the header, and want to replace the first one by VALUE=32, you would do:

% replacekey -k "VALUE" -v "32" -K "HISTORY" myfile.fits

(and yes, "usefull" is spelled exactly like that in the original, i am simply respecting the source material πŸ™ˆ)


✨ OPTIONS ✨

four options, all iconic, all your besties πŸ’–

  • -k or --key key β€” to provide the new keyword πŸ‘‘
  • -K or --old key β€” to provide the old keyword πŸ”
  • -v or --val val β€” to provide the new value ⭐
  • -c or --com com β€” to provide the new comment πŸ’¬
note the lowercase -k vs uppercase -K situation β€” yes they're different, yes it matters, no you cannot mix them up bestie 😭 that's the whole plot twist.

🧚 SEE ALSO 🧚

hierarch28 β€” to convert HIERARCH ESO keywords to regular 8-char keywords 🌟


πŸ“ FILES πŸ“

Files shall all comply with FITS format. that's the rule. FITS or nothing, no vibes-check exceptions πŸ¦‹


πŸ’€ BUGS πŸ’€

ngl, modifications are so far only possible in the main header, not in the extensions. so if your fave keyword is living in an extension, this program is not coming to its rescue. sorry bestie 😭 main header only.


🌟 and that's the whole page 🌟

this little document is from the General Commands Manual collection, dated 28 Oct 1999 β€” yes, a vintage queen πŸ‘‘ she was serving header rewrites before most of us could walk, and she's still here. replacekey(1), 1999 edition, ate and left no crumbs. πŸ’…πŸŒΈβœ¨