1MGD77LIST(1)                 Generic Mapping Tools                MGD77LIST(1)
2
3
4

NAME

6       mgd77list - A data-extractor for MGD77[+] files
7

SYNOPSIS

9       mgd77list  NGDC-ids  -Fcolumns[,logic][:bittests]  [  -Ac|d|f|mcode ] [
10       -Cf|g|e ] [ -Dastartdate ] [ -Dbstopdate ] [ -E ]  [  -Gastartrec  ]  [
11       -Gbstoprec  ] [ -H[i][nrec] ] [ -Iignore ] [ -X[corrtable] ] [ -M[flag]
12       ] [ -Nd|sunit ] [ -Qa|vmin/max ] [ -Rwest/east/south/north[r] ] [ -Sas‐
13       tartdist[unit] ] [ -Sbstopdist[unit] ] [ -T[m|e] ]  [ -V ] [ -Wweight ]
14       [ -Z+|- ] [ -bo[s|S|d|D[ncol]|c[var1/...]] ]
15

DESCRIPTION

17       mgd77list reads <NGDC-id>.[mgd77|nc] files and produces  an  ASCII  [or
18       binary]  table.   The <NGDC-id>.[mgd77|nc] files contain track informa‐
19       tion such as leg-id, time and position, geophysical observables such as
20       gravity,  magnetics,  and bathymetry, and control codes and corrections
21       such as Eotvos and diurnal corrections.   The  MGD77+  extended  netCDF
22       files may also contain additional user columns (for a listing of avail‐
23       able columns, use mgd77info -C, and to learn how to add your own custom
24       columns,  see  mgd77manage).   The  user may extract any combination of
25       these parameters, any of six computed  quantities  (distance,  heading,
26       velocity,  Carter correction, and gravity and magnetic global reference
27       fields), calendar sub-units of time (year, month, day, hour, min, sec),
28       the  NGDC  id, and finally a preset weight (see -W).  A sub-section can
29       be specified by passing time- or distance-intervals along track  or  by
30       selecting  a  geographical  region.  Finally, each output record may be
31       required to pass any number of logical tests involving data  values  or
32       bit flags.
33
34
35       NGDC-ids
36              Can be one or more of five kinds of specifiers:
37              1) 8-character NGDC IDs, e.g., 01010083, JA010010etc., etc.
38              2) 2-character <agency> codes which will return all cruises from
39              each agency.
40              3) 4-character <agency><vessel> codes,  which  will  return  all
41              cruises from those vessels.
42              4) =<list>, where <list> is a table with NGDC IDs, one per line.
43              5)  If  nothing  is  specified we return all cruises in the data
44              base.
45              (See mgd77info -F for agency and vessel codes).  The ".mgd77" or
46              ".nc"  extensions will automatically be appended, if needed (use
47              -I to ignore certain file types).  Cruise files will  be  looked
48              for first in the current directory and second in all directories
49              listed in $MGD77_HOME/mgd77_paths.txt [If $MGD77_HOME is not set
50              it will default to $GMT_SHAREDIR/mgd77].
51
52       -F     The  required  columns  string must be a comma-separated list of
53              parameter abbreviations given in the desired output order.   Any
54              parameters  given  in UPPER case must not be NaN in a record for
55              output to occur.  Unless specified separately, the output format
56              (if  ASCII)  is  controlled  by the GMT parameter D_FORMAT.  The
57              available abbreviations are:
58
59       drt    The digital record type,  usually  3  or  5  (for  Y2K-compliant
60              cruises).
61
62       id     The survey ID string (leg name).
63
64       ngdcid The 8-character NGDC cruise ID string (usually the file prefix).
65
66       time   Choose  between  Absolute  calendar time (atime, the default) in
67              the format dictated by the  GMT  parameters   OUTPUT_DATE_FORMAT
68              and  OUTPUT_CLOCK_FORMAT, or Relative time (rtime) in the format
69              dictated by the GMT parameters   D_FORMAT  and  TIME_SYSTEM  (or
70              TIME_EPOCH and TIME_UNIT).  Note that if -b is used then time is
71              written as seconds since 1970 (i.e., you ust select  TIME_SYSTEM
72              UNIX to process this data further).
73
74       lon    Longitude  in  the  format  dictated  by  the GMT parameter OUT‐
75              PUT_DEGREE_FORMAT.
76
77       lat    Longitude in the format  dictated  by  the  GMT  parameter  OUT‐
78              PUT_DEGREE_FORMAT.
79
80       twt    Two-Way Travel time (in s).
81
82       depth  Corrected bathymetry (in m, positive below sealevel).
83
84       mtf1   Magnetic Total Field intensity from sensor 1 (in nTesla).
85
86       mtf2   Magnetic Total Field intensity from sensor 2 (in nTesla).
87
88       mag    Residual magnetic anomaly (in nTesla).
89
90       gobs   Observed gravity (in mGal).
91
92       faa    Free-air gravity anomaly (in mGal).
93
94       ptc    Position Type Code (1 = fix, 3 = interpolated, 9 = unspecified).
95
96       bcc    Bathymetric  Correction  Code,  indicating the procedure used to
97              convert travel time to depth.  (01-55 = Matthews' zone  used  to
98              correct the depth, 59 = Matthews' corrections used but the zones
99              is unspecified in the data record, 60 = S. Kuwahara formula  for
100              T-S, 61 = Wilson formula for T-S, 62 = Del Grosso formula for T-
101              S, 63 = Carter's tables, 88 = Other, described  in  header  sec‐
102              tions, 99 = unspecified).
103
104       btc    Bathymetric  Type  Code, indicating how the bathymetry value was
105              obtained (1 = observed, 3 = interpolated, 9 = unspecified).
106
107       msens  Magnetic sensor for used to evaluate the residual field (1 = 1st
108              or leading sensor, 2 = 2nd or trailing sensor, 9 = unspecified).
109
110       msd    Depth (or altitude) of the magnetic sensor (in m, positive below
111              sealevel).
112
113       diur   Magnetic diurnal correction (in nTesla).
114
115       eot    Eotvos correction (in mGal).
116
117       sln    Seismic Line Number string.
118
119       sspn   Seismic Shot Point Number string.
120
121       nqc    Navigation Quality Code (5 = suspected, by source institution, 6
122              = suspected, by NGDC, 9 = no problems identified).
123
124              In addition, the following derived quantities can be requested:
125
126       year   The year of each record.
127
128       month  The month of each record.
129
130       day    The day of the month of each record.
131
132       hour   The hour of each record.
133
134       min    The minutes of each record.
135
136       sec    The decimal seconds of each record.
137
138       dist   Along-track  distance from start of leg.  For method of calcula‐
139              tion, see -C [spherical great circle distances],  and  for  dis‐
140              tance units, see -N [km].
141
142       az     Ship   azimuth  (heading)  measured  clockwise  from  north  (in
143              degrees).
144
145       vel    Ship speed; see -N for units [m/s].
146
147       weight Weight assigned to this data set (see -W).
148
149       carter Carter depth correction, if twt  is  present  in  file  (in  m).
150              Sign:  Correction is to be subtracted from uncorrected depths to
151              yield a corrected depth.
152
153       igrf   International geomagnetic  reference  field  (total  field)  (in
154              nTesla).
155
156       ngrav  International  Gravity  reference  Field  ("normal gravity") (in
157              mGal).  Field is selected based on the parameter  Gravity  Theo‐
158              retical  Formula  Code in the cruise's MGD77 header.  If this is
159              not set or is invalid we default  to  the  IGF  1980.   Alterna‐
160              tively,  specify  the  field directly using -Af (see that option
161              for more details).
162
163              The following short-hand flags are also recognized:
164
165       all    This returns all data columns in the file.
166
167       mgd77  This results in all 27 MGD77 fields being  written  out  in  the
168              offical MGD77 order.
169
170       geo    This  limits  the  output  to 10 fields (time, lon, lat plus the
171              seven geophysical observations  twt,  depth,  mtf1,  mtf2,  mag,
172              gobs,  and  faa).  By appending + to either of these set we will
173              also append dist, azim, vel, and weight as listed above.
174
175              As an option, logical tests may be added for any of the observa‐
176              tions  by  appending  ,logic, which is itself composed of one or
177              more comma-separated instructions of the form parOPvalue,  where
178              par is one of the parameters listed above, OP is a logical oper‐
179              ator (<, <=, =, !=, >=, >, |), and value is a constant  used  in
180              the  comparison.  Floating point parameters are compared numeri‐
181              cally; character parameters are compared lexically (after  lead‐
182              ing  and trailing blanks have been removed).  The bit comparison
183              (|) means that at least one of the bits in value must be  turned
184              on  in  par.   At  least  one  of the tests must be true for the
185              record to be output, except for tests using UPPER  case  parame‐
186              ters  which  all  must  be  true for output to occur.  Note that
187              specifying a test does not imply that the  corresponding  column
188              will  be  included  in  the output stream; it must be present in
189              columns for that to occur. Note: some of the operators are  spe‐
190              cial  UNIX characters and you are advised to place quotes around
191              the entire argument to -F.
192
193              Finally, for MGD77+ files you may  optionally  append  :bittests
194              which  is  :  (a  colon) followed by one or more comma-separated
195              +-col terms.  This compares  specific  bitflags  only  for  each
196              listed  column.   Here,  +  means  the chosen bit must be 1 (ON)
197              whereas - means it must be 0 (OFF).  All bit tests given must be
198              passed.    By  default,  MGD77+  files  that  have  the  special
199              MGD77_flags column present will use those  flags,  and  observa‐
200              tions  associated with ON-bits (meaning they are flagged as bad)
201              will be set to NaN; append : with  no  trailing  information  to
202              turn this behavior off (i.e., no bit flags will be consulted).
203

OPTIONS

205       No space between the option flag and the associated arguments.
206
207       -A     By  default,  corrected depth (depth), magnetic residual anomaly
208              (mag), free-air gravity anomaly (faa), and the derived  quantity
209              Carter  depth  correction  (carter)  are  all  output  as is (if
210              selected in -F); this option adjusts that behavior.  For each of
211              these  columns  there  are  2-4 ways to adjust the data.  Append
212              c(arter), d(epth), f(aa), or m(ag) and select the code  for  the
213              procedure you want applied.  You may select more than one proce‐
214              dure for a data column by summing their numerical codes  (1,  2,
215              4,  and  8). E.g., -Ac3 will first try method -Ac1 to estimate a
216              Carter correction but if depth is NaN  we  will  next  try  -Ac2
217              which  only  uses  twt.   In  all  cases,  if  any of the values
218              required by an adjustment procedure is NaN then the result  will
219              be NaN.
220
221       -Ac    Determines how the carter correction term is calculated.  Below,
222              C(twt) stands for the Carter-corrected depth (it also depends on
223              lon,  lat),  U(twt,  v) is the uncorrected depth (= twt * v / 2)
224              using as v the "Assumed Sound Velocity" parameter in  the  MGD77
225              header  (if it is a valid velocity, otherwise we default to 1500
226              m/s); alternatively, append your preferred velocity  v  in  m/s,
227              TU(depth,  v)  is the 2-way travel time estimated from the (pre‐
228              sumably) uncorrected depth, and TC(depth) is  the  2-way  travel
229              time  obtained  by  inverting  the  (presumably) corrected depth
230              using the Carter correction formula.  Select from
231              -Ac1[,v]  returns  difference  between  U(twt,  v)   and   depth
232              [Default].
233              -Ac2[,v] returns difference between U(twt, v) and Carter (twt).
234              -Ac4[,v]  returns difference between (assumed uncorrected) depth
235              and Carter (TU(depth)).
236              -Ac8[,v] returns difference between U(TC(depth), v) and depth.
237
238       -Ad    Determines how the depth column output is obtained:
239              -Ad1 returns depth as stored in the data set [Default].
240              -Ad2[,v] returns calculated uncorrected depth U(twt, v).
241              -Ad4 returns calculated corrected depth C(twt).
242
243       -Af    Determines how the faa  column  output  is  obtained.  If  ngrav
244              (i.e., the International Gravity reference Field (IGF), or "nor‐
245              mal gravity") is required it is  selected  based  on  the  MGD77
246              header  parameter  "Theoretical  Gravity  Formula Code"; if this
247              code is not present or is invalid we  default  to  4.   Alterna‐
248              tively,  append the preferred field (1-4) to select 1 (Heiskanen
249              1924), 2 (IGF 1930), 3 (IGF 1967) or 4 (IGF 1980).  Select from
250              -Af1[,field] returns faa as stored in the  data  set  [Default].
251              Optionally, sets the IGF field to use if you also have requested
252              ngrav as an output column in -F.
253              -Af2[,field] returns the difference between gobs and ngrav (with
254              optional field directive).
255
256       -Am    Determines  how the mag column output is obtained.  There may be
257              one or two total field measurements in the file (mtf1 and mtf2),
258              and  the  column msens may state which one is the leading sensor
259              (1 or 2; it may also be undefined).  Select from
260              -Am1 returns mag as stored in the data set [Default].
261              -Am2 returns the difference between mgfx and igrf,  where  x  is
262              the  leading  sensor  (1 or 2) indicated by the msens data field
263              (defaults to 1 if unspecified).
264              -Am4 returns the difference between mgfx and igrf,  where  x  is
265              the  sensor  (2  or  1)  not  indicated  by the msens data field
266              (defaults to 2 if unspecified).
267
268       -C     Append a one-letter code to select the procedure for along-track
269              distance calculation (see -N for selecting units):
270                   f Flat Earth distances.
271                   g Great circle distances [Default].
272                   e Geodesic distances on current GMT ellipsoid.
273
274       -Da    Do   not   list   data   collected  before  startdate  (yyyy-mm-
275              ddT[hh:mm:ss])  [Default is start of cruise].
276
277       -Db    Do  not   list   data   collected   after   stopdate   (yyyy-mm-
278              ddT[hh:mm:ss]). [Default is end of cruise].
279
280       -E     Exact  match:  Only  output records that match all the requested
281              geophysical columns [Default outputs  records  that  matches  at
282              least one of the observed columns].
283
284       -Ga    Do  not  list  records before startrec  [Default is 0, the first
285              record].
286
287       -Gb    Do not list data after stoprec. [Default is the last record].
288
289       -H     Issue a header record with names for each data field.
290
291       -I     Ignore certain data  file  formats  from  consideration.  Append
292              a|c|t  to  ignore MGD77 ASCII, MGD77+ netCDF, or plain tab-sepa‐
293              rated  ASCII  table  files,  respectively.  The  option  may  be
294              repreated  to  ignore  more  than  one format.  [Default ignores
295              none].
296
297       -L     Apply optimal corrections to columns where such corrections  are
298              available.  Append the correction table to use [Default uses the
299              correction table mgd77_corrections.d in the  $MGD77_HOME  direc‐
300              tory].  For the format of this file, see CORRECTIONS below.
301
302       -M     Issue  a  multi-segment  header  record  with cruise ID for each
303              cruise.
304
305       -N     Append d for distance or s for speed, then give the desired unit
306              as  e (meter or m/s), k (km or km/hr), m (miles or miles/hr), or
307              n (nautical miles or knots).  [Default  is  -Ndk  -Nse  (km  and
308              m/s)].
309
310       -Qa    Specify  an accepted range (min/max) of azimuths.  Records whose
311              track azimuth falls outside this range are ignored [0-360].
312
313       -Qv    Specify an accepted range (min/max; or just min if there  is  no
314              upper  limit)  of  velocities.   Records whose track speed falls
315              outside this range are ignored [0-infinity].
316
317       -R     west, east, south, and north specify the Region of interest, and
318              you    may    specify    them   in   decimal   degrees   or   in
319              [+-]dd:mm[:ss.xxx][W|E|S|N] format.  Append r if lower left  and
320              upper  right  map coordinates are given instead of w/e/s/n.  The
321              two shorthands -Rg and -Rd stand for global  domain  (0/360  and
322              -180/+180 in longitude respectively, with -90/+90 in latitude).
323
324       -Sa    Do  not list data that are less than startdist meter along track
325              from port of departure.  Append k for km, m for miles, or n  for
326              nautical miles [Default is 0 meters].
327
328       -Sb    Do  not list data that are more than stopdist meters along track
329              from port of departure.  Append k for km, m for miles, or n  for
330              nautical miles [Default is end of track].
331
332       -T     Turns  OFF the otherwise automatic adjustment of values based on
333              correction terms that are stored in the MGD77+ file and used  to
334              counteract  such things as wrong units used by the source insti‐
335              tution when creating the original  MGD77  file  from  which  the
336              MGD77+  file  derives  (the  option has no effect on plain MGD77
337              ASCII files).  Append m or e to limit the option to the MGD77 or
338              extended columns set only [Default applies to both].
339
340       -V     Selects verbose mode, which will send progress reports to stderr
341              [Default runs "silently"].
342
343       -W     Set the weight for these data.  Weight output option must be set
344              in  -F.  This is useful if the data are to be processed with the
345              weighted averaging techniques offered by blockmean, blockmedian,
346              and blockmode [1].
347
348       -Z     Append the sign you want for depth, carter, and msd values below
349              sea level (-Z- gives negative bathymetry) [Default  is  positive
350              down].
351
352       -bo    Selects  binary output mode (single precision; append d for dou‐
353              ble precision, or use S|D to swap bytes on output)  [Default  is
354              ASCII].   -H  is  ignored if -bo is selected.  Likewise, string-
355              fields cannot be selected.
356

EXAMPLES

358       To  get  a  (distance,  heading,  gravity,  bathymetry)  listing   from
359       01010047.mgd77,  starting at June 3 1971 20:45 and ending at distance =
360       5000 km, use the following command:
361
362       mgd77list 01010047 -Da1971-06-03T20:45 -Sb5000 -Fdist,azim,faa,depth  >
363       myfile.d
364
365       To  make  input for blockmean and surface using free-air anomalies from
366       all the cruises listed in the file cruises.lis, but only the data  that
367       are inside the specified area, and make the output binary:
368
369       mgd77list  `cat  cruises.lis`  -Flon,lat,faa -R-40/-30/25/35 -bo > all‐
370       grav.b
371
372       To extract the locations of depths exceeding 9000 meter that  were  not
373       interpolated  (btc  !=  1)  from  all  the  cruises  listed in the file
374       cruises.lis:
375
376       mgd77list `cat cruises.lis` -F"depth,DEPTH>9000,BTC!=1" > really_deep.d
377
378       To extract dist, faa, and grav12_2 from records whose depths are  shal‐
379       lower  than  3  km and where none of the requested fields are NaN, from
380       all the MGD77+ netCDF files whose cruise ids are  listed  in  the  file
381       cruises.lis, we try
382
383       mgd77list  `cat  cruises.lis` -E -Ia -F"dist,faa,grav12_2,depth<3000" >
384       shallow_grav.d
385
386       To extract dist, faa, and grav12_2 from all  the  MGD77+  netCDF  files
387       whose  cruise ids are listed in the file cruises.lis, but only retrieve
388       records whose bitflag for faa indicates BAD values, we try
389
390       mgd77list  `cat  cruises.lis`  -E  -Ia   -F"dist,faa,grav12_2:+faa"   >
391       bad_grav.d
392
393       To  output  lon,  lat,  mag, and faa from all the cruises listed in the
394       file cruises.lis, but recalculate the two residuals based on the latest
395       reference fields, try:
396
397       mgd77list `cat cruises.lis` -Flon,lat,mag,faa -Af2,4 -Am2 > data.d
398

IGRF

400       The  IGRF  calculations are based on a Fortran program written by Susan
401       Macmillan, British Geological  Survey,  translated  to  C  via  f2c  by
402       Joaquim Luis, U Algarve, and adapted to GMT-style by Paul Wessel.
403

IGF

405       The  equations  used  are  reproduced here using coefficients extracted
406       directly from the source code (let us know if you find errors):
407       (1) g = 978052.0 * [1 + 0.005285 * sin^2(lat) - 7e-6 *  sin^2(2*lat)  +
408       27e-6 * cos^2(lat) * cos^2(lon-18)]
409       (2)  g  =  978049.0  *  [1  +  0.0052884  *  sin^2(lat)  -  0.0000059 *
410       sin^2(2*lat)]
411       (3) g = 978031.846  *  [1  +  0.0053024  *  sin^2(lat)  -  0.0000058  *
412       sin^2(2*lat)]
413       (4) g = 978032.67714 * [(1 + 0.00193185138639 * sin^2(lat)) / sqrt (1 -
414       0.00669437999013 * sin^2(lat))]
415

CORRECTIONS

417       The correction table is an ASCII file with coefficients and  parameters
418       needed  to carry out corrections.  Comment records beginning with # are
419       allowed.  All correction records are of the form
420
421       cruiseID observation correction
422
423       where cruiseID is a NGDC prefix, observation is one  of  the  abbrevia‐
424       tions  for  geophysical observations listed under -F above, and correc‐
425       tion consists of one or more terms that will be summed up and then sub‐
426       tracted  from  the observation before output.  Each term must have this
427       exact syntax:
428
429       factor[*[function]([scale](abbrev[-origin]))[^power]]
430
431       where terms in brackets are optional (the brackets themselves  are  not
432       used but regular parentheses must be used as indicated).  No spaces are
433       allowed except between terms. The factor is the amplitude of the  basis
434       function,  while  the optional function can be one of sin, cos, or exp.
435       The optional scale and origin can be used  to  translate  the  argument
436       (before  giving  it  to the optional function).  The argument abbrev is
437       one of the abbreviations for observations listed above.  If  origin  is
438       given  as T it means that we should replace it with the value of abbrev
439       for the very first record in the file (this is usually  only  done  for
440       time).   If  the  first  record  entry is NaN we revert origin to zero.
441       Optionally, raise the entire expression to the given power, before mul‐
442       tiplying  by  the amplitude.  The following is an example of ficticious
443       corrections to the cruise 99999999, implying the depth should have  the
444       Carter  correction removed, faa should have a linear trend removed, the
445       magnetic anomaly (mag) should be corrected by a strange  dependency  on
446       ship  heading and latitude, and gobs needs to have 10 mGal added (hence
447       given as -10):
448
449       99999999 depth 1.0*((carter))
450       99999999 faa   14.1 1e-5*((time-T))
451       99999999 mag   0.5*cos(0.5*(azim-19))^2 1.0*exp(-1e-3(lat))^1.5
452       99999999 gobs  -10
453

SEE ALSO

455       mgd77convert(1), mgd77info(1), mgd77manage(1), mgd77track(1)
456

REFERENCES

458       Wessel, P., and W. H. F. Smith, 2005, The Generic Mapping  Tools  (GMT)
459       version 4.1 Technical Reference & Cookbook, SOEST/NOAA.
460       Wessel,  P., and W. H. F. Smith, 1998, New, Improved Version of Generic
461       Mapping Tools Released, EOS Trans., AGU, 79 (47), p. 579.
462       Wessel, P., and W. H. F. Smith, 1995, New Version of the  Generic  Map‐
463       ping Tools Released, EOS Trans., AGU, 76 (33), p. 329.
464       Wessel,  P.,  and W. H. F. Smith, 1995, New Version of the Generic Map‐
465       ping Tools Released, http://www.agu.org/eos_elec/95154e.html, Copyright
466       1995 by the American Geophysical Union.
467       Wessel,  P., and W. H. F. Smith, 1991, Free Software Helps Map and Dis‐
468       play Data, EOS Trans., AGU, 72 (41), p. 441.
469       The  Marine  Geophysical  Data   Exchange   Format   -   "MGD77",   see
470       http://www.ngdc.noaa.gov/mgg/dat/geodas/docs/mgd77.txt
471       IGRF, see http://www.ngdc.noaa.gov/IAGA/vmod/igrf.html
472
473
474
475GMT 4.3.1                         15 May 2008                     MGD77LIST(1)
Impressum