mgd77sniffer − Scan for errors in MGD77 data |
mgd77sniffer NGDC-ids [ −Afieldabbrev,scale,offset ] [ −Cmaxspd ] [ −Dd|e|f|l|m|s|v ] [ −gfieldabbrev,imggrid,scale,mode ] [ −Gfieldabbrev,grid ] [ −H[i][nrec] ] [ −Ifieldabbrev,rec1,recN ] [ −N ] [ −Lcustom limits file ] [ −Q[value] [ −Rwest/east/south/north[r] ] [ −Sd|s|t ] [ −Tgap ] [ −V ] [ −Wc|g|o|s|t|v|x ] [ −bo[s|S|d|D][ncol] ] |
mgd77sniffer scans old (pre-Y2K) and new format MGD77 files for errors using point-by-point sanity checking, along-track detection of excessive slopes, and optional comparison of cruise data with global gravity and predicted bathymetry grids. Detected data problems are output by default as verbose descriptions of each detected error, often resulting in multiple messages per scanned record. Data problems are optionally output (−De option) using a computer-parseable format (see E77 ERROR FORMAT description below). Default error thresholds are derived from histograms of all MGD77 geophysical data collected between 1952 and January, 2006. Thresholds are adjustable with the −L option. |
NGDC-ids |
Can be one or more of five kinds of specifiers: |
The mgd77sniffer links with Generic Mapping Tools 4.0 or later along with the supplemental GMT packages x2sys and mgd77. See http://gmt.soest.hawaii.edu for GMT details. Grids for comparison with cruise data may be downloaded via the web. Among the many useful grids are NOAA’s ETOPO2 global topography grid available from the National Geophysical Data Center’s website as well as Sandwell and Smith’s Raw Gravity grid available from Scripps Institution of Oceanography’s website. |
−A |
Apply scale factor and DC adjustment to specified data field. Allows adjustment of cruise data prior to along-track analysis. CAUTION: data must be thoroughly examined before applying these global data adjustments. May not be used for multiple cruises. |
||
−C |
Set maximum ship speed in m/s, or knots with −N option. Ship speeds exceeding 10 m/s (~20 knots) are flagged as excessive by default. |
||
−D |
Suppress default warning output and only dump cruise data row-by-row such as values, gradients, grid-cruise differences, E77 error summaries for each record, re-created MGD77 records or sniffer limits. |
−Dd output differences between cruise and grid data. Requires −G option. Output columns include: lat lon dist cruiseZ gridZ diff [cruiseZ2 gridZ2 diff2 ...] Note: grid values are subtracted from cruise data so a positive difference implies cruise > grid. For multiple grid comparison, cruiseZ gridZ diff are repeated for each grid comparison in command line order. −De output E77 error classification format. Error output is divided into (1) a header containing information globally applicable to the cruise and (2) individual error records summarizing all errors encountered in each cruise record. mgd77sniffer writes E77 directly to <ngdc_id.e77> file handle. See E77 ERROR FORMAT below for additional details. −Df output delta Z (change in geophysical field) column and delta S (change in distance) for each geophysical field. Distance between observations often differ for different fields depending on instrument sampling rate, so ds is included for each geophysical observation. Output columns include: d[twt] ds d[depth] ds d[mtf1] ds d[mtf2] ds d[mag] ds d[diur] ds d[msd] ds d[gobs] ds d[eot] ds d[faa] ds −Dl display mgd77sniffer limits. Customize this output to create a custom limits file for the −L option. No additional arguments are required. Output columns include: fieldabbrev min max maxSlope maxArea −Dm output MGD77 format records in Y2K-compliant MGD77 format −Ds output calculated gradients for speed and geophysical fields. Gradients correspond to the gradient type selected in the −S option (spatial derivatives by default). Output columns include: speed d[twt] d[depth] d[mtf1] d[mtf2] d[mag] d[diur] d[msd] d[gobs] d[eot] d[faa] See MGD77 FIELD INFO below for field and abbreviations descriptions. −Dv display values for the twelve position and geophysical fields for each MGD77 data record (in this order): lat lon twt depth mtf1 mtf2 mag diur msens gobs eot faa See below for MGD77 FIELD INFO. |
−g |
Compare cruise data to the specified grid in Sandwell/Smith Mercator format. Requires a valid MGD77 field abbreviation (see MGD77 FIELD INFO below) followed by a comma, the path (if not in current directory) and grid filename, a scale to multiply the data (1 or 0.1), and mode which stand for the following: (0) Img files with no constraint code, returns data at all points, (1) Img file with constraints coded, return data at all points, (2) Img file with constraints coded, return data only at constrained points and NaN elsewhere, and (3) Img file with constraints coded, return 1 at constraints and 0 elsewhere. |
||
−G |
Compare cruise data to the specified grid. Requires a valid MGD77 field abbreviation (see MGD77 FIELD INFO below) followed by a comma, then the path (if not in current directory) and grid filename. Multiple grid comparison is supported by using separate −g or −G calls for each grid. See GRID FILE INFO below. |
Grid comparison activates several additional error checks. (1) Re-weighted Least Squares Regression of ship versus grid data determines slope and DC shift, which when differing from expected 1 and 0, respectively, may indicate incorrectly scaled ship data, including incorrect units or instrument drift as well as erroneous gravity tie-in. (2) Accumulated ship grid offsets are computed along-track and excessive offsets are flagged according to maxArea threshold (use −L option to adjust maxArea). Warning: predicted bathymetry grids are constrained by cruise data so grids and cruise data are not always independent. Comparison of cruise bathymetry with predicted bathymetry grids also activates a "navigation crossing over land" check. |
−H |
(with −G|g only) disable data decimation during RLS regression. |
||
−I |
Append a field abbreviation and the first and last record in a range of records that should be flagged as bad (and set to NaN prior to the analysis). Repeat as many times as needed. May not be used for multiple cruises. |
||
−L |
Override mgd77sniffer default error detection limits. Supply path and filename to the custom limits file. Rows not beginning with a valid MGD77 field abbreviation are ignored. Field abbreviations are listed below in exact form under MGD77 FIELD INFO. Multiple field limits may be modified using one default file, one field per line. Field min, max, max slope and max area may be changed for each field. Max slope pertains to the gradient type selected using the −S option. Max area is used by the −G option as the threshold for flagging excessive offsets from the specified grid. Dump defaults −Dl to view syntax or to quickly create an editable custom limits file. |
Example custom default file contents (see below for
units): Use a dash ’-’ to retain a default limit. Hint: to test your custom limits, try: mgd77sniffer −Dl −L<yourlimitsfile> |
−N |
Use nautical units. |
||
−Q |
Quick mode, use bilinear rather than bicubic interpolation [Default]. Optionally, append value in the 0 <= value <= 1 range. This parameter controls how close to nodes with NaN values the interpolation will go. E.g., a value of 0.5 will interpolate about 1/2-way from a non-NaN to a NaN node, whereas 0.1 will go about 90% of the way, etc. [Default is 1, which means none of the four nearby nodes may be NaN]. A value of 0 will just return the value of the nearest node instead of interpolating. |
||
−R |
west, east, south, and north specify the Region of interest, and you may specify them in decimal degrees or in [+-]dd:mm[:ss.xxx][W|E|S|N] format. Append r if lower left and upper right map coordinates are given instead of wesn. The two shorthands −Rg −Rd stand for global domain (0/360 or -180/+180 in longitude respectively, with -90/+90 in latitude). |
||
−S |
Specify gradient type for along-track excessive slope checking. |
−Sd Calculate change in z values along track
(dz). Output is given in geophysical units, e.g.
mGal. |
−T |
Adjusts mgd77sniffer gap handling. By default, data gaps greater than 5 km are skipped. Set to zero to de-activate gap skipping. |
||
−W |
Print out only certain warning types for verbose error messages. Comma delimit any combination of c|g|o|s|t|v|x: where (c) type code warnings, (g)radient out of range, (o)ffsets from grid (requires −G|g), (s)peed out of range, (t)ime warnings, (v)alue out of range, (x) warning summaries. By default ALL warning messages are printed.Not compatible with any −D options. |
||
−V |
runs in verbose mode. |
||
−b |
output binary data for −Dd|f|s|v option. Append s for single and d for double precision [Default is double]. |
Field Abbreviation Units |
For −g the grids must be in the format used by Sandwell & Smith, which is a spherical Mercator 2-byte grid with no header. For −G the grid files can be of any grid type supported by GMT and therefore must contain a GMT header. A correctly formatted *.i2 grid file can be generated using grdraster as shown below. gmtset GRIDFILE_SHORTHAND TRUE Create/edit .gmt_io file to include the following
rows: grdraster 1 -R0/359:55/-90/90 -Getopo5_hdr.i2 The new grid, etopo5_hdr.i2 in this example, contains a GMT header and can be used in the −G option to compare cruise depth with grid values. |
Header |
Information pertaining to an entire cruise, such as NGDC and survey institution identification codes, cruise examination time, two-way travel time corrector information, data precision warnings, as well as systematic scales, DC shifts and correlation coefficients from global grid comparisons are reported as E77 header information. |
Sample |
Error Record |
Individual error records have strict format. Included is a time or distance column followed by record number, a formatted error code string, and finally a verbose description of errors detected in the record. Four error classes are encoded into the error code string with different alphabetic characters representing unique error types. See below for error code format description. Format Sample |
1971-04-28T18:27:30 |
345 |
0-0-OQ-0 |
gradient: mtf1, mag excessive |
||||
1971-05-14T18:01:30 |
5413 |
0-0-OQ-0 |
gradient: mtf1, mag excessive |
||||
1971-05-15T03:41:30 |
5634 |
0-Q-0-0 |
value: mag invalid |
Error Code Description |
Each of the four error classes is separated by a dash ’-’ and described by a combination of alphabetic characters or 0 signifying no detected problems. Error classes: NAV-VAL-GRAD-GRID Error Class Descriptions VAL (value): GRAD (gradient): GRID (grid comparison): The NAV error class has unique cases while VAL, GRAD and GRID classes are described by alphabetic characters for each of the 24 numeric fields in MGD77 format order. MGD77 bit-pattern w/ E77 alpha characters |
To scan for excessive values or gradients, try mgd77sniffer 08010001 To dump cruise gradients, try mgd77sniffer 08010001 -Ds To compare cruise depth with ETOPO5 bathymetry and gravity with Sandwell/Smith 2 min gravity version 11, try mgd77sniffer 08010001 −Gdepth,/data/GRIDS/etopo5_hdr.i2 −gfaa,/data/GRIDS/grav.11.2.img,0.1,1 |
mgd77list(l), mgd77track(l) x2sys_init(l) |
The Marine Geophysical Data Exchange Format - "MGD77", see http://www.ngdc.noaa.gov/mgg/dat/geodas/docs/mgd77.txt Wessel, P., and W. H. F. Smith, 2006, The Generic Mapping Tools (GMT) version 4.1.1 Technical Reference & Cookbook, SOEST/NOAA. |