mbrolltimelag(1)

NAME
mbrolltimelag - Calculates cross correlation between the apparent bottom slope in swath bathymetry data and the roll time series used by the sonar in order to assess attitude time lag problems.

VERSION
Version 5.0

SYNOPSIS
mbrolltimelag -Iswathdata [-Fformat -Krollsource -Nnping -Ooutroot -Snavchannel -Tnlag/lagmin/lagmax -V -H ]

DESCRIPTION
MBrolltimelag is an utility used to assess relative time errors, or time lag, between the ping timestamps of swath bathymetry data and the sonar attitude (roll and pitch) used in calculating the bathymetry. For any sonar ping, a roll error will cause the acrosstrack bathymetry profile to rotate vertically so that it is too shallow on one side of the swath and too deep on the other. Consequently, if no correction is made for the roll of the sonar, then the bathymetry data will appear to be ruffled in the outer swath. If the timestamps of the roll and ping data are consistent, then correcting for roll will produce bathymetry without these pronounced across-track artifacts. If, however, there is a lag between the two sets of time stamps, then the roll values used for correction will be incorrect, and the ruffles will still occur. In order to determine the amount of time lag, if any, associated with a swath bathymetry dataset, this program calculates the cross correlation between the roll signal and the apparent bottom slope in the case of no roll correction (in practice this latter value is found by subtracting the applied roll value from the apparent acrosstrack bottom slope). If the seafloor is planar so that the apparent slope signal is dominated by roll error, then there will be a distinct peak in the cross correlation function at the actual time lag. MBrolltimelag reads one or more swath sonar data files containing bathymetry data and calculates many cross correlation functions. The number of pings used for each calculation is specified with the -Nnping option. The range of time lags used and the number of lag values are all specified using the -Tnlag/lagmin/lagmax option. The cross correlation functions are output to a file named "swathdata_xcorr.txt", where swathdata is the input file or datalist specified with the -Iswathdata option. The macro mbm_xyplot is also called to generate a plot shellscript that, if run, will generate a postscript plot of the correlation functions.

AUTHORSHIP
David W. Caress (caress@mbari.org)
  Monterey Bay Aquarium Research Institute
Dale N. Chayes (dale@ldeo.columbia.edu)
  Lamont-Doherty Earth Observatory

OPTIONS

-F  format
    Sets the MBIO integer format identifier for the input file specified with the -I option. By default, mbrolltimelag infers the format from the "*.mbXX" MB-System suffix convention.

-H  This "help" flag cause the program to print out a description of its operation and then exit immediately.

-I  filename
    Sets the input filename. If format > 0 (set with the -F option) then the swath sonar data contained in infile is read and processed. If format < 0, then infile is assumed to be an ascii file containing a list of the input swath sonar data files to be processed and their formats. The program will read and process the data in each one of these files. Each input file will have an associated output file with either the ".sga" or ".aga" suffix. In the infile file, each data file should be followed by a data format identifier, e.g.:
         datafile1 11
         datafile2 24
    This program uses the MBIO library and will read any swath sonar format supported by MBIO. A list of the swath sonar data formats currently supported by MBIO and their identifier values is given in the MBIO manual page. Default: infile = "datalist.mb-1".

-K  Krollsource
    This option sets the type of data record from which the roll values will be extracted. By default, the roll values are extracted from survey data records. If the -S option is used, the roll data will be extracted from primary or ancilliary navigation records. If this -K option is set, then the roll data will be extracted from data records of type Krollsource, where the possible values are listed here:
         MB_DATA_DATA    1    /* general survey data */
         MB_DATA_CALIBRATE    4    /* Hydrosweep DS */
         MB_DATA_MEAN_VELOCITY    5    /* Hydrosweep DS */
         MB_DATA_VELOCITY_PROFILE    6    /* general */
         MB_DATA_NAV    12    /* Simrad, Reson 7k */
         MB_DATA_HEADING    17    /* Simrad, Hypack */
         MB_DATA_ATTITUDE    18    /* Simrad, Hypack, Reson 7k */
         MB_DATA_SSV    19    /* Simrad */
         MB_DATA_NAV1    28    /* ancillary nav system 1 */
         MB_DATA_NAV2    29    /* ancillary nav system 2 */
         MB_DATA_NAV3    30    /* ancillary nav system 3 */
         MB_DATA_MOTION    32    /* Reson 7k */
         MB_DATA_SIDESCAN2    37    /* Reson 7k, XTF */
         MB_DATA_SIDESCAN3    38    /* Reson 7k, XTF */
         MB_DATA_ROLL    40    /* Reson 7k */
         MB_DATA_PITCH    41    /* Reson 7k */
         MB_DATA_NMEA_RMC    48    /* NMEA */
         MB_DATA_NMEA_DBT    49    /* NMEA */
         MB_DATA_NMEA_DPT    50    /* NMEA */
         MB_DATA_NMEA_ZDA    51    /* NMEA */
         MB_DATA_NMEA_GLL    52    /* NMEA */
         MB_DATA_NMEA_GGA    53    /* NMEA */
         MB_DATA_ATTITUDE1    55    /* ancillary attitude system 1 */
         MB_DATA_ATTITUDE2    56      /* ancillary attitude system 2 */
         MB_DATA_ATTITUDE3    57    /* ancillary attitude system 3 */
    A typical value is Krollsource=18, which specifies extraction of roll from asynchronous attitude data records. This option supercedes the -S option.

-N  nping
    Sets the number of pings to be read for each cross correlation calculation. Default: nping = 50.

-O  outroot
    Sets the root of the output filenames. Default: output root is is the input filename minus any MB-System filename suffixe (e.g. the root derived from "datalistp.mb-1" will be "datalist").

-S  navchannel
    Sets MBrolltimelag to read the roll data from navigation records rather than the record type listed as the "navigation source" for a particular data format. Swath data formats may contain synchronous navigation (navigation is included in survey data records), asynchronous navigation (navigation comes in records separate from and at different times than the survey data records), or both (survey records contain merged navigation while the original asynchronous navigation is preserved in separate navigation records). Some data formats provide for multiple navigation sources, so that there are more than one channel of asynchronous data records. In this case one channel is always designated as the primary or active navigation channel. The -S option allows the user to specify that MBrolltimelag uses roll from the primary asynchronous navigation (-N0) or from one of three auxiliary navigation channels (-N1, -N2, or -N3). If -N is used but the data file does not contain asynchronous navigation or the specified auxiliary navigation channels, then mbnavlist will output nothing. To determine if a datafile contains asynchronous navigation and/or auxiliary navigation, run mbinfo using its -N option to get counts of all data record types in the file. Default: navchannel = 1.

-T  nlag/lagmin/lagmax
    Sets the time lag values used for the cross correlation calculations. A total of nlag cross correlation values will be calculated evenly spaced from lagmin seconds to lagmax seconds. Default: nlag = 41, lagmin = -2.0 seconds, lagmax = 2.0 seconds.

-V  The -V option causes the program to be verbose.

EXAMPLE
Suppose you want to evaluate the possible roll time lag in a collection of Reson 7125 files referenced by a datalist called datalistp.mb-1. The sonar was pinging at 2Hz (twice a second), and roll is available at 10 Hz in asynchronous navigation records that can be accessed with navchannel = 2. We choose to calculate the cross correlation with time lags separated by 0.1 seconds from -2.0 to 2.0 seconds. The following will suffice:
     mbrolltimelag -Idatalistp.mb-1 -N41/-2.0/2.0 -S2 -V

SEE ALSO
mbsystem(1)

BUGS
Da.