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

NAME

6       mgd77sniffer - Scan for errors in MGD77 data
7

SYNOPSIS

9       mgd77sniffer  NGDC-ids  [  -Afieldabbrev,scale,offset  ] [ -Cmaxspd ] [
10       -Dd|e|f|l|m|s|v ][r] [ -gfieldabbrev,imggrid,scale,mode ] [  -Gfieldab‐
11       brev,grid ] [ -H[i][nrec] ] [ -Ifieldabbrev,rec1,recN ] [ -K ] [ -Lcus‐
12       tom  limits  file  ]  [  -N   ]   [   -Q[b|c|l|n][[/]threshold]   ]   [
13       -Rwest/east/south/north[r]   ]  [  -Sd|s|t  ]  [  -Tgap  ]  [  -V  ]  [
14       -Wc|g|o|s|t|v|x ] [ -bo[s|S|d|D[ncol]|c[var1/...]] ]
15

DESCRIPTION

17       mgd77sniffer scans old (pre-Y2K) and new format MGD77 files for  errors
18       using  point-by-point  sanity checking, along-track detection of exces‐
19       sive slopes, and optional comparison of cruise data with global gravity
20       and  predicted  bathymetry  grids. Detected data problems are output by
21       default as verbose descriptions of each detected error, often resulting
22       in  multiple  messages per scanned record. Data problems are optionally
23       output (-De option) using a computer-parseable format  (see  E77  ERROR
24       FORMAT  description  below).  Default error thresholds are derived from
25       histograms of all MGD77 geophysical data  collected  between  1952  and
26       January, 2006. Thresholds are adjustable with the -L option.
27
28       NGDC-ids
29              Can be one or more of five kinds of specifiers:
30              1) 8-character NGDC IDs, e.g., 01010083, JA010010etc., etc.
31              2) 2-character <agency> codes which will return all cruises from
32              each agency.
33              3) 4-character <agency><vessel> codes,  which  will  return  all
34              cruises from those vessels.
35              4) =<list>, where <list> is a table with NGDC IDs, one per line.
36              5)  If  nothing  is  specified we return all cruises in the data
37              base.
38              (See mgd77info -F for agency and vessel codes).  The ".mgd77" or
39              ".nc"  extensions will automatically be appended, if needed (use
40              -I to ignore certain file types).  Cruise files will  be  looked
41              for first in the current directory and second in all directories
42              listed in $MGD77_HOME/mgd77_paths.txt [If $MGD77_HOME is not set
43              it will default to $GMT_SHAREDIR/mgd77].
44

REQUIREMENTS

46       The  mgd77sniffer  links  with Generic Mapping Tools 4.0 or later along
47       with   the   supplemental   GMT   packages   x2sys   and   mgd77.   See
48       http://gmt.soest.hawaii.edu  for GMT details. Grids for comparison with
49       cruise data may be downloaded via the web.
50

OPTIONS

52       -A     Apply scale factor and DC adjustment to  specified  data  field.
53              Allows  adjustment of cruise data prior to along-track analysis.
54              CAUTION: data must be thoroughly examined before applying  these
55              global data adjustments. May not be used for multiple cruises.
56
57       -C     Set  maximum  ship  speed  in m/s, or knots with -N option. Ship
58              speeds exceeding 10 m/s (~20 knots) are flagged as excessive  by
59              default.
60
61       -D     Suppress  default  warning output and only dump cruise data row-
62              by-row such as values, gradients, grid-cruise  differences,  E77
63              error  summaries  for  each  record, re-created MGD77 records or
64              sniffer limits. Append r to include all records  (default  omits
65              records where navigation errors were detected).
66
67              -Dd output differences between cruise and grid data. Requires -G
68              option. Output columns include:
69
70              lat lon dist cruiseZ gridZ diff [cruiseZ2 gridZ2 diff2 ...]
71
72              Note: grid values are subtracted from cruise data so a  positive
73              difference implies cruise > grid.  For multiple grid comparison,
74              cruiseZ gridZ diff are repeated for each grid comparison in com‐
75              mand line order.
76
77              -De  output  E77  error  classification  format. Error output is
78              divided into (1) a header containing information globally appli‐
79              cable to the cruise and (2) individual error records summarizing
80              all errors  encountered  in  each  cruise  record.  mgd77sniffer
81              writes  E77 directly to <ngdc_id.e77> file handle. See E77 ERROR
82              FORMAT below for additional details.
83
84              -Df output delta Z (change  in  geophysical  field)  column  and
85              delta  S  (change  in distance) for each geophysical field. Dis‐
86              tance between observations often  differ  for  different  fields
87              depending  on  instrument  sampling  rate, so ds is included for
88              each geophysical observation. Output columns include:
89
90              d[twt] ds d[depth] ds d[mtf1] ds d[mtf2] ds d[mag] ds d[diur] ds
91              d[msd] ds d[gobs] ds d[eot] ds d[faa] ds
92
93              -Dl display mgd77sniffer limits. Customize this output to create
94              a custom limits file for the -L option. No additional  arguments
95              are required. Output columns include:
96
97              fieldabbrev min max maxSlope maxArea
98
99              -Dm output MGD77 format records in Y2K-compliant MGD77 format
100
101              -Ds  output  calculated  gradients  for  speed  and  geophysical
102              fields. Gradients correspond to the gradient  type  selected  in
103              the  -S  option (spatial derivatives by default). Output columns
104              include:
105
106              speed d[twt] d[depth]  d[mtf1]  d[mtf2]  d[mag]  d[diur]  d[msd]
107              d[gobs] d[eot] d[faa]
108
109              See  MGD77 FIELD INFO below for field and abbreviations descrip‐
110              tions.
111
112              -Dv display values  for  the  twelve  position  and  geophysical
113              fields for each MGD77 data record (in this order):
114
115              lat lon twt depth mtf1 mtf2 mag diur msens gobs eot faa
116
117              See below for MGD77 FIELD INFO.
118
119       -g     Compare cruise data to the specified grid in Sandwell/Smith Mer‐
120              cator format. Requires a valid  MGD77  field  abbreviation  (see
121              MGD77 FIELD INFO below) followed by a comma, the path (if not in
122              current directory) and grid filename, a scale  to  multiply  the
123              data (1 or 0.1), and mode which stand for the following: (0) Img
124              files with no constraint code, returns data at all  points,  (1)
125              Img  file with constraints coded, return data at all points, (2)
126              Img file with constraints coded, return data only at constrained
127              points  and  NaN  elsewhere,  and  (3) Img file with constraints
128              coded, return 1 at constraints and 0 elsewhere.
129
130       -G     Compare cruise data to the  specified  grid.  Requires  a  valid
131              MGD77  field  abbreviation (see MGD77 FIELD INFO below) followed
132              by a comma, then the path (if not in current directory) and grid
133              filename.  Multiple  grid comparison is supported by using sepa‐
134              rate -g or -G calls for each grid. See GRID FILE INFO below.
135
136              Grid comparison activates several additional error  checks.  (1)
137              Re-weighted  Least  Squares  Regression of ship versus grid data
138              determines  slope  and  DC  shift,  which  when  differing  from
139              expected  1 and 0, respectively, may indicate incorrectly scaled
140              ship data, including incorrect units or instrument drift as well
141              as  erroneous  gravity tie-in. (2) Accumulated ship grid offsets
142              are computed  along-track  and  excessive  offsets  are  flagged
143              according   to  maxArea  threshold  (use  -L  option  to  adjust
144              maxArea). Warning: predicted bathymetry grids are constrained by
145              cruise data so grids and cruise data are not always independent.
146              Comparison of cruise bathymetry with predicted bathymetry  grids
147              also activates a "navigation crossing over land" check.
148
149
150       -H     (with -G|g only) disable (or force) decimation during RLS analy‐
151              sis of ship and gridded data.  By default mgd77sniffer  analyses
152              both  the  full and decimated data sets then reports RLS statis‐
153              tics for the higher correlation regression.
154
155              -Hb analyze both (default), report better of two.
156
157              -Hd to disable data decimation (equivalent to -H with  no  argu‐
158              ment).
159
160              -Hf to force data decimation.
161
162       -I     Append  a  field abbreviation and the first and last record in a
163              range of records that should be flagged as bad (and set  to  NaN
164              prior to the analysis). Repeat as many times as needed.  May not
165              be used for multiple cruises.
166
167       -K     Reverse navigation quality flags (good to bad and  vice  versa).
168              May  be  necessary when a majority of navigation fixes are erro‐
169              neously flagged bad, which can happen when a cruise's first nav‐
170              igation  fix  is  extremely erroneous. Caution! This will affect
171              sniffer output and should only be attempted after careful manual
172              navigation review.
173
174       -L     Override  mgd77sniffer  default  error  detection limits. Supply
175              path and filename to the custom limits file. Rows not  beginning
176              with  a valid MGD77 field abbreviation are ignored. Field abbre‐
177              viations are listed below in exact form under MGD77 FIELD  INFO.
178              Multiple  field  limits  may be modified using one default file,
179              one field per line.  Field min, max, max slope and max area  may
180              be  changed  for  each field. Max slope pertains to the gradient
181              type selected using the -S option. Max area is used  by  the  -G
182              option  as the threshold for flagging excessive offsets from the
183              specified grid.  Dump defaults -Dl to view syntax or to  quickly
184              create an editable custom limits file.
185
186              Example custom default file contents (see below for units):
187              # abbrev min     max     maxSlope    maxArea
188              twt     0       15      1       0
189              depth   0       11000   500    5000
190              mag     -800    800     -     -
191              faa     -300    300     100     2500
192
193              Use  a  dash  '-' to retain a default limit.  Hint: to test your
194              custom limits, try: mgd77sniffer -Dl -L<yourlimitsfile>
195
196       -N     Use nautical units.
197
198       -P     Flag regression statistics that are outside the specified confi‐
199              dence  level.   (i.e.,  -P5  flags coefficients m, b, rms, and r
200              that fall outside 95%.)
201
202       -Q     Quick mode,  use  bilinear  rather  than  bicubic  interpolation
203              [Default].   Alternatively,  select  the  interpolation  mode by
204              adding b for B-spline smooting, c for bicubic  interpolation,  l
205              for  bilinear  interpolation  or  n  for nearest-neighbor value.
206              Optionally, append threshold in the range [0,1].  This parameter
207              controls  how  close  to nodes with NaN values the interpolation
208              will go.  E.g., a threshold of 0.5 will interpolate  about  half
209              way  from a non-NaN to a NaN node, whereas 0.1 will go about 90%
210              of the way, etc. [Default is 1, which means none of  the  (4  or
211              16) nearby nodes may be NaN].  -Q0 will just return the value of
212              the nearest node instead of interpolating.  This is the same  as
213              using -Qn.
214
215       -R     west, east, south, and north specify the Region of interest, and
216              you   may   specify   them   in   decimal    degrees    or    in
217              [+-]dd:mm[:ss.xxx][W|E|S|N]  format.  Append r if lower left and
218              upper right map coordinates are given instead of  w/e/s/n.   The
219              two  shorthands  -Rg  and -Rd stand for global domain (0/360 and
220              -180/+180 in longitude respectively, with -90/+90 in latitude).
221
222       -S     Specify gradient type for along-track excessive slope checking.
223              -Sd Calculate change in z values along  track  (dz).  Output  is
224              given in geophysical units, e.g. mGal.
225              -Ss Calculate spatial gradients (dz/ds). Output is given in geo‐
226              physical units per km along the survey track, e.g. mGal/km.
227              -St Calculate time gradients (dz/dt)  [default]. Output is given
228              in  geophysical  units  per  second along the survey track, e.g.
229              mGal/sec.
230
231       -T     Adjusts mgd77sniffer gap handling. By default, data gaps greater
232              than 5 km are skipped. Set to zero to de-activate gap skipping.
233
234       -W     Print out only certain warning types for verbose error messages.
235              Comma delimit any combination of c|g|o|s|t|v|x: where  (c)  type
236              code  warnings,  (g)radient  out  of  range, (o)ffsets from grid
237              (requires -G|g), (s)peed out of range, (t)ime warnings,  (v)alue
238              out of range, (x) warning summaries. By default ALL warning mes‐
239              sages are printed.Not compatible with any -D options.
240
241       -V     runs in verbose mode.
242
243       -b     output binary data for -Dd|f|s|v option.  Append  s  for  single
244              and d for double precision [Default is double].
245

MGD77 FIELD INFO

247       Field                   Abbreviation            Units
248       Two-way Travel Time     twt                     sec
249       Corrected Depth         depth                   m
250       Mag Total Field1        mtf1                    nT
251       Mag Total Field2        mtf2                    nT
252       Residual Magnetic       mag                     nT
253       Diurnal Correction      diur                    nT
254       Mag Sensor Depth/Alt    msens                   m
255       Observed Gravity        gobs                    mGal
256       Eotvos Correction       eot                     mGal
257       Free Air Anomaly        faa                     mGal
258

GRID FILE INFO

260       For  -g the grids must be in the format used by Sandwell & Smith, which
261       is a spherical Mercator 2-byte grid with no header.  For  -G  the  grid
262       files  can be of any grid type supported by GMT and therefore must con‐
263       tain a GMT header.  A correctly formatted *.i2 grid file can be  gener‐
264       ated using grdraster as shown below.
265
266       gmtset GRIDFILE_SHORTHAND TRUE
267
268       Create/edit .gmt_io file to include the following rows:
269       # GMT I/O shorthand file
270       # suffix   format_id scale offset       NaN
271       grd             0       -       -       -
272       i2              2       -       -       32767
273
274       grdraster 1 -R0/359:55/-90/90 -Getopo5_hdr.i2
275
276       The  new grid, etopo5_hdr.i2 in this example, contains a GMT header and
277       can be used in the -G option to compare cruise depth with grid values.
278

E77 ERROR FORMAT

280       Header Information pertaining to an entire cruise,  such  as  NGDC  and
281              survey  institution  identification  codes,  cruise  examination
282              time, two-way travel time corrector information, data  precision
283              warnings,  as  well as systematic scales, DC shifts and correla‐
284              tion coefficients from global grid comparisons are  reported  as
285              E77 header information.
286
287              Sample
288              #  Cruise  08010039  ID  74010908  MGD77  FILE VERSION: 19801230
289              N_RECS: 3066
290              # Examined: Wed Oct  3 16:30:13 2007 by mtchandl
291              # Arguments:  -De -Gdepth,/data/GRIDS/etopo5_hdr.i2
292              N Errata table verification status
293              # mgd77manage applies corrections if the errata table  is  veri‐
294              fied (toggle 'N' above to 'Y' after review)
295              #    For   instructions   on   E77   format   and   usage,   see
296              http://gmt.soest.hawaii.edu/mgd77/errata.php
297              # Verified by:
298              # Comments:
299              # Errata: Header
300              Y-E-08010039-H13-02: Invalid Magnetics Sampling Rate: (99) [  ]
301              Y-W-08010039-H13-10: Survey year (1975) outside magnetic  refer‐
302              ence field IGRF 1965 time range (1965-1970)
303              Y-I-08010039-depth-00:  RLS  m:  1.00053  b:  0  rms: 127.851 r:
304              0.973422 significant: 1 decimation: 0
305              Y-W-08010039-twt-09: More  recent  bathymetry  correction  table
306              available
307              Y-W-08010039-mtf1-10: Integer precision
308              Y-W-08010039-mag-10: Integer precision
309
310
311       Error Record
312              Individual  error records have strict format. Included is a time
313              or distance column followed by record number, a formatted  error
314              code  string,  and  finally  a  verbose  description  of  errors
315              detected in the record. Three error classes are encoded into the
316              error  code  string  with different alphabetic characters repre‐
317              senting unique error types. See  below  for  error  code  format
318              description.
319
320              Format
321              <time/distance>  <record  number>  <error code string> <descrip‐
322              tion>
323
324              Sample
325              # Errata: Data
326              Y    08010039  1975-05-10T22:16:05.88   74   C-0-0          NAV:
327              excessive speed
328
329
330       Error Code Description
331              Each  of  the three error classes is separated by a dash '-' and
332              described by a combination of alphabetic characters or 0  signi‐
333              fying no detected problems.
334
335              Error classes: NAV-VAL-GRAD
336
337              Error Class Descriptions
338              NAV (navigation):
339              0 - fine
340              A - time out of range
341              B - time decreasing
342              C - excessive speed
343              D - above sea level
344              E - lat undefined
345              F - lon undefined
346
347              VAL (value):
348              0 - fine
349              K - twt invalid
350              L - depth invalid
351              O - mtf1 invalid
352              etc.
353
354              GRAD (gradient):
355              0 - fine
356              K - d[twt] excessive
357              L - d[depth] excessive
358              O - d[mtf1] excessive
359              etc.
360
361              The  NAV error class has unique cases while VAL and GRAD classes
362              are described by  alphabetic  characters  for  each  of  the  24
363              numeric fields in MGD77 format order.
364
365                MGD77 bit-pattern w/ E77 alpha characters
366              |-------------------------------------------------|----------|
367              | X W V U T S R Q P O N M L K J I H G F E D C B A | E77 Code |
368              | - - - - - - - - - - - - - - - - - - - - - - - - | - - - - -|
369              | n f e g m d m m m m b b d t p l l m h d m y t d | F  I     |
370              | q a o o s i s a t t t c e w t o a i o a o e z r | i  D     |
371              | c a t b d u e g f f c c p t c n t n u y n a   t | e        |
372              |       s   r n   2 1     t           r   t r     | l        |
373              |             s           h               h       | d        |
374              | - - - - - - - - - - - - - - - - - - - - - - - - | - - - - -|
375              | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | Bit place|
376              | - G C G C C - G G G - - G G - - - T T T T T - - | Bit type |
377              |-------------------------------------------------|----------|
378                Bit types: (G)eophysical, (C)orrection, (T)ime
379
380

EXAMPLES

382       To scan for excessive values or gradients, try
383
384       mgd77sniffer 08010001
385
386       To dump cruise gradients, try
387
388       mgd77sniffer 08010001 -Ds
389
390       To  compare  cruise  depth  with  ETOPO5  bathymetry  and  gravity with
391       Sandwell/Smith 2 min gravity version 11, try
392
393       mgd77sniffer         08010001         -Gdepth,/data/GRIDS/etopo5_hdr.i2
394       -gfaa,/data/GRIDS/grav.11.2.img,0.1,1
395
396

SEE ALSO

398       mgd77list(1), mgd77track(1) x2sys_init(1)
399

REFERENCES

401       The   Marine   Geophysical   Data   Exchange   Format  -  "MGD77",  see
402       http://www.ngdc.noaa.gov/mgg/dat/geodas/docs/mgd77.txt
403
404       Wessel, P., and W. H. F. Smith, 2006, The Generic Mapping  Tools  (GMT)
405       version 4.1.1 Technical Reference & Cookbook, SOEST/NOAA.
406
407
408
409GMT 4.3.1                         15 May 2008                  MGD77SNIFFER(1)
Impressum