CPTCAT(1)
β¨ 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-filepath β 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-formatformat β pick the format of the backtrace that goes to the files from--backtrace-file. your options areplain,xmlorjson. choose your fighter π--comments-readpath β 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-writepath β 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 thecptutilspackage. receipts, basically π§Ύ-h,--helpβ brief help. short and sweet, we love her-H,--hinge-hardβ adds aHARD_HINGEto the output, see HINGES below π-S,--hinge-softβ adds aSOFT_HINGEto the output, see HINGES below π-m,--modelmodel β 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,--outputpath β write the output to path instead ofstdout. 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 range0/1(or into-1/1if a hinge is present), and add aRANGEdirective 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 theRANGEdirective, and then remove that directive. if there's noRANGEthen 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 forRGBandCMYK, and by a dash forHSV.
this is incompatible with the -4 and -6 options, of course π
-6,--gmt6β same as the-5option, but it allows theHARD_HINGEandSOFT_HINGEdirectives in place of the explicitHINGE =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
- fedora 43: cptutils 1.82-4.fc43 Β· GPL-2.0-or-later
- fedora 44: cptutils 1.82-6.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms