Contents - Index


CPT File Window

 

Occupying the largest part of the screen, the 'CPT File Window' is where CPT files are displayed. The window is actually a tab-control, and will show a number of different CPT files that are open at the same time, each in it's own tab-page. Click 'File > New File' to open a new tab, which you can then edit as-is, or use to open an existing CPT file into. Each file has it's own tab, who's color indicates it's Locked or Altered state. The tab also shows the filename of the file in that tab-page. If the file has not yet been saved with a name, a default name is assigned to it. The filename and path is also shown in the title of the window, and in the Status bar when you hover over the tab. The tab-page can be closed by clicking the 'x' in it's upper-right corner of the tab. or by clicking 'File > Delete Page'.

 

Actions performed by program tools, either to monitor the CPT file or to alter it, are always performed on the file that is currently showing. The contents of the 'CPT Viewer' page, to the right of the 'CPT File Window', always refer to the current CPT file in it's current, rather than saved-state.

 

Returning to the 'CPT File Window' itself, let's look at the different elements of the page. To help you understand, I suggest that you open one of the supplied 'Sample CPT Files', so click 'File > Load From Samples', and select 'GMT_globe.cpt'. When the file has loaded, select the 'CPT Viewer' to the right, so you can see how the entries in the 'CPT File Window' correlate with the text-data in the CPT File itself.

 

At the top, and filling most of the 'CPT File Window' page, is a table that shows each 'Value Row' in the CPT File. The table has a number of columns: Row #, From Value, From Color, From RGB, From Hex, To Value, To Color, To RGB, To Hex.

 

To remind ourselves: each 'Value Row' in a CPT File contains a 'From' and a 'To' Value, that can contain either data with units of measurement (aka Denormalized, and typically in metres), or Normalized data, that spans a range of [0, 1] or [-1, 0] or [-1, 1].

Associated with each 'From' and 'To' Value is a color, which can be in either RGB, HSV, or CMYK format. The format is specified in the 'Color Model' - more about that later.

 

In the 'CPT File Window' we can see that each 'From' and 'To' color is shown in the columns headed 'Color'. The data that created that color, in RGB, HSV, or CMYK format, is shown in the next column. The Hex-value for that data, which does not depend on the current color-format, is shown in the next column.

 

Cells in columns that have a white background color can be edited manually. Cells in columns that have a gray background color are locked, and will be updated by the program automatically.

You can alter a 'From' or 'To' Value by clicking on the desired cell and then typing a new value in it, then pressing 'Enter'. The new value will be shown in the 'CPT Viewer', to the right, and will be used on any further program actions.

You can alter a 'From' or 'To' color by Pasting another color on to the current colored cell. The color-data, in RGB, HSV, or CMYK format, and the Hex-value for that data, will be updated automatically.

 

You can right-click any row to see a Context-Menu. This has two commands:

    Insert New Row Beneath This Row

    Delete This Row

 

 

Below the table are some other values derived from the CPT file:

 

1/ > Highest Value - Derived from the optional CPT File line preceded with 'F'. It stores the 'Foreground' color that is assigned to values higher than the highest z-value.

 

2/ < Lowest Value - Derived from the optional CPT File line preceded with 'B'. It stores the 'Background' color that is assigned to values lower than the lowest z-value

 

3/ NaN Color - Derived from the optional CPT File line preceded with 'N'. It stores the color that will be painted wherever values are undefined as numbers.

 

4/ Color Model - Derived from the optional CPT File line preceded with '# COLOR_MODEL = '. It indicates that the color palette files contain RGB values (r,g,b in 0-255 range), HSV values (h in 0-360, s,v in 0-1 range), or CMYK values (c,m,y,k in 0-1 range). Note that 'HSV' and 'HSB' are the same thing, but 'HSV' and 'HSL' are not. If the Color Model entry is not present, an RGB color model is assumed, though in the GMT program this can be changed with the setting in the 'gmtdefaults' file. Use the 'Config' tab-page commands to change it.

 

5/ Hinge - Derived from the optional CPT File line preceded with '# HINGE = '. It marks the Value where a range changes from negative to positive when normalized. It is usually '0', but can be any value within the Range. It is used to treat the two halves of the CPT file differently when normalizing to fit the User's range. Use the 'Config' tab-page commands to change it.

 

6/ Range - Derived from the optional CPT File line preceded with '# RANGE = '. It is often present when the Values have been Normalized, and is required if the values need to be compared to a Denormalized data-set. The Range is entered as 0/1 or -1/0 if there is no hinge, or -1/1 if there is a hinge. Use the 'Config' tab-page commands to change it.

 

7/ Comments - Derived from any other CPT File lines that are preceded with '#' and that are not covered by previous conditions. When shown in the 'Comments' box of the 'CPT File Window', comments have their leading '#' character removed. This is automatically replaced when the file is rebuilt, as can be seen in the 'CPT Viewer'. To add or edit comments, you can type them in to the 'Comments' box of the CPT File Window. The text in the 'CPT Viewer' will be updated automatically.