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:
replacekeyfirst searches forold_keyword, if you provided one. π- if it finds it, it replaces the associated card with the new one (
new_keyword=value/comment). slay. π₯ - if
old_keywordis either not found or not provided,replacekeysearches fornew_keyword, and if it finds it, it replaces the associated card with the new one (new_keyword=value/comment). new_keywordhas 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 π
-kor--keykey β to provide the new keyword π-Kor--oldkey β to provide the old keyword π-vor--valval β to provide the new value β-cor--comcom β to provide the new comment π¬
note the lowercase-kvs uppercase-Ksituation β 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. π
πΈβ¨
π¦ where this page comes from
- debian bookworm: qfits-tools 6.2.0-8+b2
- debian trixie: qfits-tools 6.2.0-9+b1
- ubuntu jammy: qfits-tools 6.2.0-8ubuntu2
- ubuntu noble: qfits-tools 6.2.0-9ubuntu1
- ubuntu questing: qfits-tools 6.2.0-9ubuntu1
- ubuntu resolute: qfits-tools 6.2.0-9ubuntu2
- ubuntu stonking: qfits-tools 6.2.0-9ubuntu2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms