mbprocess(1)

NAME
mbprocess - this program performs a variety of swath data processing functions in a single step (producing a single output swath data file), including merging navigation, recalculating bathymetry from travel time and angle data by raytracing through a layered water sound velocity model, applying changes to ship draft, roll bias and pitch bias, applying tides, and applying bathymetry edits from edit save files.

VERSION
Version 5.0

SYNOPSIS
mbprocess -Iinfile [-Fformat -N -Ooutfile -P -S -T -V -H]

DESCRIPTION
The program mbprocess is a tool for processing swath sonar bathymetry data. This program can perform a variety of swath data processing functions in a single step (producing a single output swath data file), including:
     - Merge edited navigation generated by mbnavedit.
     - Apply bathymetry edit flags from mbedit
       and mbclean
     - Recalculate bathymetry from raw travel time and
       angle data by raytracing through water sound speed
       models from mbvelocitytool or mbsvplist.
     - Apply changes to roll bias, pitch bias, heading
       bias, and draft values.
     - Recalculate sidescan from raw backscatter samples
       (Simrad multibeam data only).
     - Apply corrections to sidescan based on amplitude vs
       grazing angle tables obtained with mbbackangle.
     - Apply tides to bathymetry.
     - Insert metadata. The actions of mbprocess are controlled by text parameter files. Each mbprocess parameter file contains single line commands that set processing modes and parameters. The program mbset can be used to create and modify mbprocess parameter files. Other programs such as mbedit, mbnavedit, mbvelocitytool, mbnavadjust, and mbclean modify or create (if needed) mbprocess parameter files. The input file "infile" must be specified with the -I option. If "infile" is a datalist, then mbprocess will attempt to process each swath data file identified by recursively reading the datalist. Otherwise, mbprocess will attempt to process "infile" directly. For any swath data file "datafile", the program will look for and use a parameter file with the name "datafile.par". If no parameter file exists, mbprocess will infer a reasonable processing path by looking for navigation and mbedit edit save files.The data format can also be specified, though the program can infer the format if the standard MB-System suffix convention is used (*.mbXX where XX is the MB-System format id number). The processed output swath files produced by mbprocess are named using a convention based on the data format id. MB-System data formats are specified using two-digit or three-digit numbers (see the MBIO manual page). If an input swath data file is named "root.mbXX", where XX is the format id, then the default processed output file will be "rootp.mbXX" (e.g. mydata.mb71 -> mydatap.mb71). The "p" inserted before the ".mbXX" suffix indicates the output file has been created by mbprocess. If the input file does not follow the *.mbXX naming convention, then the output filename will just consist of the input name with "p.mbXX" added as a suffix (e.g. mydata -> mydatap.mb71) By default, mbprocess will only process a swath data file if the processed output file is either missing or out of date relative to the input swath data file, the parameter file, or any of the ancillary data files referred to in the parameter file (e.g. navigation files, edit save files, svp files). If the -P option is specified, mbprocess will process every file, whether it needs it or not.

MBPROCESS PARAMETER FILE COMMANDS
The mbprocess commands found in parameter files are:
 GENERAL PARAMETERS:
   EXPLICIT
        causes mbprocess to set modes implicitely
        - e.g. the SVPFILE command will also set
          raytracing on even if the RAYTRACE command
          is not given [explicit mode commands required]
   FORMAT constant
        sets format id [no default]
   INFILE filename
        sets input file path [no default]
   OUTFILE filename
        sets output file path [no default]
 NAVIGATION MERGING:
   NAVMODE boolean
        sets navigation merging [0]
          0: navigation merge off
          1: navigation merge on
   NAVFILE filename
        sets navigation file path [no default]
   NAVFORMAT constant
        sets navigation file format [9]
     see below for documentation of the
     supported navigation formats
   NAVHEADING boolean
        sets heading to be merged from navigation file
        - note: heading merged from navigation before
          heading correction applied
          0: heading not changed
          1: heading merged from navigation file
   NAVSPEED boolean
        sets speed to be merged from navigation file
          0: speed not changed
          1: speed merged from navigation file
   NAVDRAFT boolean
        sets draft to be merged from navigation file
        - note: draft merged from navigation before
          draft correction applied
          0: draft not changed
          1: draft merged from navigation file
   NAVATTITUDE boolean
        sets roll, pitch and heave to be merged from
        navigation file
        - note: roll, pitch, and heave merged from
          navigation before roll bias and pitch bias
          corrections applied
          0: roll, pitch, and heave not changed
          1: roll, pitch, and heave merged from
             navigation file
   NAVINTERP boolean
        sets navigation interpolation algorithm [0]
          0: linear interpolation (recommended)
          1: spline interpolation
   NAVTIMESHIFT constant
        sets navigation time shift (seconds) [0.0]
        - note: time shift added to timestamps of
          navigation fixes read in from NAVFILE
          prior to merging
 NAVIGATION OFFSETS AND SHIFTS:
   NAVSHIFT boolean
        sets navigation offset [0]
        - note: offsets and shifts are applied to navigation
          values from both survey and navigation records, and
          are applied to navigation read in from
          NAVFILE prior to merging
        - note: offsets and shifts are NOT applied to adjusted
          navigation values from NAVADJFILE
   NAVOFFSETX constant
        sets navigation athwartship offset (meters) [0.0]
        - note: the effective navigation shift is
          (NAVOFFSETX - SONAROFFSETX), and the
          navigation is corrected by subtracting
          this effective shift.
        - note: athwartship shift is positive to
          starboard.
   NAVOFFSETY constant
        sets navigation fore-aft offset (meters) [0.0]
        - note: the effective navigation shift is
          (NAVOFFSETY - SONAROFFSETY), and the
          navigation is corrected by subtracting
          this effective shift.
        - note: fore-aft shift is positive forward.
   NAVOFFSETZ constant
        sets navigation vertical offset (meters) [0.0]
        - note: this value is not yet used for
          anything.
        - note: vertical shift is positive down.
   NAVSHIFTLON constant
        sets navigation longitude shift (degrees) [0.0]
   NAVSHIFTLAT constant
        sets navigation latitude shift (degrees) [0.0]
 ADJUSTED NAVIGATION MERGING:
   NAVADJMODE mode
        sets navigation merging from mbnavadjust [0]
        - can apply to longitude and latitude only
      or longitude, latitude, and depth offset
          0: adjusted navigation merge off
          1: adjusted navigation merge on
          2: adjusted navigation and depth offset merge on
   NAVADJFILE filename
        sets adjusted navigation file path
        - this file supercedes navigation file for
          lon and lat only
        - uses mbnavadjust output
   NAVADJINTERP boolean
        sets adjusted navigation interpolation algorithm [0]
          0: linear interpolation (recommended)
          1: spline interpolation

  ATTITUDE MERGING:
    ATTITUDEMODE mode
        sets attitude (roll, pitch, and heave) merging [0]
        - roll, pitch, and heave merged before
          roll bias and pitch bias corrections applied
        - attitude merging from a separate file supersedes
          attitude merging from a navigation file
          0: attitude merging off
          1: attitude merging on
    ATTITUDEFILE filename
        sets attitude file path
    ATTITUDEFORMAT constant
        sets attitude file format [1]
        - attitude files can be in one of four ASCII
          table formats
          1: format is <time_d roll pitch heave>
          2: format is <yr mon day hour min sec roll pitch heave>
          3: format is <yr jday hour min sec roll pitch heave>
          4: format is <yr jday daymin sec roll pitch heave>
        - time_d = decimal seconds since 1/1/1970
        - daymin = decimal minutes start of day
        - roll = positive starboard up, degrees
        - pitch = positive forward up, degrees
        - heave = positive up, meters

  SONARDEPTH MERGING:
    SONARDEPTHMODE mode
        sets sonardepth merging [0]
        - sonardepth merged before
          draft corrections applied
        - sonardepth merging from a separate file supersedes
          draft merging from a navigation file
          0: sonardepth merging off
          1: sonardepth merging on
    SONARDEPTHFILE filename
        sets sonardepth file path
    SONARDEPTHFORMAT constant
        sets sonardepth file format [1]
        - sonardepth files can be in one of four ASCII
          table formats
          1: format is <time_d sonardepth>
          2: format is <yr mon day hour min sec sonardepth>
          3: format is <yr jday hour min sec sonardepth>
          4: format is <yr jday daymin sec sonardepth>
        - time_d = decimal seconds since 1/1/1970
        - daymin = decimal minutes start of day
        - sonardepth = sonar depth positive down, meters
 DATA CUTTING:
   DATACUTCLEAR
        removes all existing data cutting commands
   DATACUT kind mode min max
        adds new data cutting command, where:
          kind = 0 : cut applied to bathymetry data
          kind = 1 : cut applied to amplitude data
          kind = 2 : cut applied to sidescan data
          mode = 0 : min and max indicate start and end
                     beam/pixel numbers between which data
                     are flagged or zeroed
          mode = 1 : min and max indicate start and end
                     acrosstrack distance (m) between which
                     data are flagged or zeroed
   BATHCUTNUMBER min max
        adds new bathymetry data cutting command where
        min and max are the start and end beam numbers
        between which data are flagged (note that
        flagging bathymetry also flags amplitude data)
   BATHCUTDISTANCE min max
        adds new bathymetry data cutting command where
        min and max are the start and end acrosstrack
        distance (m) between which data are flagged
        (note that flagging bathymetry also flags
        amplitude data)
   BATHCUTSPEED min max
        adds new bathymetry data cutting command where
        all beams are flagged for pings with a ship
        or vehicle speed less than min or greater than
        max (note that flagging bathymetry also flags
        amplitude data)
   AMPCUTNUMBER min max
        adds new amplitude data cutting command where
        min and max are the start and end beam numbers
        between which amplitude data are zeroed (note
        that zeroing amplitude data has no impact on
        bathymetry data)
   AMPCUTDISTANCE min max
        adds new amplitude data cutting command where
        min and max are the start and end acrosstrack
        distance (m) between which amplitude data are
        zeroed (note that zeroing amplitude data has
        no impact on bathymetry data)
   AMPCUTSPEED min max
        adds new amplitude data cutting command where
        all amplitude values are zeroed for pings with
        a ship or vehicle speed less than min or greater
        than max (note that zeroing amplitude data has
        no impact on bathymetry data)
   SSCUTNUMBER min max
        adds new sidescan data cutting command where
        min and max are the start and end pixel numbers
        between which sidescan data are zeroed (note
        that zeroing sidescan data has no impact on
        bathymetry data)
   SSCUTDISTANCE min max
        adds new sidescan data cutting command where
        min and max are the start and end acrosstrack
        distance (m) between which sidescan data are
        zeroed (note that zeroing sidescan data has
        no impact on bathymetry data)
   SSCUTSPEED min max
        adds new sidescan data cutting command where
        all sidescan values are zeroed for pings with
        a ship or vehicle speed less than min or greater
        than max (note that zeroing sidescan data has
        no impact on bathymetry data)
 BATHYMETRY EDITING:
   EDITSAVEMODE boolean
        turns on reading edit save file (from mbedit) [0]
   EDITSAVEFILE filename
        sets edit save file path (from mbedit) [none]
 BATHYMETRY RECALCULATION:
   SVPMODE mode
        sets usage of a water sound speed model (sound
        velocity profile, or SVP) [0]
         0: bathymetry recalculation by raytracing off
         1: bathymetry recalculation by raytracing on
         2: translate depths from corrected to uncorrected
            or vice versa depending on SOUNDSPEEDREF
            command
   SVPFILE filename
        sets SVP file path [no default]
   SSVMODE boolean
        sets surface sound velocity (SSV) mode [0]
         0: use SSV from file
         1: offset SSV from file (set by SSV command)
         2: use constant SSV (set by SSV command)
   SSV constant/offset
        sets SSV value or offset (m/s) [1500.0]
   ANGLEMODE mode
        sets handling of beam angles during
        raytracing [1]
         0: angles not changed before raytracing
         1: angles adjusted using Snell's Law for
            the difference between the surface sound
            velocity (SSV) and the sound speed at
            the sonar depth in the SVP.
         2: angles adjusted using Snell's Law and
            the sonar array geometry for the
            difference between the surface sound
            velocity (SSV) and the sound speed at
            the sonar depth in the SVP.
   TTMULTIPLY multiplier
        sets value multiplied by travel times [1.0]
   SOUNDSPEEDREF boolean
        determines the handling of the sound
        speed reference for bathymetry [1]
        - note: if raytracing is turned off then
          this command implies correcting or
          uncorrecting using the SVP specified
          with the SVPFILE command
         0: produce "uncorrected" bathymetry
            referenced to a uniform 1500 m/s
            water sound speed model.
         1: produce "corrected" bathymetry
            referenced to a realistic water
            sound speed model.
 STATIC BEAM BATHYMETRY OFFSETS:
   STATICMODE mode
        sets offsetting of bathymetry by
        per-beam statics [0]
          0: static correction off
          1: static correction on
   STATICFILE filename
        sets static per-beam file path [no default]
        - static files are two-column ascii tables
          with the beam # in column 1 and
          the depth offset in m in column 2
 DRAFT CORRECTION:
   DRAFTMODE mode
        sets draft correction [0]
        - note: draft merged from navigation before
          draft correction applied
          0: no draft correction
          1: draft correction by offset
          2: draft correction by multiply
          3: draft correction by offset and multiply
          4: draft set to constant
   DRAFT constant
        sets draft value (m) [0.0]
   DRAFTOFFSET offset
        sets value added to draft (m) [0.0]
   DRAFTMULTIPLY multiplier
        sets value multiplied by draft [1.0]
 HEAVE CORRECTION:
   HEAVEMODE mode
        sets heave correction [0]
        - note: heave correction by offset and/or
          multiplication is added to any lever
          heave correction, and then either used in
          bathymetry recalculation or added to
          existing bathymetry
          0: no heave correction
          1: heave correction by offset
          2: heave correction by multiply
          3: heave correction by offset and multiply
   HEAVEOFFSET offset
        sets value added to heave (m)
   HEAVEMULTIPLY multiplier
        sets value multiplied by heave

 LEVER CORRECTION:
   LEVERMODE mode
        sets heave correction by lever calculation [0]
        - note: lever heave correction is added to
          any heave correction by offset and/or
          multiplication, and then either used in
          bathymetry recalculation or added to
          existing bathymetry
          0: no lever calculation
          1: heave correction by lever calculation
   VRUOFFSETX constant
        sets athwartships offset of attitude sensor (m)
        - note: positive to starboard
   VRUOFFSETY constant
        sets fore-aft offset of attitude sensor (m)
        - note: positive forward
   VRUOFFSETZ constant
        sets vertical offset of attitude sensor (m)
        - note: positive down
   SONAROFFSETX constant
        sets athwartships offset of sonar receive array (m)
        - note: positive to starboard
   SONAROFFSETY constant
        sets fore-aft offset of sonar receive array (m)
        - note: positive forward
   SONAROFFSETZ constant
        sets vertical offset of sonar receive array (m)
        - note: positive down
 ROLL CORRECTION:
   ROLLBIASMODE mode
        sets roll correction [0]
          0: no roll correction
          1: roll correction by single roll bias
          2: roll correction by separate port and
             starboard roll bias
   ROLLBIAS offset
        sets roll bias (degrees)
   ROLLBIASPORT offset
        sets port roll bias (degrees)
   ROLLBIASSTBD offset
        sets starboard roll bias (degrees)
 PITCH CORRECTION:
   PITCHBIASMODE mode
        sets pitch correction [0]
          0: no pitch correction
          1: pitch correction by pitch bias
   PITCHBIAS offset
        sets pitch bias (degrees)
 HEADING CORRECTION:
   HEADINGMODE mode
        sets heading correction [no heading correction]
        - note: heading merged from navigation before
          heading correction applied
          0: no heading correction
          1: heading correction using course
             made good
          2: heading correction by offset
          3: heading correction using course
             made good and offset
   HEADINGOFFSET offset
        sets value added to heading (degrees)
 TIDE CORRECTION:
   TIDEMODE mode
        sets tide correction [0]
        - note: tide added to bathymetry after
          all other calculations and corrections
          0: tide correction off
          1: tide correction on
   TIDEFILE filename
        sets tide file path
   TIDEFORMAT constan
        sets tide file format [1]
        - tide files can be in one of four ASCII
          table formats
          1: format is <time_d tide>
          2: format is <yr mon day hour min sec tide>
          3: format is <yr jday hour min sec tide>
          4: format is <yr jday daymin sec tide>
        - time_d = decimal seconds since 1/1/1970
        - daymin = decimal minutes start of day
 AMPLITUDE CORRECTION:
   AMPCORRMODE boolean
        sets correction of amplitude for
        amplitude vs grazing angle function
          0: amplitude correction off
          1: amplitude correction on
   AMPCORRFILE filename
        sets amplitude correction file path
        [no default]
   AMPCORRTYPE mode
        sets sidescan correction type [0]
          0: correction by subtraction (dB scale)
          1: correction by division (linear scale)
   AMPCORRSYMMETRY boolean
        forces correction function to be symmetric [1]
   AMPCORRANGLE constant
        sets amplitude correction reference angle
        (deg) [30.0]
   AMPCORRSLOPE mode
        sets amplitude correction slope mode [0]
          0: local slope ignored in calculating correction
          1: local slope used in calculating correction
          2: topography grid used in calculating correction
           but slope ignored
          3: local slope from topography grid used in
           calculating correction
 SIDESCAN CORRECTION:
   SSCORRMODE boolean
        sets correction of sidescan for
        amplitude vs grazing angle function
          0: sidescan correction off
          1: sidescan correction on
   SSCORRFILE filename
        sets sidescan correction file path
        [no default]
   SSCORRTYPE mode
        sets sidescan correction type [0]
          0: correction by subtraction (dB scale)
          1: correction by division (linear scale)
   SSCORRSYMMETRY boolean
        forces correction function to be symmetric [1]
   SSCORRANGLE constant
        sets sidescan correction reference angle
        (deg) [30.0]
   SSCORRSLOPE mode
        sets sidescan correction slope mode [0]
          0: local slope ignored in calculating correction
          1: local slope used in calculating correction
          2: topography grid used in calculating correction
           but slope ignored
          3: local slope from topography grid used in
           calculating correction
 SIDESCAN RECALCULATION:
   SSRECALCMODE boolean
        sets recalculation of sidescan for
        Simrad multibeam data
          0: sidescan recalculation off
          1: sidescan recalculation on
   SSPIXELSIZE constant
        sets recalculated sidescan pixel size (m) [0.0]
        - a zero value causes the pixel size to
          be recalculated for every data record
   SSSWATHWIDTH constant
        sets sidescan swath width (degrees) [0.0]
        - a zero value causes the swath width
          to be recalculated for every data record
   SSINTERPOLATE constant
        sets sidescan interpolation distance
        (number of pixels)
 METADATA INSERTION:
   METAVESSEL string
        sets mbinfo metadata string for vessel
   METAINSTITUTION string
        sets mbinfo metadata string for vessel
        operator institution or company
   METAPLATFORM string
        sets mbinfo metadata string for sonar
        platform (ship or vehicle)
   METASONAR string
        sets mbinfo metadata string for sonar
        model name
   METASONARVERSION string
        sets mbinfo metadata string for sonar
        version (usually software version)
   METACRUISEID string
        sets mbinfo metadata string for institutional
        cruise id
   METACRUISENAME string
        sets mbinfo metadata string for descriptive
        cruise name
   METAPI string
        sets mbinfo metadata string for principal
        investigator
   METAPIINSTITUTION string
        sets mbinfo metadata string for principal
        investigator
   METACLIENT string
        sets mbinfo metadata string fo data owner
        (usually PI institution)
   METASVCORRECTED boolean
        sets mbinfo metadata boolean for sound
        velocity corrected depths
   METATIDECORRECTED boolean
        sets mbinfo metadata boolean for tide
        corrected bathymetry
   METABATHEDITMANUAL boolean
        sets mbinfo metadata boolean for manually
        edited bathymetry
   METABATHEDITAUTO boolean
        sets mbinfo metadata boolean for automatically
        edited bathymetry
   METAROLLBIAS constant
        sets mbinfo metadata constant for roll bias
        (degrees + to starboard)
   METAPITCHBIAS constant
        sets mbinfo metadata constant for pitch bias
        (degrees + forward)
   METAHEADINGBIAS constant
        sets mbinfo metadata constant for heading bias
   METADRAFT constant
        sets mbinfo metadata constant for vessel draft (m)
 PROCESSING KLUGES:
   KLUGE001 boolean
        enables correction of travel times in
        Hydrosweep DS2 data from the R/V Maurice
        Ewing in 2001 and 2002.
   KLUGE002 boolean
        enables correction of draft values in
        Simrad data
        - some Simrad multibeam data has had an
          error in which the heave has bee added
          to the sonar depth (draft for hull
          mounted sonars)
        - this correction subtracts the heave
          value from the sonar depth
   KLUGE003 boolean
        enables correction of beam angles in
        SeaBeam 2112 data
        - a data sample from the SeaBeam 2112 on
          the USCG Icebreaker Healy (collected on
          23 July 2003) was found to have an error
          in which the beam angles had 0.25 times
          the roll added
        - this correction subtracts 0.25 * roll
          from the beam angles before the bathymetry
          is recalculated by raytracing through a
          water sound velocity profile
        - the mbprocess parameter files must be
          set to enable bathymetry recalculation
          by raytracing in order to apply this
          correction
   KLUGE004 boolean
        deletes survey data associated with duplicate
        or reversed time tags
        - if survey data records are encountered
          with time tags less than or equal to the
          last good time tag, an error is set and
          the data record is not output to the
          processed data file.
   KLUGE005 boolean
        replaces survey record timestamps with
        timestamps of corresponding merged navigation
        records
        - this feature allows users to fix
          timestamp errors using MBnavedit and
          then insert the corrected timestamps
          into processed data
   KLUGE006 boolean
     changes sonar depth / draft values without
        changing bathymetry values
   KLUGE007 boolean
        processing kluge 007 (not yet defined)
        - occasionaly odd processing problems will
          occur that are specific to a particular
          survey or sonar version
        - mbprocess will allow one-time fixes to
          be defined as "kluges" that can be turned
          on through the parameter files.

ANCILLARY DATA FILES
MB-System also uses a number of ancillary data files, most of which relate to mbprocess in some way. By default, these ancillary data files are named by adding a short suffix to the primary data file name (e.g. ".par", ".svp", ".esf", ".nve") The common ancillary files are listed below. The example names given here follow from an input swath data file name of mydata.mb71. The processing parameter file used by mbprocess has an ".par" suffix. These files are generated or modified by mbset, mbedit, mbnavedit, mbvelocitytool, mbnavadjust, and mbclean.
        mydata.mb71.par The most prominent ancillary files are metadata or "inf" files (created from the output of mbinfo). Programs such as mbgrid and mbm_plot try to check "inf" files to see if the corresponding data files include data within desired areas. The program mbprocess automatically generates an "inf" file for any processed output swath file. Also, the program mbdatalist is often used to create or update "inf" files for large groups of swath data files.
        mydata.mb71.inf The "fast bath" or "fbt" files are generated by copying the swath bathymetry to a sparse, quickly read format (format 71). Programs such as mbgrid, mbswath, and mbcontour will try to read "fbt" files instead of the full data files whenever only bathymetry information are required. The program mbprocess automatically generates an "fbt" file for any processed output swath file. Also, the program mbdatalist is often used to create or update "fbt" files for large groups of swath data files. These files are not generated or used when the original swath data is already in a compact bathymetry-only data format.
        mydata.mb71.fbt The "fast nav" or "fnv" files are just ASCII lists of navigation generated using mblist with a -OtMXYHSc option. Programs such as mbgrid, mbswath, and mbcontour will try to read "fnv" files instead of the full data files whenever only navigation information are required. These files are not generated or used when the original data is already in a single-beam or navigation data format.
        mydata.mb71.fnv The bathymetry edit save file generated by mbedit and mbclean has an ".esf" suffix.
        mydata.mb71.esf A water sound velocity profile (SVP) file generated by mbvelocitytool has an ".svp" suffix unless the user specifies otherwise.
        mydata.mb71.svp Water sound velocity profile (SVP) files generated by mbsvplist also use the ".svp" suffix. However, multiple SVP files may be extracted from each input swath file, so the files are numbered using a "_YYY.svp" suffix, where YYY increments from 001.
        mydata.mb71_001.svp
        mydata.mb71_002.svp
        mydata.mb71_003.svp Edited navigation files generated by mbnavedit have an ".nve" suffix:
        mydata.mb71.nve
These navigation files can be read independently using format 166. Adjusted navigation files generated by mbnavadjust have an ".naY" suffix, where "Y" is a number between 0-9. The mbnavadjust package may be used multiple times for a survey; the adjustments are numbered sequentially from "0":
        mydata.mb71.na0
        mydata.mb71.na1
        mydata.mb71.na2
and so on. These navigation files can be read independently using format 166.

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, mbprocess derives the format id from the mbprocess parameter file associated with the input file (-I option) or, if necessary, infers the format from the "*.mbXX" MB-System suffix convention.

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

-I  infile
    Swath data file from which the input data will be read, or a datalist file containing a list of input swath data files and/or other datalist files. If infile is a datalist file, then mbprocess will attempt to process all data files identified by recursively reading infile.

-N
    By default, mbprocess passes any comment records it encounters in the input data to the output data file and additionally embeds new comment records detailing the processing parameters used by mbprocess. This option causes mbprocess to not pass new or old comment records to the output data file.

-O  outfile
    Data file to which the output data will be written. If no output file is specified, the output filename is set automatically. If an input swath data file is named "root.mbXX", where XX is the format id, then the default processed output file will be "rootp.mbXX". The "p" inserted before the ".mbXX" suffix indicates the output file has been created by mbprocess. If the input file does not follow the *.mbXX naming convention, then the output filename will just consist of the input name with "p.mbXX" added as a suffix.

-P
    By default, mbprocess will only process a swath data file if the processed output file is either missing or out of date relative to the input swath data file, the parameter file, or any of the ancillary data files referred to in the parameter file (e.g. navigation files, edit save files, svp files). If the -P option is specified, mbprocess will process every file, whether it needs it or not.

-T
    This option puts mbprocess into a test mode. The program will report whether or not it would process a file, but it will not actually process the data or produce an output processed file.

-S
    This option causes mbprocess to print out the status of each file (e.g. up to date, out of date, locked, unlocked) along with the file modification times used to determine if the output file is out of date.

-V  Normally, mbprocess works "silently" without outputting anything to the stderr stream. If the -V flag is given, then mbprocess works in a "verbose" mode and outputs the program version being used, the processing parameters being use, and some statistics regarding the processing accomplished.

NAVIGATION FORMATS
The navigation formats that are supported for merging by mbprocess include the following:
     MBprocess ID Name
     ------------------ ----
              1 Simple Decimal Time
              2 Simple Date 1
              3 Simple Date 2
              4 Simple Date 3
              5 L-DEO Processed Nav
              6 NMEA 0183 - GLL
              7 NMEA 0183 - GGA
              8 Simrad 90 Nav
              9 MBPRONAV (*.nve Files) Format 1 (Simple Decimal Time):
     - text
     - fields separated by white space
     - each line contains the following fields:
         time_d lon lat
     - time_d : decimal seconds since 1970 Jan 1 00:00:00.00
     - lon: decimal longitude (deg)
     - lat: decimal latitude (deg)

Format 2 (Simple Date 1):
     - text
     - fields separated by white space
     - each line contains the following fields:
         yr mon day hour min sec lon lat
     - yr: four-digit year
     - mon: integer month of year
     - day: integer day of month
     - hour: integer hour of day
     - min: integer minute of hour
     - sec: decimal second of minute
     - lon: decimal longitude (deg)
     - lat: decimal latitude (deg) Format 3 (Simple Date 2):
     - text
     - fields separated by white space
     - each line contains the following fields:
         yr jday hour min sec lon lat
     - yr: four-digit year
     - jday: integer julian day of year
     - hour: integer hour of day
     - min: integer minute of hour
     - sec: decimal second of minute
     - lon: decimal longitude (deg)
     - lat: decimal latitude (deg) Format 4 (Simple Date 3):
     - text
     - fields separated by white space
     - each line contains the following fields:
         yr jday daymin sec lon lat
     - yr: four-digit year
     - jday: integer julian day of year
     - daymin: integer minute of day
     - sec: decimal second of minute
     - lon: decimal longitude (deg)
     - lat: decimal latitude (deg) Format 5 (L-DEO Processed Nav):
     - text
     - fields separated by white space
     - each line contains the following fields:
         timetag NorS latd latm EorW lond lonm src dr1 dr2
     - timetag: comes in two forms
         form 1: yy+jjj:hh:mm:ss.sss
         form 2: yyyy+jjj:hh:mm:ss.sss
     - yy: either two-digit or four-digit year
     - jjj: integer julian day of year
     - hh: integer hour of day
     - mm: integer minute of hour
     - ss.sss: decimal second of minute
     - NorS: 'S' for southern hemisphere
             'N' for northern hemisphere
     - latd: integer latitude degrees
     - latm: decimal latitude minutes
     - EorW: 'E' for eastern hemisphere
             'W' for western hemisphere
     - lond: integer longitude degrees
     - lonm: decimal longitude minutes
     - src: nav source (e.g. gp1, dr, satl)
             'gp1' - GPS receiver 1
             'dr' - dead reckoning
             'satl' - transit satellite
     - dr1: nonzero when src is 'dr'
     - dr2: nonzero when src is 'dr' Format 6 (NMEA 0183 - GLL):
     - text
     - fields separated by commas
     - nav derived from GLL strings Format 7 (NMEA 0183 - GGA):
     - text
     - fields separated by commas
     - nav derived from GGA strings Format 8 (Simrad 90 Nav):
     - text
     - fields not separated by white space
     - each line contains the following fields:
         ddmmyy_hhmmss.ss_LLlllllN_LLLllllllE
    - dd: day of month
     - mm: integer month of year
    - yy: two-digit year
     - hh: integer hour of day
     - mm: integer minute of hour
     - ss.ss: decimal second of minute
     - LL: integer latitude degrees
     - lllll: integer latitude minutes X 1000
     - N: 'S' for southern hemisphere
             'N' for northern hemisphere
     - LLL: integer longitude degrees
     - lllll: integer longitude minutes X 1000
     - E: 'E' for eastern hemisphere
             'W' for western hemisphere Format 9 (MBPRONAV (*.nve Files)):
     - text
     - fields separated by white space
     - each line contains the following fields:
         yr mn dy hr mi se td lo la hg sp dr
     - yr: four-digit year
     - mn: integer month of year
     - dy: integer day of month
     - hr: integer hour of day
     - mi: integer minute of hour
     - se: decimal second of minute
     - td : decimal seconds since 1970 Jan 1 00:00:00.00
     - lo: decimal longitude (deg)
     - la: decimal latitude (deg)
     - hg: decimal heading (deg)
     - sp: decimal speed (km/hr)
     - dr: decimal draft (m)

EXAMPLES
Suppose the user has a Simrad EM120 data file called "0051_20010829_223755.mb57" that requires processing. Editing the bathymetry data in this file with mbedit will generate an edit save file "0051_20010829_223755.mb57.esf" and an mbprocess parameter file "0051_20010829_223755.mb57.par". The contents of the parameter file are:
 ## MB-System processing parameter file
 ## Written by mb_pr_writepar version $Id: mbprocess.1 1840 2010-03-26 22:57:29Z caress $
 ## MB-system Version 5.0.beta22
 ## Generated by user <caress> on cpu <menard> at <Fri Sep 6 21:27:41 2002>
 ##
 ##
 ## Forces explicit reading of parameter modes.
 EXPLICIT
 ##
 ## General Parameters:
 FORMAT 57
 INFILE /data/0051_20010829_223755.mb57
 OUTFILE /data/0051_20010829_223755p.mb57
 ##
 ## Navigation Merging:
 NAVMODE 0
 NAVFILE /data/0051_20010829_223755.mb57.nve
 NAVFORMAT 0
 NAVHEADING 0
 NAVSPEED 0
 NAVDRAFT 0
 NAVATTITUDE 0
 NAVINTERP 0
 NAVTIMESHIFT 0.000000
 ##
 ## Navigation Offsets and Shifts:
 NAVSHIFT 0
 NAVOFFSETX 0.000000
 NAVOFFSETY 0.000000
 NAVOFFSETZ 0.000000
 NAVSHIFTLON 0.000000
 NAVSHIFTLAT 0.000000
 ##
 ## Adjusted Navigation Merging:
 NAVADJMODE 0
 NAVADJFILE
 NAVADJINTERP 0
 ##
 ## Attitude Merging:
 ATTITUDEMODE 0
 ATTITUDEFILE
 ATTITUDEFORMAT 1
 ##
 ## Sonardepth Merging:
 SONARDEPTHMODE 0
 SONARDEPTHFILE
 SONARDEPTHFORMAT 1
 ##
 ## Data cutting:
 DATACUTCLEAR
 ##
 ## Bathymetry Flagging:
 EDITSAVEMODE 1
 EDITSAVEFILE /data/0051_20010829_223755.mb57.esf
 ##
 ## Bathymetry Recalculation:
 SVPMODE 0
 SVPFILE
 SSVMODE 0
 SSV 0.000000
 TTMODE 0
 TTMULTIPLY 1.000000
 ANGLEMODE 0
 SOUNDSPEEDREF 1
 ##
 ## Draft Correction:
 DRAFTMODE 0
 DRAFT 0.000000
 DRAFTOFFSET 0.000000
 DRAFTMULTIPLY 1.000000
 ##
 ## Heave Correction:
 HEAVEMODE 0
 HEAVEOFFSET 0.000000
 HEAVEMULTIPLY 1.000000
 ##
 ## Lever Correction:
 LEVERMODE 0
 VRUOFFSETX 0.000000
 VRUOFFSETY 0.000000
 VRUOFFSETZ 0.000000
 SONAROFFSETX 0.000000
 SONAROFFSETY 0.000000
 SONAROFFSETZ 0.000000
 ##
 ## Roll Correction:
 ROLLBIASMODE 0
 ROLLBIAS 0.000000
 ROLLBIASPORT 0.000000
 ROLLBIASSTBD 0.000000
 ##
 ## Pitch Correction:
 PITCHBIASMODE 0
 PITCHBIAS 0.000000
 ##
 ## Heading Correction:
 HEADINGMODE 0
 HEADINGOFFSET 0.000000
 ##
 ## Tide Correction:
 TIDEMODE 0
 TIDEFILE
 TIDEFORMAT 1
 ##
 ## Amplitude Correction:
 AMPCORRMODE 0
 AMPCORRFILE
 AMPCORRTYPE 0
 AMPCORRSYMMETRY 1
 AMPCORRANGLE 30.000000
 AMPCORRSLOPE 0
 ##
 ## Sidescan Correction:
 SSCORRMODE 0
 SSCORRFILE
 SSCORRTYPE 0
 SSCORRSYMMETRY 1
 SSCORRANGLE 30.000000
 SSCORRSLOPE 0
 ##
 ## Sidescan Recalculation:
 SSRECALCMODE 0
 SSPIXELSIZE 0.000000
 SSSWATHWIDTH 0.000000
 SSINTERPOLATE 0
 ##
 ## Metadata Insertion:
 METAVESSEL
 METAINSTITUTION
 METAPLATFORM
 METASONAR
 METASONARVERSION
 METACRUISEID
 METACRUISENAME
 METAPI
 METAPIINSTITUTION
 METACLIENT
 METASVCORRECTED -1
 METATIDECORRECTED -1
 METABATHEDITMANUAL -1
 METABATHEDITAUTO -1
 METAROLLBIAS 0.000000
 METAPITCHBIAS 0.000000
 METAHEADINGBIAS 0.000000
 METADRAFT 0.000000
 ##
 ## Processing Kluges Editing the navigation with mbnavedit will generate a navigation file named "0051_20010829_223755.mb57.nve" and will modify the parameter file. The changed lines in "0051_20010829_223755.mb57.par" are:
 ## Navigation Merging:
 NAVMODE 1
 NAVFILE /data/0051_20010829_223755.mb57.nve
 NAVFORMAT 9
 NAVHEADING 1
 NAVSPEED 1
 NAVDRAFT 1
 NAVATTITUDE 1 At this point, running mbprocess on "0051_20010829_223755.mb57" will apply the bathymetry flags from mbedit and merge the navigation from mbnavedit, but will not modify the data in any other way. If the user wants to recalculate the bathymetry using an SVP file "0051_20010829_223755.mb57.svp" and a roll bias correction of +0.5 degrees, the following will suffice:
        mbset -I 0051_20010829_223755.mb57 -PSVPFILE:0051_20010829_223755.mb57.svp -PROLLBIAS:0.5 -PDRAFT:1.95 -V

The affected lines in "0051_20010829_223755.mb57.par" are:
 ##
 ## Bathymetry Recalculation:
 SVPMODE 1
 SVPFILE 0051_20010829_223755.mb57.svp
 SSVMODE 0
 SSV 0.000000
 TTMODE 0
 TTMULTIPLY 1.000000
 ANGLEMODE 0
 SOUNDSPEEDREF 1
 ##
 ## Draft Correction:
 DRAFTMODE 4
 DRAFT 1.950000
 DRAFTOFFSET 0.000000
 DRAFTMULTIPLY 1.000000
 ##
 ## Roll Correction:
 ROLLBIASMODE 1
 ROLLBIAS 0.500000
 ROLLBIASPORT 0.000000
 ROLLBIASSTBD 0.000000 To process the data, run mbprocess:
        mbprocess -I0051_20010829_223755.mb57 -V
 The output to the terminal is:
 Program mbprocess
 Version $Id: mbprocess.1 1840 2010-03-26 22:57:29Z caress $
 MB-System Version 5.0.beta07

 Program <mbprocess>
 Version $Id: mbprocess.1 1840 2010-03-26 22:57:29Z caress $
 MB-system Version 5.0.beta07

 Program Operation:
   Input file: 0051_20010829_223755.mb57
   Format: 57
   Files processed only if out of date.
   Comments embedded in ouput.

 Data processed - out of date:
  Input: 0051_20010829_223755.mb57
  Output: /u/caress/dev/mbbugs/mb_bug_025/test/0051_20010829_223755p.mb57

 Input and Output Files:
   Format: 57
   Input file: 0051_20010829_223755.mb57
   Output file: /u/caress/dev/mbbugs/mb_bug_025/test/0051_20010829_223755p.mb57
   Comments in output: ON

 Navigation Merging:
   Navigation merged from navigation file.
   Heading merged from navigation file.
   Speed merged from navigation file.
   Draft merged from navigation file.
   Navigation file: /u/caress/dev/mbbugs/mb_bug_025/test/0051_20010829_223755.mb57.nve
   Navigation algorithm: linear interpolation
   Navigation time shift: 0.000000

 Navigation Offsets and Shifts:
   Navigation positions not shifted.

 Adjusted Navigation Merging:
   Navigation not merged from adjusted navigation file.
   Adjusted navigation file:
   Adjusted navigation algorithm: linear interpolation

 Data Cutting:
   Data cutting disabled.

 Bathymetry Editing:
   Bathymetry edits applied from file.
   Bathymetry edit file: 0051_20010829_223755.mb57.esf

 Bathymetry Recalculation:
   Bathymetry recalculated by raytracing.
   SVP file: 0051_20010829_223755.mb57.svp
   SSV not modified.
   SSV offset/constant: 0.000000 m/s
   Travel time multiplier: 1.000000 m

 Bathymetry Water Sound Speed Reference:
   Output bathymetry reference: CORRECTED
   Depths recalculated as corrected

 Draft Correction:
   Draft set to constant.
   Draft constant: 1.950000 m
   Draft offset: 0.000000 m
   Draft multiplier: 1.000000 m

 Heave Correction:
   Heave not modified.
   Heave offset: 0.000000 m
   Heave multiplier: 1.000000 m

 Lever Correction:
   Lever calculation off.

 Tide Correction:
   Tide calculation off.

 Roll Correction:
   Roll offset by bias.
   Roll bias: 0.500000 deg
   Port roll bias: 0.000000 deg
   Starboard roll bias: 0.000000 deg

 Pitch Correction:
   Pitch not modified.
   Pitch bias: 0.000000 deg

 Heading Correction:
   Heading not modified.
   Heading offset: 0.000000 deg

 Amplitude Corrections:
   Amplitude correction off.

 Sidescan Corrections:
   Sidescan correction off.

 Sidescan Recalculation:
   Sidescan not recalculated.
   Sidescan pixel size: 0.000000
   Sidescan swath width: 0.000000
   Sidescan interpolation: 0

 Metadata Insertion:
   Metadata vessel:
   Metadata institution:
   Metadata platform:
   Metadata sonar:
   Metadata sonarversion: iòØ
   Metadata cruiseid:
   Metadata cruisename:
   Metadata pi:
   Metadata piinstitution:
   Metadata client:
   Metadata svcorrected: -1
   Metadata tidecorrected -1
   Metadata batheditmanual -1
   Metadata batheditauto: -1
   Metadata rollbias: 0.000000
   Metadata pitchbias: 0.000000
   Metadata headingbias: 0.000000
   Metadata draft: 0.000000

 236 navigation records read
 Nav start time: 2001 08 29 22:38:02.082999
 Nav end time: 2001 08 29 23:37:22.322000

 47 bathymetry edits read

 236 input data records
 3587 input nav records
 17 input comment records
 6617 input other records
 236 output data records
 3587 output nav records
 64 output comment records
 6617 output other records

 Generating inf file for /u/caress/dev/mbbugs/mb_bug_025/test/0051_20010829_223755p.mb57
 Generating fbt file for /u/caress/dev/mbbugs/mb_bug_025/test/0051_20010829_223755p.mb57
 Generating fnv file for /u/caress/dev/mbbugs/mb_bug_025/test/0051_20010829_223755p.mb57

SEE ALSO
mbsystem(l), mbset(l), mbedit(l), mbnavedit(l), mbvelocitytool(l)

BUGS
You tell me.