x2sys_datalist

Extract content of track data files

Synopsis

gmt x2sys_datalist track(s) -TTAG [ -A ] [ -E ] [ -Fname1,name2,… ] [ -I[list] ] [ -L[corrtable] ] [ -Rregion ] [ -S ] [ [ -V[level] ] [ -bobinary ] [ -donodata ] [ -hheaders ] [ --PAR=value ]

Note: No space is allowed between the option flag and the associated arguments.

Description

x2sys_datalist reads one or more files and produces a single ASCII [or binary] table. The files can be of any format; this information is encoded in the TAG set with the -T option. You may limit the output to a geographic region, and insist that the output from several files be separated by a multiple segment header. Only the named data fields will be output [Default selects all columns].

Required Arguments

tracks

Can be one or more ASCII, native binary, or COARDS netCDF 1-D data files. To supply the data files via a text file with a list of tracks (one per record), specify the name of the track list after a leading equal-sign (e.g., =tracks.lis). If the names are missing their file extension we will append the suffix specified for this TAG. Track files will be searched for first in the current directory and second in all directories listed in $X2SYS_HOME/TAG/TAG_paths.txt (if it exists). [If $X2SYS_HOME is not set it will default to $GMT_SHAREDIR/x2sys]. (Note: MGD77 files will also be looked for via MGD77_HOME/mgd77_paths.txt and *.gmt files will be searched for via $GMT_SHAREDIR/mgg/gmtfile_paths).

-TTAG

Specify the x2sys TAG which identifies the attributes of this data type.

Optional Arguments

-A

Eliminate COEs by distributing the COE between the two tracks in proportion to track weight. These (dist, adjustment) spline knots files for each track and data column are called track.column.adj and are expected to be in the $X2SYS_HOME/TAG directory. The adjustments are only applied if the corresponding adjust file can be found [No residual adjustments].

-E

Enhance ASCII output by writing GMT segment headers between data from each track [no segment headers].

-Fname1,name2,…

Give a comma-separated sub-set list of column names defined in the format definition file. [Default selects all data columns].

-I[list]

Name of ASCII file with a list of track names (one per record) that should be excluded from consideration [Default includes all tracks].

-L[corrtable]

Apply optimal corrections to columns where such corrections are available. Append the correction table to use [Default uses the correction table TAG_corrections.txt which is expected to reside in the $X2SYS_HOME/TAG directory]. For the format of this file, see CORRECTIONS below.

-Rwest/east/south/north[/zmin/zmax][+r][+uunit]

Specify the region of interest. For Cartesian data just give xmin/xmax/ymin/ymax. This option limits the COEs to those that fall inside the specified domain. The region may be specified in one of six ways:

  1. -Rwest/east/south/north[+uunit]. This is the standard way to specify geographic regions when using map projections where meridians and parallels are rectilinear. The coordinates may be specified in decimal degrees or in [±]dd:mm[:ss.xxx][W|E|S|N] format. Optionally, append +uunit to specify a region in projected units (e.g., UTM meters) where west/east/south/north are Cartesian projected coordinates compatible with the chosen projection (-J) and unit is an allowable distance unit; we inversely project to determine the actual rectangular geographic region.

  2. -Rwest/south/east/north+r. This form is useful for map projections that are oblique, making meridians and parallels poor choices for map boundaries. Here, we instead specify the lower left corner and upper right corner geographic coordinates, followed by the modifier +r. This form guarantees a rectangular map even though lines of equal longitude and latitude are not straight lines.

  3. -Rg or -Rd. These forms can be used to quickly specify the global domain (0/360 for -Rg and -180/+180 for -Rd in longitude, with -90/+90 in latitude).

  4. -Rcode1,code2,…[+e|r|Rincs]. This indirectly supplies the region by consulting the DCW (Digital Chart of the World) database and derives the bounding regions for one or more countries given by the codes. Simply append one or more comma-separated countries using the two-character ISO 3166-1 alpha-2 convention. To select a state within a country (if available), append .state, e.g, US.TX for Texas. To specify a whole continent, prepend = to any of the continent codes AF (Africa), AN (Antarctica), AS (Asia), EU (Europe), OC (Oceania), NA (North America), or SA (South America). The following modifiers can be appended:

    • +r to adjust the region boundaries to be multiples of the steps indicated by inc, xinc/yinc, or winc/einc/sinc/ninc [default is no adjustment]. For example, -RFR+r1 will select the national bounding box of France rounded to nearest integer degree.

    • +R to extend the region outward by adding the amounts specified by inc, xinc/yinc, or winc/einc/sinc/ninc [default is no extension].

    • +e to adjust the region boundaries to be multiples of the steps indicated by inc, xinc/yinc, or winc/einc/sinc/ninc, while ensuring that the bounding box extends by at least 0.25 times the increment [default is no adjustment].

  5. -Rjustifylon0/lat0/nx/ny, where justify is a 2-character combination of L|C|R (for left, center, or right) and T|M|B (for top, middle, or bottom) (e.g., BL for lower left). The two character code justify indicates which point on a rectangular region region the lon0/lat0 coordinates refer to and the grid dimensions nx and ny are used with grid spacings given via -I to create the corresponding region. This method can be used when creating grids. For example, -RCM25/25/50/50 specifies a 50x50 grid centered on 25,25.

  6. -Rgridfile. This will copy the domain settings found for the grid in specified file. Note that depending on the nature of the calling module, this mechanism will also set grid spacing and possibly the grid registration (see Grid registration: The -r option).

-S

Suppress output records where all the data columns are NaN [Default will output all records].

-V[level]

Select verbosity level [w]. (See full description) (See cookbook information).

-bo[ncols][type] (more …)

Select native binary output.

-donodata (more …)

Replace output columns that equal NaN with nodata.

-h[i|o][n][+c][+d][+msegheader][+rremark][+ttitle] (more …)

Skip or produce header record(s).

-^ or just -

Print a short message about the syntax of the command, then exit (NOTE: on Windows just use -).

-+ or just +

Print an extensive usage (help) message, including the explanation of any module-specific option (but not the GMT common options), then exit.

-? or no arguments

Print a complete usage (help) message, including the explanation of all options, then exit.

--PAR=value

Temporarily override a GMT default setting; repeatable. See gmt.conf for parameters.

Examples

To extract all data from the old-style MGG supplement file c2104.gmt, recognized by the tag GMT:

gmt x2sys_datalist c2104.gmt -TGMT > myfile

To make lon,lat, and depth input for blockmean and surface using all the files listed in the file tracks.lis and defined by the tag TRK, but only the data that are inside the specified area, and make output binary, run

gmt x2sys_datalist =tracks.lis -TTRK -Flon,lat,depth -R40/-30/25/35 -bo > alltopo_bin.xyz

Corrections

The correction table is an ASCII file with coefficients and parameters needed to carry out corrections. This table is usually produced by x2sys_solve. Comment records beginning with # are allowed. All correction records are of the form

trackID observation correction

where trackID is the track name, observation is one of the abbreviations for an observed field contained in files under this TAG, and correction consists of one or more white-space-separated terms that will be subtracted from the observation before output. Each term must have this exact syntax:

factor[*[function]([scale](abbrev[-origin]))[^power]]

where terms in brackets are optional (the brackets themselves are not used but regular parentheses must be used exactly as indicated). No spaces are allowed except between terms. The factor is the amplitude of the basis function, while the optional function can be one of sin, cos, or exp. The optional scale and origin can be used to translate the argument (before giving it to the optional function). The argument abbrev is one of the abbreviations for columns known to this TAG. However, it can also be one of the three auxiliary terms dist (for along-track distances), azim for along-track azimuths, and vel (for along-track speed); these are all sensitive to the -C and -N settings used when defining the TAG; furthermore, vel requires time to be present in the data. If origin is given as T it means that we should replace it with the value of abbrev for the very first record in the file (this is usually only done for time). If the first data record entry is NaN we revert origin to zero. Optionally, raise the entire expression to the given power, before multiplying by factor. The following is an example of fictitious corrections to the track ABC, implying the z column should have a linear trend removed, the field obs should be corrected by a strange dependency on latitude, weight needs to have 1 added (hence correction is given as -1), and fuel should be reduced by a linear distance term:

ABC z 7.1 1e-4*((time-T))

ABC obs 0.5*exp(-1e-3(lat))^1.5

ABC weight -1

ABC fuel 0.02*((dist))