Gmt: Auto-downloading of earth_relief_##m|s.grd files has been disabled.






















Geographic map border using separate selections for annotation, frame, and grid intervals. The machinery for primary and secondary annotations introduced for time-series axes can also be utilized for geographic basemaps. This may be used to separate degree annotations from minutes- and seconds-annotations. For a more complicated basemap example using several sets of intervals, including different intervals and pen attributes for grid lines and grid crosses, see Figure Complex basemap.

Geographic map border with both primary P and secondary S components. Other than that, cartesian linear axes are very similar to geographic axes. Note that for these axes you may use the unit setting to add a unit string to each annotation see Figure Axis label. Linear Cartesian projection axis. Long tick-marks accompany annotations, shorter ticks indicate frame interval. The axis label is optional. Due to the logarithmic nature of annotation spacings, the stride parameter takes on specific meanings.

The following concerns are specific to log axes see Figure Logarithmic projection axis :. Logarithmic projection axis using separate values for annotation, frame, and grid intervals. To avoid this problem, you can append p to stride , and the annotation interval is expected to be in transformed units, yet the annotation itself will be plotted as un-transformed units see Figure Power projection axis. Exponential or power projection axis. What sets time axis apart from the other kinds of plot axes is the numerous ways in which we may want to tick and annotate the axis.

Not only do we have both primary and secondary annotation items but we also have interval annotations versus tick-mark annotations, numerous time units, and several ways in which to modify the plot. We will demonstrate this flexibility with a series of examples.

While all our examples will only show a single x -axis south, selected via -BS , time-axis annotations are supported for all axes. Our first example shows a time period of almost two months in Spring We want to annotate the month intervals as well as the date at the start of each week:.

These commands result in Figure Cartesian time axis. The lower example Figure Cartesian time axis, example 2 chooses to annotate the weekdays by specifying a 1 K while the upper example choses dates by specifying a 1 D. Note how the clock format only selects hours and minutes no seconds and the date format selects a month name, followed by one space and a two-digit day-of-month number. The third example Figure Cartesian time axis, example 3 presents two years, annotating both the years and every 3rd month.

Note that while the year annotation is centered on the 1-year interval, the month annotations must be centered on the corresponding month and not the 3-month interval. We select both primary and secondary annotations, ask for a hour clock, and let time go from right to left:.

The fifth example shows a few weeks of time Figure Cartesian time axis, example 5. The lower axis shows ISO weeks with week numbers and abbreviated names of the weekdays.

Our sixth example Figure Cartesian time axis, example 6 shows the first five months of , and we have annotated each month with an abbreviated, upper case name and 2-digit year. Only the primary axes information is specified.

Our seventh and final example Figure Cartesian time axis, example 7 illustrates annotation of year-days. Note that in order to have the two years annotated we need to allow for the annotation of small fractional intervals; normally such truncated interval must be at least half of a full interval. Irregularly spaced annotations or annotations based on look-up tables can be implemented using the custom annotation mechanism. The file can contain any number of comments lines starting with and any number of records of the format.

The coord is the location of the desired annotation, tick, or grid-line, whereas type is a string composed of letters from a annotation , i interval annotation, f frame tick, and g gridline. You must use either a or i within one file; no mixing is allowed. The coordinates should be arranged in increasing order. If label is given it replaces the normal annotation based on the coord value.

Our last example Figure Custom and irregular annotations shows such a custom basemap with an interval annotations on the x -axis and irregular annotations on the y -axis.

Custom and irregular annotations, tick-marks, and gridlines. Optionally, append an arbitrary text string surrounded by double quotes , or the code c , which will plot the current command string Figure Time stamp. The -V option selects verbose mode, which will send progress reports to standard error.

Even more verbose levels are -Vl long verbose and -Vd debug. Normal verbosity level produces only error and warning messages. This is the default or can be selected by using -Vn. If compiled with backward-compatibility support, the default is -Vc , which includes warnings about deprecated usage. Finally, -Vq can be used to run without any warnings or errors. By default, all translations are relative to the previous origin see Figure Plot positioning.

Supply offset as c to center the plot in that direction relative to the page margin. Absolute translations i. Subsequent overlays will be co-registered with the previous plot unless the origin is shifted using these options.

The offsets are measured in the current coordinates system which can be rotated using the initial -P option; subsequent -P options for overlays are ignored. Plot origin can be translated freely with -X -Y. GMT relies on external tools to translate geospatial files such as shapefiles into a format we can read. For this to be useful we need a mechanism to associate certain metadata values with required input and output columns expected by GMT programs. The given aspatial field thus replaces any other value already set.

Note that if no aspatial attributes are needed then the -a option is not needed — GMT will still process and read such data files. You can also associate aspatial fields with other settings such as labels, fill colors, pens, and values used to look-up colors. This works analogously to how standard multi-segment files can pass such options via its segment headers See Chapter GMT file formats. As for input, you can also use the special col entries of D , G , L , T , W , or Z to have values stored as options in segment headers be used as the source for the name aspatial field.

Native binary files may have a header section and the -h n option see Section Header data records: The -h option can be used to skip the first n bytes. The data record can be in any format, you may mix different data types and even byte-swap individual columns or the entire record. When using native binary data the user must be aware of the fact that GMT has no way of determining the actual number of columns in the file.

In addition, use x to skip n bytes anywhere in the record. For a mixed-type data record you can concatenate several [ n ] t combinations, separated by commas. You may append w to any of the items to force byte-swapping. Here, n is the number of each item in your binary file. Note that n may be larger than m , the number of columns that the GMT program requires to do its task.

If n is not given then it defaults to m and all columns are assumed to be of the single specified type t [ d double , if not set].

Multiple segment files are allowed and the segment headers are assumed to be records where all the fields equal NaN. For native binary output, use the -bo option; see -bi for further details. Because of its meta data, reading netCDF tables i. When feeding netCDF tables to programs like plot , the program will automatically recognize the format and read whatever amount of columns are needed for that program. To steer which columns are to be read, the user can append the suffix?

No -bi option is needed in this case. Currently, netCDF tables can only be input, not output. For more information, see Chapter GMT file formats. However, there are occasionally the need to handle user data where missing data are represented by some unlikely data value such as Since GMT cannot guess that in your data set is a special value, you can use the -d option to have such values replaced with NaNs. Similarly, should your GMT output need to conform to such a requirement you can replace all NaNs with the chosen nodata value.

If only input or output should be affected, use -di or -do , respectably. The -e option offers a built-in pattern scanner that will only pass records that match the given patterns or regular expressions. The test can also be inverted to only pass data records that do not match the pattern.

The test is not applied to header or segment headers. When map projections are not required we must explicitly state what kind of data each input or output column contains. This is accomplished with the -f option. Following an optional i for input only or o for output only , we append a text string with information about each column or range of columns separated by commas. Each string starts with the column number 0 is first column followed by either x longitude , y latitude , T absolute calendar time or t relative time.

If several consecutive columns have the same format you may specify a range of columns rather than a single column, i. For example, if our input file has geographic coordinates latitude, longitude with absolute calendar coordinates in the columns 3 and 4, we would specify fi 0 y ,1 x ,3—4 T. All other columns are assumed to have the default, floating point format and need not be set individually.

The shorthand -f [ i o ] g means -f [ i o ]0x,1y i. A special use of -f is to select -fp [ unit ], which requires -J and lets you use projected map coordinates e. Such coordinates are automatically inverted to longitude, latitude during the data import.

Optionally, append a length unit see Table distunits [meter]. For more information, see Sections Input data formats and Output data formats. GMT has several mechanisms that can determine line segmentation. Typically, data segments are separated by multiple segment header records see Chapter GMT file formats. However, if key data columns contain a NaN we may also use that information to break lines into multiple segments.

If you wish such records to indicate a segment boundary then set this parameter to pass. Finally, you may wish to indicate gaps based on the data values themselves.

Gaps can be based on excessive jumps in the x - or y -coordinates -gx or -gy , or on the distance between points -gd. Append the gap distance and optionally a unit for actual distances. For geographic data the optional unit may be arc d egree, m inute, and s econd, or m e ter [Default], f eet, k ilometer, M iles, or n autical miles. For programs that map data to map coordinates you can optionally specify these criteria to apply to the projected coordinates by using upper-case -gX , -gY or -gD.

If there are more than one header record you must specify the number after the -h option, e. Note that blank lines and records that start with the character are automatically considered header records and skipped. The default number of such header records if -h is used is one of the many parameters in the gmt.

Normally, programs that both read and write tables will output the header records that are found on input. Use -hi to suppress the writing of header records. You can use the -h options modifiers to to tell programs to output extra header records for titles, remarks or column names identifying each data column.

When -b is used to indicate binary data the -h takes on a slightly different meaning. The -i columns option allows you to specify which input file physical data columns to use and in what order. By default, GMT will read all the data columns in the file, starting with the first column 0. Using -i modifies that process and reads in a logical record based on columns from the physical record.

For instance, to use the 4th, 7th, and 3rd data column as the required x,y,z to blockmean you would specify -i 3,6,2 since 0 is the first column. The chosen data columns will be used as is. Optionally, you can specify that input columns should be transformed according to a linear or logarithmic conversion.

Next, we may scale the result by the given scale [1]. Finally, we add in the specified offset [0]. If you want the trailing text to remain part of your subset logical record then also select the special column by requesting column t , otherwise we ignore trailing text. Finally, to use the entire numerical record and ignoring trailing text, use -in. The physical, logical input and output record in GMT. Here, we are reading a file with 5 numerical columns plus some free-form text at the end.

Our module here plot will be used to plot circles at the given locations but we want to assign color based on the depth column which we need to convert from meters to km and symbol size based on the mag column but we want to scale the magnitude by 0. We use -i to pull in the desired columns in the required order and apply the scaling, resulting in a logical input record with 4 columns.

The -f option can be used to specify column types in the logical record if it is not clear from the data themselves such as when reading a binary file. Finally, if a module needs to write out only a portion of the current logical record then you may use the corresponding -o option to select desired columns, including the trailing text column t.

Note that these column numbers now refer to the logical record, not the physical, since after reading the data there is no physical record, only the logical record in memory. The -n type option controls parameters used for 2-D grids resampling. You can select the type of spline used -nb for B-spline smoothing, -nc for bicubic [Default], -nl for bilinear, or -nn for nearest-node value. By default, boundary conditions are set according to the grid type and extent. Append x or y to only apply the condition in one dimension.

A threshold of 1. The -o columns option allows you to specify which columns to write on output and in what order. By default, GMT will write all the data columns produced by the program. Using -o modifies that process.

For instance, to write just the 4th and 2nd data column to the output you would use -o 3,1 since 0 is the first column. You can also use a column more than once, e. Finally, if your logical record in memory contains trailing text then you can include that by including the special column t to your selections.

The text is always written after any numerical columns. Note that if you wanted to scale or shift the output values you need to do so during reading, using the -i option. To output all numerical columns and ignoring trailing text, use -on. All plotting programs that normally produce a flat, two-dimensional illustration can be told to view this flat illustration from a particular vantage point, resulting in a perspective view.

When -p is used in consort with -Jz or -JZ , a third value can be appended which indicates at which z -level all 2-D material, like the plot frame, is plotted in perspective [Default is at the bottom of the z-axis]. When -p is used without any further arguments, the values from the last use of -p in a previous GMT command will be used.

Alternatively, you can perform a simple rotation about the z-axis by just giving the rotation angle. All 2-D grids in GMT have their nodes organized in one of two ways, known as gridline - and pixel - registration.

The GMT default is gridline registration; programs that allow for the creation of grids can use the -r option to select pixel registration instead. Most observed data tend to be in gridline registration while processed data sometime may be distributed in pixel registration. While you may convert between the two registrations this conversion looses the Nyquist frequency and dampens the other high frequencies.

It is best to avoid any registration conversion if you can help it. Planning ahead may be important. In this registration, the nodes are centered on the grid line intersections and the data points represent the average value in a cell of dimensions centered on each node left side of Figure Grid registration. In the case of grid line registration the number of nodes are related to region and grid spacing by.

Here, the nodes are centered in the grid cells, i. In the case of pixel registration the number of nodes are related to region and grid spacing by. Gridline- and pixel-registration of data nodes. The red shade indicates the areas represented by the value at the node solid circle.

We can use this option to suppress output for records whose z -value equals NaN by default we output all records. Alternatively, append r to reverse the suppression, i. Use -sa to suppress output records where one or more fields and not necessarily z equal NaN. Finally, you can supply a comma-separated list of all columns or column ranges to consider for this NaN test. While the PostScript language does not support transparency, PDF does, and via PostScript extensions one can manipulate the transparency levels of objects.

The -t option allows you to change the transparency level for the current overlay by appending a percentage in the 0— range; the default is 0, or opaque.

Transparency may also be controlled on a feature by feature basis when setting color or fill see section Specifying area fill attributes. For geographical data, the first column is expected to contain longitudes and the second to contain latitudes. To reverse this expectation you must apply the -: option. Optionally, append i or o to restrict the effect to input or output only. Note that command line arguments that may take geographic coordinates e.

Also, geographical grids are expected to have the longitude as first minor dimension. For example, if a basemap was created with an oblique Mercator projection, specified as. In contrast, note that -J by itself will pick the most recently used projection. Previous commands are maintained in the file gmt. This is handy if you create separate directories for separate projects since chances are that data manipulations and plotting for each project will share many of the same options.

Note that an option spelled out on the command line will always override the previous entry in the gmt. The only guarantee is that the file will not be clobbered since GMT uses advisory file locking.

The uncertainty in processing order makes the use of shorthands in pipes unreliable. We therefore recommend that you only use shorthands in single process command lines, and spell out the full command option when using chains of commands connected with pipes. The history can be cleared by running gmt clear history. Each program carries a usage message. If you enter the program name without any arguments, the program will write the complete usage message to standard error your screen, unless you redirect it.

This message explains in detail what all the valid arguments are. If you enter the program name followed by a hyphen - only you will get a shorter version which only shows the command line syntax and no detailed explanations. If you incorrectly specify an option or omit a required option, the program will produce syntax errors and explain what the correct syntax for these options should be.

If an error occurs during the running of a program, the program will in some cases recognize this and give you an error message. Usually this will also terminate the run. The error messages generally begin with the name of the program in which the error occurred; if you have several programs piped together this tells you where the trouble is. Most of the programs which expect table data input can read either standard input or input in one or several files. These programs will try to read stdin unless you type the filename s on the command line without the above hyphens.

If the program sees a hyphen, it reads the next character as an instruction; if an argument begins without a hyphen, it tries to open this argument as a filename. This feature allows you to connect programs with pipes if you like. To give numerous input files you can either list them all file1. This allows GMT modules to obtain the input file names from filelist.

If your input is ASCII and has one or more header records that do not begin with , you must use the -h option see Section Header data records: The -h option. ASCII files may in many cases also contain segment-headers separating data segments. For binary table data the -h option may specify how many bytes should be skipped before the data section is reached. Binary files may also contain segment-headers separating data segments.

These segment-headers are simply data records whose fields are all set to NaN; see Chapter GMT file formats for complete documentation. If filenames are given for reading, GMT programs will first look for them in the current directory. They may be set by the user to point to directories that contain data sets of general use, thus eliminating the need to specify a full path to these files. See directory parameters for details. Program output is always written to the current directory unless a full path has been specified.

The 1x1 degree tiles red for which SRTM 1 and 3 arc second data are available. Verbose will write to standard error information about the progress of the operation you are running. Verbose reports things such as counts of points read, names of data files processed, convergence of iterative solutions, and the like. Since these messages are written to stderr , the verbose talk remains separate from your data output.

You may optionally choose among five models of verbosity ; each mode adds more messages with an increasing level of details.

The modes are. The verbosity is cumulative, i. Most programs write their results, including PostScript plots, to standard output. The exceptions are those which may create binary netCDF grid files such as surface due to the design of netCDF a filename must be provided; however, alternative binary output formats allowing piping are available; see Section Grid file format specifications. Most operating systems let you can redirect standard output to a file or pipe it into another process.

Error messages, usage messages, and verbose comments are written to standard error in all cases. You can usually redirect standard error as well, if you want to create a log file of what you are doing. The syntax for redirection differ among the main shells Bash and C-shell and is a bit limited in DOS. Most of the time, GMT will know what kind of x and y coordinates it is reading because you have selected a particular coordinate transformation or map projection.

However, there may be times when you must explicitly specify what you are providing as input using the -f switch. When binary input data are expected -bi you must specify exactly the format of the records.

However, for ASCII input there are numerous ways to encode data coordinates which may be separated by white-space or commas. Valid input data are generally of the same form as the arguments to the -R option see Section Data domain or map region: The -R option , with additional flexibility for calendar data.

Geographical coordinates, for example, can be given in decimal degrees e. With -fp you may even supply projected data like UTM coordinates. A complete description of possible formats is given in the gmt.

The clock string is more standardized but issues like or hour clocks complicate matters as well as the presence or absence of delimiters between fields. GMT programs that require a map projection argument will implicitly know what kind of data to expect, and the input processing is done accordingly. However, some programs that simply report on minimum and maximum values or just do a reformatting of the data will in general not know what to expect, and furthermore there is no way for the programs to know what kind of data other columns beyond the leading x and y columns contain.

In such instances we must explicitly tell GMT that we are feeding it data in the specific geographic or calendar formats floating point data are assumed by default. We specify the data type via the -f option which sets both input and output formats; use -fi and -fo to set input and output separately. For instance, to specify that the the first two columns are longitude and latitude, and that the third column e.

For more details, see the man page for the program you need to use. In the latter case the issue of formatting becomes important.

GMT provides extensive machinery for allowing just about any imaginable format to be used on output. Analogous to the processing of input data, several templates guide the formatting process. PostScript is a command language for driving graphics devices such as laser printers. It is ASCII text which you can read and edit as you wish assuming you have some knowledge of the syntax.

We prefer this to binary metafile plot systems since such files cannot easily be modified after they have been created. GMT programs also write many comments to the plot file which make it easier for users to orient themselves should they need to edit the file e.

See the manual pages for PSL syntax. Although GMT programs can create very individualized plot code, there will always be cases not covered by these programs.

Some knowledge of PostScript will enable the user to add such features directly into the plot file. A pen in GMT has three attributes: width , color , and style. Most programs will accept pen attributes in the form of an option argument, with commas separating the given attributes, e. The style attribute controls the appearance of the line. The lengths of dots and dashes are scaled relative to the pen width dots has a length that equals the pen width while dashes are 8 times as long; gaps between segments are 4 times the pen width.

For more detailed attributes including exact dimensions you may specify string : offset , where string is a series of numbers separated by underscores. These numbers represent a pattern by indicating the length of line segments and the gap between segments. The offset phase-shifts the pattern from the beginning the line. For example, if you want a yellow line of width 0. Just as with pen width, the default style units are points, but can also be explicitly specified in cm, inch, or points see width discussion above.

Table penex contains additional examples of pen specifications suitable for, say, plot. In addition to these pen settings there are several PostScript settings that can affect the appearance of lines. They determine how a line segment ending is rendered, be it at the termination of a solid line or at the end of all dashed line segments making up a line, and how a straight lines of finite thickness should behave when joined at a common point.

By default, line segments have rectangular ends, but this can change to give rounded ends. This can be used to created circular dotted lines, and by manipulating the phase shift in the style attribute and plotting the same line twice one can even alternate the color of adjacent items. Figure Line appearance shows various lines made in this fashion.

See the gmt. A line is drawn with the texture provided by the chosen pen Specifying pen attributes. However, depending on the module, a line also may have other attributes that can be changed in some modules. Given as modifiers to a pen specification, one or more modifiers may be appended to a pen specification. The line attribute modifiers are:. Note that we also prescribed the line offsets in addition to the symbol endings. Many plotting programs will allow the user to draw filled polygons or symbols.

The fill specification may take two forms:. Due to PostScript implementation limitations the raster images used with -G must be less than x pixels in size; for larger images see image. Note that under PostScript Level 1 the patterns are filled by using the polygon as a clip path. Complex clip paths may require more memory than the PostScript interpreter has been assigned.

There is therefore the possibility that some PostScript interpreters especially those supplied with older laserwriters will run out of memory and abort. Should that occur we recommend that you use a regular gray-shade fill instead of the patterns. Installing more memory in your printer may or may not solve the problem! Table fillex contains a few examples of fill specifications. However, some programs, like text may wish to have this information passed directly.

A font is specified by a comma-delimited attribute list of size , fonttype and fill , each of which is optional. The size is the font size usually in points but c , i or p can be added to indicate a specific unit. The fonttype is the name case sensitive!

If any of the attributes is omitted their default or previous setting will be retained. The PostScript language has no built-in mechanism for transparency. However, PostScript extensions make it possible to request transparency, and tools that can render such extensions will produce transparency effects. We specify transparency in percent: 0 is opaque [Default] while is fully transparent i.

As noted in section Layer PDF transparency: The -t option , we can control transparency on a layer-by-layer basis using the -t option. However, we may also set transparency as an attribute of stroke or fill including for fonts settings. Here, transparency is requested by appending transparency to colors or pattern fills. For more information, see for instance search online for the Adobe pdfmark Reference Manual.

Most printers and many PostScript viewers can neither print nor show transparency. They will simply ignore your attempt to create transparency and will plot any material as opaque. Many text labels placed on maps are part of the standard basemap machinery e. However, when you wish to add extra text to a plot in locations of your choice you will need to understand how we reference text to locations on the map. Figure Text justification discusses the various ways to do this.

Text strings are placed on maps by associating an anchor point on the string with a reference point on the map. Nine anchor points relative to any text string may be specified by combining any of three letter codes for horizontal L eft, C enter, R ight and vertical T op, M iddle, B ottom alignments.

Notice how the anchor points refers to the text baseline and do not change for text whose letters extend below the baseline. The concept of anchor points extends to entire text paragraphs that you may want to typeset with text. A related point involves the footprint of the text and any background panel on the map. We determine the bounding box for any text string, but very often we wish to extend this box outwards to allow for some clearance between the text and the space surrounding it.

Programs that allows for such clearance will let you specify offsets dx and dy that is used to enlarge the bounding box, as illustrated in Figure Text clearance. The bounding box of any text string can be enlarged by specifying the adjustments dx and dy in the horizontal and vertical dimension.

The shape of the bounding box can be modified as well, including rounded or convex rectangles. Here we have chosen a rounded rectangle, requiring the additional specification of a corner radius, r. Several programs need to relate user data to colors, shades, or even patterns. For instance, programs that read 2-D gridded data sets and create colored images or shaded reliefs need to be told what colors to use and over what z -range each color applies.

Other programs may need to associate a user value with a color to be applied to a symbol, line, or polygon. This is the purpose of the color palette table CPT. For most applications, you will simply create a CPT using the tool makecpt which will take an existing dynamic master color table and stretch it to fit your chosen data range, or use grd2cpt to build a CPT based on the data distribution in one or more given grid files.

However, in rare situations you may need to make a CPT by hand or using text tools like awk or perl. Color palette tables CPT comes in two flavors: 1 Those designed to work with categorical data e. In both cases the fill information follows the format given in Section Specifying area fill attributes. Since GMT supports several coordinate systems for color specification, many master or user CPTs will contain the special comment. Categorical data are information on which normal numerical operations are not defined.

As an example, consider various land classifications desert, forest, glacier, etc. For such data a special format of the CPTs are provided. Here, each category is assigned a unique key, a color or pattern, and an optional label usually the category name marked by a leading semi-colon. Keys must be monotonically increasing but do not need to be consecutive. The format is. For usage with points, lines, and polygons, the keys may be text single words , and then GMT will use strings to find the corresponding Fill value.

If any of your keys are called B, F, or N you must escape them with a leading backslash to avoid confusion with the flags for background, foreground and NaN colors. The Fill information follows the format given in Section Specifying area fill attributes. For categorical data, background color or foreground color do not apply. The not-a-number NaN color for key -values not found or blank is defined in the gmt. Colors in GMT are specified in the RGB system used for computer screens; it mixes red, green, and blue light to achieve other colors.

The RGB system is a Cartesian coordinate system and produces a color cube. For reasons better explained in Appendix I in the Reference book it is difficult to darken and brighten a color based on its RGB values and an alternative coordinate system is used instead; here we use the HSV system.

If you hold the color cube so that the black and white corners are along a vertical axis, then the other 6 corners project onto the horizontal plane to form a hexagon; the corners of this hexagon are the primary colors Red, Yellow, Green, Cyan, Blue, and Magenta. The CMY colors are the complimentary colors and are used when paints are mixed to produce a new color this is how printers operate; they also add pure black K to avoid making gray from CMY.

Suffice it to say here that we intend to darken any pure color on the cube facets by keeping H fixed and adding black and brighten it by adding white; for interior points in the cube we will add or remove gray. Once a CPT has been made it is relatively straightforward to generate a color image of a gridded data. Using grdinfo we find that the data ranges from about m to about m so we make a CPT accordingly:.

Color images are made with grdimage which takes the usual common command options by default the -R is taken from the data set and a CPT; the main other options are:. Your plot should look like our example 15 below. The plain color map lacks detail and fails to reveal the topographic complexity of this Rocky Mountain region. What it needs is artificial illumination. Other than the required input and output filenames, the available options are. The GMT inverse tangent transformation shows that raw slopes from bathymetry tend to be far from normally distributed left.

By using the inverse tangent transformation we can ensure a more uniform distribution right. How the inverse tangent operation works. Raw slope values left are processed via the inverse tangent operator, turning tan x into x and thus compressing the data range. The transformed slopes are more normally distributed right.

Personally, we prefer to use the -Ne option; the value of norm is subjective and you may experiment somewhat in the 0. For our case we choose. Your plot should look like our example 16 below. Climate data, like ocean temperatures or atmospheric pressure, are often provided as multi-dimensional 3-D, 4-D or 5-D grids in netCDF format.

The file in question is named otemp. You can look at the information pertained in this file using the program ncdump and notice that the variable that we want to plot otemp is a four-dimensional variable of time, level i. We do this as follows:. Let us focus on the temperatures in Summer that is the third season, July through September at sea level that is the first level.

To plot these in a Mollweide projection we use:. Make sure to put the whole file name within quotes since the characters? Your plot should look like our example 17 below.

Our final undertaking in this tutorial is to examine three-dimensional perspective views. The GMT module that produces perspective views of gridded data files is grdview. It can make two kinds of plots:. Mesh plots work best on smaller data sets. Your plot should look like our example 18 below. We will make a perspective, color-coded view of the US Rockies from the southeast. This is done using. Your plot should look like our example 19 below. This plot is pretty crude since we selected 50 dpi but it is fast to render and allows us to try alternate values for vantage point and scaling.

When we settle on the final values we select the appropriate dpi for the final output device and let it rip. Three different types of input are recognized more details can be found in Appendix B in the Technical Reference : Data tables. Short-hand notation to select previously used option arguments stored in gmt. Implicitly using GMT defaults for a variety of parameters stored in gmt.

May use hidden support data like coastlines or PostScript patterns. Data Table s. Gridded data set s. Warnings and Errors, written to stderr. Exit status 0 means success, otherwise failure.

Matches any single character list Matches characters in the list range Matches characters in the given range. Result of GMT Tutorial example 1. Result of GMT Tutorial example 2. In addition to the common switches we may need to use some of several pscoast-specific options: Option Purpose -A Exclude small features or those of high hierarchical levels see Appendix K -D Select data resolution b ull, h igh, i ntermediate, l ow, or c rude -G Set color of dry areas default does not paint -I Draw rivers chose features from one or more hierarchical categories -L Plot map scale length scale can be km, miles, or nautical miles -N Draw political borders including US state borders -S Set color for wet areas default does not paint -W Draw coastlines and set pen thickness.

Result of GMT Tutorial example 3. Result of GMT Tutorial example 4. Result of GMT Tutorial example 5. Result of GMT Tutorial example 6. Result of GMT Tutorial example 7.

Result of GMT Tutorial example 8. Result of GMT Tutorial example 9. Let the deep earthquakes be cyan instead of blue. Creates one composite character of the next two characters Prints the sign itself. Result of GMT Tutorial example We distinguish between two scenarios: The x, y, z data are available on a regular lattice grid. The x, y, z data are distributed unevenly in the plane. Option Purpose -S radius [ u ] Sets search radius.

Append u for radius in that unit [Default is x -units] -E empty Assign this value to unconstrained nodes [Default is NaN] -N sectors Sector search, indicate number of sectors [Default is 4] -W Read relative weights from the 4th column of input data. Option Purpose -A aspect Sets aspect ratio for anisotropic grids. In addition to the required -R and -I switches, these preprocessors all take the same options shown below: Option Purpose -r Choose pixel node registration [Default is gridline] -W [ i o ] Append i or o to read or write weights in the 4th column.

These are Color tables and pseudo-colors in GMT. Artificial illumination and how it affects colors. Multi-dimensional grids. CPTs can be created in any number of ways. GMT provides two mechanisms: Create simple, linear color tables given a master color table several are built-in and the desired z -values at color boundaries makecpt Create color tables based on a master CPT color table and the histogram-equalized distribution of z -values in a gridded data file grd2cpt One can also make these files manually or with awk or other tools.

Option Purpose -E dpi Sets the desired resolution of the image [Default is data resolution] -I intenfile Use artificial illumination using intensities from intensfile -M Force gray shade using the television YIQ conversion.

Insert t to normalize by the inverse tangent transformation. Insert e to normalize by the cumulative Laplace distribution. It can make two kinds of plots: Mesh or wire-frame plot with or without superimposed contours Color-coded surface with optional shading, contours, or draping.

This option allows for -W -Qi dpi [ g ] Image by scan-line conversion. Specify dpi ; append g to force gray-shade image. Table of Contents 1. Introduction 1. GMT overview: History, philosophy, and usage 1. Historical highlights 1. Philosophy 1. GMT installation considerations 2. Session One 2. Tutorial setup 2. Input data 2. Job Control 2. Output data 2. Redirection 2. Piping 2. Standard error stderr 2. Laboratory Exercises 2. Linear projection 2. Logarithmic projection 2. Mercator projection 2.

Albers projection 2. Orthographic projection 2. Eckert IV and VI projection 3. Session Two 3. General Information 3. More exercises 3. Plotting text strings 4.

Session Three 4. Contouring gridded data sets 4. Gridding of arbitrarily spaced data 4. Nearest neighbor gridding 4. Gridding with Splines in Tension 4. Preprocessing 5. Session Four 5. Examples are yyyyWwwd, yyyy-Www, etc. This template is then used to guide the plotting of date strings in data fields. This template is then used to guide the writing of date strings in data fields. As examples, try yyyyWww, yy-W-ww-d, etc. If your template starts with a leading hyphen - then each integer item y,m,d will be printed without leading zeros default uses fixed width formats [yyyy-mm-dd].

If the format is simply - then no date is output and the ISO T divider between date and clock is omitted. This template is then used to guide the plotting of geographical coordinates in data fields. In addition, you can append A which plots the absolute value of the coordinate. The default is ddd:mm:ss. Not all items may be plotted as this depends on the annotation interval. To give some columns a separate format, supply one or more comma-separated cols : format specifications, where cols can be specific columns e.

The last specification without column information will override the format for all other columns. Alternatively, you can list N space-separated formats and these apply to the first N columns. Choose among full , abbreviated , and character. If the leading f , a , or c are replaced with F , A , and C the entire annotation will be in upper case [full].

Default is on but you can turn this off by setting it to off. Specify either 4 or 5. If 4 is set we will parse obsolete GMT 4 options and issue warnings; if 5 is set then parsing GMT 4 only syntax will result in errors [4]. Choose from double, single, [u]long, [u]int, [u]short, and [u]char [double]. In the first case return NaN for any element of x that is outside range [Default]. Second case lets the selected algorithm compute the extrapolation values. Alternatively, provide a directory name, that MUST end with a slash or back slash , to use all shared libraries in that directory.

See the API documentation for how to build your own shared modules. The default FFTW planner flag is estimate , i. Note: if you need a single transform of a given size only, the one-time cost of the smart planner becomes significant. In that case, stick to the default planner, estimate , based on heuristics.

The different values for this setting are: true , readonly , false , to either read and write to the gmt. Note that Shewchuk is required for operations involving Voronoi constructions. Choose among 6 levels; each level adds to the verbosity of the lower levels: q uiet, n normal errors and warnings , c ompatibility warnings, v erbose progress reports, l ong verbose progress reports, d ebugging messages [c]. Choose from tab, space, comma, and none [tab]. By default, such single-segment headers are only written if the header has contents.

Choose from always, never, or maybe [maybe]. The 2-letter format indicator can be one of [ abcegnrs ][ bsifd ]. When invalid is omitted the appropriate value for the given format is used NaN or largest negative. If false, no filename expansion is done [false]. If this marker should be different for output then append another character for the output header record marker.

The two characters must be separated by a comma. IN means only input has y,x , while OUT means only output should be y,x. Note: This will skip the specified number of records regardless of what they are.

Since any records starting with is automatically considered a header you will only specify a non-zero number in order to skip headers that do not conform to that convention. Choose between skip , which will simply report how many bad records were skipped, and pass [Default], which will pass these records on to the calling programs. For most programs this will result in output records with NaNs as well, but some will interpret these NaN records to indicate gaps in a series; programs may then use that information to detect segmentation if applicable.



0コメント

  • 1000 / 1000