CPTCAT(1)

πŸ“¦ version 1.82, in fedora 43, fedora 44

✨ NAME ✨

okay so cptcat β€” it concatenates GMT colour palette tables (you know, cpt files) πŸ’… that's it, that's the whole job, and it does it beautifully

it's the cptcat(1) user command, btw, living in section 1 of the manual, we love a user command era 🫢


🌸 SYNOPSIS 🌸

cptcat [-h] [-H] [-m model] [-o path] [-S] [-v] [-V] [-z] [-Z] [-4] [-5]
       [-6] path...

πŸ’– DESCRIPTION πŸ’–

so the cptcat utility concatenates GMT colour palette table (cpt) files. iconic behaviour, no notes ✨

the mandatory path argument(s) are your input files, and bestie, you can put them in any order you want. BUT β€” and this is the part that matters β€” when they're sorted, the maximum (z-value) of the lower file should equal the minimum of the upper file. if your files aren't in that form yet, you can glow them up with the makecpt(1) utility first πŸ’…

the background colour gets taken from the lower (or lowest) file, and the foreground comes from the upper one. cute, right? πŸŽ€

and if you don't specify the -o option, the program just writes to stdout. simple. clean. slay.


πŸ‘‘ OPTIONS πŸ‘‘

  • --backtrace-file path β€” tell it a file to write a formatted backtrace to. heads up: the file only gets created if there's actually a backtrace to write, which typically happens when an error occurs 😭 so like, don't expect an empty file just vibing there
  • --backtrace-format format β€” pick the format of the backtrace that goes to the files from --backtrace-file. your options are plain, xml or json. choose your fighter πŸ’€
  • --comments-read path β€” read the comments from the specified path and add them to the output gradient. the format is just a plain text multi-line document, no comment delimiters needed β€” the program adds those itself, she's got it 🫢
  • --comments-write path β€” write the comments that were in the input out to the specified path
  • --comments-retain β€” use the comments from the input file as the comments for the output file. recycling! sustainable queen 🌸
  • --comments-generate β€” create a comment with summary data in the output file: the date of creation, plus the name and version of the cptutils package. receipts, basically 🧾
  • -h, --help β€” brief help. short and sweet, we love her
  • -H, --hinge-hard β€” adds a HARD_HINGE to the output, see HINGES below πŸ‘‡
  • -S, --hinge-soft β€” adds a SOFT_HINGE to the output, see HINGES below πŸ‘‡
  • -m, --model model β€” when writing the output, convert all colours to the specified model, one of "rgb" or "hsv". this has no effect on non-colour segments, so don't come for her about those πŸ’…
  • -o, --output path β€” write the output to path instead of stdout. main character move, honestly
  • -v, --verbose β€” verbose operation. she will tell you things πŸ”₯
  • -V, --version β€” version information ✨
  • -z, --z-normalise β€” normalise the z-values in the cpt output into the range 0/1 (or into -1/1 if a hinge is present), and add a RANGE directive if it isn't already present in the input. this is the form used in GMT master files πŸ‘‘
this option requires that the output cpt version is at least 5. no 5, no z-normalise, sorry bestie 😭
  • -Z, --z-denormalise β€” set the z-values in the cpt output into the range given by the RANGE directive, and then remove that directive. if there's no RANGE then this option does literally nothing. she's just standing there. existing. πŸ’€
  • -4, --gmt4 β€” use GMT 4 conventions when writing the cpt output: the colour-model code is uppercase, and the colours are separated by spaces.

this is incompatible with the -5 and -6 options, of course πŸ™ˆ

at present this option is the default, but that will change at some point. so please specify this option if your use of the output depends on the GMT 4 layout β€” say, because it's being consumed by a custom parser πŸ‘€

  • -5, --gmt5 β€” use GMT 5 conventions when writing the cpt output: the colour-model code is lowercase, and the colours are separated by a solidus for RGB and CMYK, and by a dash for HSV.

this is incompatible with the -4 and -6 options, of course πŸ™ˆ

  • -6, --gmt6 β€” same as the -5 option, but it allows the HARD_HINGE and SOFT_HINGE directives in place of the explicit HINGE = directive. the upgrade era πŸ¦‹

this is incompatible with the -4 and -5 options, of course πŸ™ˆ


πŸ¦‹ HINGES πŸ¦‹

okay so this is the part where cptcat is built different from the other programs that read and write the cpt format. those ones retain the hinge (if any) they find in the input. this one? she does her own thing πŸ’…

the reasoning: an expected use-case for this program is combining bathymetry and topography schemes. those typically would not have hinges, and the result is a bathymetry-topography scheme, which typically would. so like, the whole point is making one where there wasn't one πŸŒŠβ›°οΈ

so here's the tea:

  • any hinges in the input will be ignored (and a warning will be issued when that happens β€” she's not being sneaky about it)
  • the output will have a hinge only if one of the --hinge-hard (-H) or --hinge-soft (-S) options is given
these are a recent GMT feature, so the --gmt6 option is required if you want a hinge. periodt ✨

🌈 EXAMPLES 🌈

want to create a cpt-file topobath.cpt from topo.cpt and bath.cpt, adding a hard hinge and normalising the output β€” you know, the typical form of a "dynamic" or "master" cpt file? say less 🫢

cptcat -v -H -6 -z -o topobath.cpt topo.cpt bath.cpt

πŸ’œ AUTHOR πŸ’œ

J.J. Green β€” the icon, the legend, the moment πŸ‘‘


⭐ SEE ALSO ⭐

makecpt(1) β€” your other bestie, go say hi πŸŽ€


okay that's the whole page, bestie πŸ’– this one's from cptutils 1.82, dated 9 July 2024 β€” so you know the info is fresh, no cap. go forth and concatenate those palettes, you absolute legend πŸŒΈβœ¨πŸ’…

πŸ“¦ where this page comes from