1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 99.2beta8 (1.46)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>4.1 The cpt file format</TITLE>
<META NAME="description" CONTENT="4.1 The cpt file format">
<META NAME="keywords" CONTENT="tutorial">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v99.2beta8">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="tutorial.css">
<LINK REL="next" HREF="node70.html">
<LINK REL="previous" HREF="node67.html">
<LINK REL="up" HREF="node67.html">
<LINK REL="next" HREF="node69.html">
</HEAD>
<BODY bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html1393"
HREF="node69.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A>
<A NAME="tex2html1387"
HREF="node67.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A>
<A NAME="tex2html1381"
HREF="node67.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A>
<A NAME="tex2html1389"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>
<A NAME="tex2html1391"
HREF="node79.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html1394"
HREF="node69.html">4.1.1 Exercises</A>
<B> Up:</B> <A NAME="tex2html1388"
HREF="node67.html">4. SESSION FOUR</A>
<B> Previous:</B> <A NAME="tex2html1382"
HREF="node67.html">4. SESSION FOUR</A>
  <B> <A NAME="tex2html1390"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html1392"
HREF="node79.html">Index</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H1><A NAME="SECTION00610000000000000000"></A>
<A NAME="1376"></A>
<BR>
4.1 The cpt file format
</H1>
<P>
The cpt file has already been briefly mentioned in connection
with our seismicity plot in session 2. Here we will treat the
issue in more detail. The general format of cpt files is
<P>
<DIV ALIGN="CENTER">
<TABLE CELLPADDING=3>
<TR><TD ALIGN="LEFT">z<IMG
WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img62.gif"
ALT="$_0$"></TD>
<TD ALIGN="LEFT">R<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img63.gif"
ALT="$_{min}$"></TD>
<TD ALIGN="LEFT">G<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img63.gif"
ALT="$_{min}$"></TD>
<TD ALIGN="LEFT">B<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img63.gif"
ALT="$_{min}$"></TD>
<TD ALIGN="LEFT">z<IMG
WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img64.gif"
ALT="$_1$"></TD>
<TD ALIGN="LEFT">R<IMG
WIDTH="25" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img65.gif"
ALT="$_{max}$"></TD>
<TD ALIGN="LEFT">G<IMG
WIDTH="25" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img65.gif"
ALT="$_{max}$"></TD>
<TD ALIGN="LEFT">B<IMG
WIDTH="25" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img65.gif"
ALT="$_{max}$"></TD>
<TD ALIGN="LEFT">[<B>A</B>]</TD>
</TR>
<TR><TD ALIGN="LEFT">...</TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
</TR>
<TR><TD ALIGN="LEFT">z<IMG
WIDTH="26" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img66.gif"
ALT="$_{n-2}$"></TD>
<TD ALIGN="LEFT">R<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img63.gif"
ALT="$_{min}$"></TD>
<TD ALIGN="LEFT">G<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img63.gif"
ALT="$_{min}$"></TD>
<TD ALIGN="LEFT">B<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img63.gif"
ALT="$_{min}$"></TD>
<TD ALIGN="LEFT">z<IMG
WIDTH="26" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img67.gif"
ALT="$_{n-1}$"></TD>
<TD ALIGN="LEFT">R<IMG
WIDTH="25" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img65.gif"
ALT="$_{max}$"></TD>
<TD ALIGN="LEFT">G<IMG
WIDTH="25" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img65.gif"
ALT="$_{max}$"></TD>
<TD ALIGN="LEFT">B<IMG
WIDTH="25" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img65.gif"
ALT="$_{max}$"></TD>
<TD ALIGN="LEFT">[<B>A</B>]</TD>
</TR>
</TABLE>
</DIV>
<P>
Since a cpt file may contain only shades of gray (here listed as
the red component), the green and blue columns are optional and
only used for color tables. An optional final column may be used
to affect annotation of color bars (created by <A NAME="tex2html241"
HREF="../psscale.html"><I><B>psscale</B></I></A><A NAME="3127"></A>).
The <B>U</B>, <B>L</B>, and <B>B</B> flags (position <B>A</B>) indicate
we want to annotate
the upper, lower, and both color boundaries, respectively.
Alternatively, you can use the <A NAME="tex2html242"
HREF="../psscale.html"><I><B>psscale</B></I></A><A NAME="3136"></A> <B>-B</B> option in
the same way you use it in, say, <A NAME="tex2html243"
HREF="../psbasemap.html"><I><B>psbasemap</B></I></A><A NAME="3146"></A>.
<P>
Cpt files can be created in any number of ways. <A NAME="tex2html244"
HREF="http://www.soest.hawaii.edu/gmt"><B>GMT</B></A> provides
two mechanisms:
<P>
<OL>
<LI>Create simple, linear color tables given a master color table
(several are built-in) and the desired <IMG
WIDTH="10" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img38.gif"
ALT="$z$">-values at color boundaries
(<A NAME="tex2html245"
HREF="../makecpt.html"><I><B>makecpt</B></I></A><A NAME="3158"></A>)
<P>
</LI>
<LI>Create color tables based on a master cpt color table and the
histogram-equalized distribution of <IMG
WIDTH="10" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img38.gif"
ALT="$z$">-values in a gridded data file (<A NAME="tex2html246"
HREF="../grd2cpt.html"><I><B>grd2cpt</B></I></A><A NAME="3167"></A>)
<P>
</LI>
</OL>
<P>
One can also make these files manually or with <I>awk</I><A NAME="3175"></A>
or other tools. Here we will limit our discussion to <A NAME="tex2html247"
HREF="../makecpt.html"><I><B>makecpt</B></I></A><A NAME="3181"></A>.
Its main argument is the name of the master color table (a list is
shown if you run the program with no arguments) and the equidistant
<IMG
WIDTH="10" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img38.gif"
ALT="$z$">-values to go with it. The main options are given below.
<P>
<BR><P></P>
<DIV ALIGN="CENTER"><A NAME="1754"></A>
<TABLE>
<CAPTION><STRONG>Table 4.1:</STRONG>
Prime options available in <A NAME="tex2html235"
HREF="../makecpt.html"><I><B>makecpt</B></I></A><A NAME="3194"></A></CAPTION>
<TR><TD>
<DIV ALIGN="CENTER"><TABLE CELLPADDING=3 BORDER="1">
<TR><TD ALIGN="CENTER" COLSPAN=1><FONT SIZE="-1">
<I>Option</I></FONT></TD>
<TD ALIGN="CENTER" COLSPAN=1><FONT SIZE="-1"> <I>Purpose</I></FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">
</FONT><FONT SIZE="-1"><B>-C</B> </FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1"> Set the name of the master cpt file to use </FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">
</FONT><FONT SIZE="-1"><B>-I</B> </FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1"> Reverse the sense of the color progression </FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">
</FONT><FONT SIZE="-1"><B>-V</B> </FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1"> Run in verbose mode </FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">
</FONT><FONT SIZE="-1"><B>-Z</B> </FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1"> Make a continuous rather than discrete table </FONT></TD>
</TR>
</TABLE><FONT SIZE="-1">
<A NAME="tbl:makecpt"></A></FONT></DIV></TD></TR>
</TABLE>
</DIV><P></P>
<BR>
<P>
To make discrete and continuous color cpt files for data that ranges
from -20 to 60, with color changes at every 10, try these two variants:
<P>
<PRE>
makecpt -Crainbow -T-20/60/10 >! disc.cpt
makecpt -Crainbow -T-20/60/10 -Z >! cont.cpt
</PRE>
<P>
We can plot these color tables with <A NAME="tex2html248"
HREF="../psscale.html"><I><B>psscale</B></I></A><A NAME="3203"></A>; the options
worth mentioning here are listed in Table <A HREF="node68.html#tbl:psscale">4.2</A>.
<P>
<BR><P></P>
<DIV ALIGN="CENTER"><A NAME="1757"></A>
<TABLE>
<CAPTION><STRONG>Table 4.2:</STRONG>
The main switches and options in <A NAME="tex2html238"
HREF="../psscale.html"><I><B>psscale</B></I></A><A NAME="3215"></A></CAPTION>
<TR><TD>
<DIV ALIGN="CENTER"><TABLE CELLPADDING=3 BORDER="1">
<TR><TD ALIGN="CENTER" COLSPAN=1><FONT SIZE="-1">
<I>Option</I></FONT></TD>
<TD ALIGN="CENTER" COLSPAN=1><FONT SIZE="-1"> <I>Purpose</I></FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">
</FONT><FONT SIZE="-1"><B>-C</B></FONT><FONT SIZE="-1"><I>cptfile</I> </FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1"> The required cpt file </FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">
</FONT><FONT SIZE="-1"><B>-D</B></FONT><FONT SIZE="-1"><I>xpos</I>/</FONT><FONT SIZE="-1"><I>ypos</I>/</FONT><FONT SIZE="-1"><I>length</I>/</FONT><FONT SIZE="-1"><I>width</I>[</FONT><FONT SIZE="-1"><B>h</B>] </FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1"> Sets the position of the center/left and dimensions of scale bar. </FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">
</FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1"> Append </FONT><FONT SIZE="-1"><B>h</B> to get horizontal bar and give center/top instead </FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">
</FONT><FONT SIZE="-1"><B>-I</B></FONT><FONT SIZE="-1"><I>max_intensity</I> </FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1"> Add illumination effects </FONT></TD>
</TR>
</TABLE><FONT SIZE="-1">
<A NAME="tbl:psscale"></A></FONT></DIV></TD></TR>
</TABLE>
</DIV><P></P>
<BR>
<P>
In addition, the <B>-B</B> option can be used to set the title
and unit label (and optionally to set the anotation-, tick-,
and grid-line intervals for the colorbars.)
<P>
<PRE>
psbasemap -R0/8.5/0/11 -Jx1i -P -B0 -K >! bar.ps
psscale -D3i/3i/4i/0.5ih -Cdisc.cpt -B:discrete: -O -K >> bar.ps
psscale -D3i/5i/4i/0.5ih -Ccont.cpt -B:continuous: -O -K >> bar.ps
psscale -D3i/7i/4i/0.5ih -Cdisc.cpt -B:discrete: -I0.5 -O -K >> bar.ps
psscale -D3i/9i/4i/0.5ih -Ccont.cpt -B:continuous: -I0.5 -O >> bar.ps
</PRE>
<P>
<BR><HR>
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
<UL>
<LI><A NAME="tex2html1395"
HREF="node69.html">4.1.1 Exercises</A>
</UL>
<!--End of Table of Child-Links-->
<HR>
<!--Navigation Panel-->
<A NAME="tex2html1393"
HREF="node69.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A>
<A NAME="tex2html1387"
HREF="node67.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A>
<A NAME="tex2html1381"
HREF="node67.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A>
<A NAME="tex2html1389"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>
<A NAME="tex2html1391"
HREF="node79.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html1394"
HREF="node69.html">4.1.1 Exercises</A>
<B> Up:</B> <A NAME="tex2html1388"
HREF="node67.html">4. SESSION FOUR</A>
<B> Previous:</B> <A NAME="tex2html1382"
HREF="node67.html">4. SESSION FOUR</A>
  <B> <A NAME="tex2html1390"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html1392"
HREF="node79.html">Index</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2001-04-18
</ADDRESS>
</BODY>
</HTML>
|