mbswplspreprocess(1)

NAME
mbswplspreprocess - prepairs a SWATHplus sonar file (MBIO format 222) for processed with MB System.

VERSION
Version 5.0

SYNOPSIS
mbswplspreprocess [-ABGNRSHV] [-Fformat] [-Jproj4command] [-Ooutfile] -Ifile

DESCRIPTION
mbswplspreprocess prepairs a SWATHplus SXP (MBIO format 222) file for processing with MB System.

MB System can read and plot SXP files without modification. However, many of the editing and calibration programs work best if each transducer channel is stored in a separate file (use the -S option). In particular, multiple transducer channels pinging simultaneously will trip up time filtering, since each channel in the ping series has the same time stamp.

If during data acquisition using the SEA SWATH Real-Time Acquisition System (SEA Swath Processor), the "Store All Data" option was selected in combination with the "Downsample" Bathy filter, the SXP ping records will contain both the original data (all samples rejected) and the filtered data (all samples accepted) simultaneously. This will confuse most programs in MB System. Use the -B and -R options as needed to strip out the undesired set prior to processing.

SXP ping records contain both a raw amplitude and a processed amplitude value for each sample. MB System reads and writes ONLY the processed amplitude values, leaving the raw values untouched. Use the -A option to copy (or restore) the raw amplitude values into the processed amplitude slots so that they can be accessed by MB System.

AUTHORSHIP
David P. Finlayson (dfinlayson@usgs.gov)
 Pacific Coastal and Marine Science Center, USGS

OPTIONS

-A
    This option causes the program to copy the raw amplitude values stored with each sample into the corresponding processed amplitude slot where it can then be used by MB System.

-B
    This option causes the program to reverse the sample flag setting. That is, rejected samples become accepted samples and vis-a-vis. This option is always applied before option -R.

-F  format
    Sets the data format used if the input is read from stdin or from a file. If format < 0, then the input file specified with the -I option will actually contain a list of input swath sonar data files. This program only reads Bathyswath (SWATHplus) format data files (MBIO format 222).

-G  Print to stdout an ASCII representation of each data record read from the file.

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

-I  infile
    Sets the input file path. If format > 0 (set with the -f option or mbdefaults) 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 the data in each one of these files. In the infile file, each data file should be followed by a data format identifier, e.g.:
         datafile1 222 1
         datafile2 222 1
    This program only reads SWATHplus format data files (MBIO format 222). .

-J  projection
    The SWATHplus software packages operate with navigation in a user-defined projected coordinate system. Resultantly, SXP format files contain positions in a projected coordinate system rather than longitude and latitude in geographic coordinates. Generally, the SXP files do not contain any description of the projection used to obtain the eastings and northings in those files. This option allows a user to specifiy the projection used to translate the eastings and northings back into longitude and latitude. If this option is not specified, MB-System will assume the data are associated with UTM zone 1 north. The projection identifier must conform to the same usage as with projections specified for mbgrid. For instance, to fully specify a particular northern UTM zone, set projection = UTMXXN where XX gives the UTM zone (defined from 01 to 60). As an example, a northern UTM zone 12 projection can be specified using -JUTM12N. Southern UTM zones are specified as UTMXXS. The European Petroleum Survey Group (EPSG) has defined a large number of PCS's used worldwide and assigned number id's to each; one can also specify the northern UTM zone 12 projection using its EPSG designation, or -Jepsg32612. The complete list of projected coordinate systems supported by MB-System is given in the mbgrid manual page.

-N  Do not write output file. Useful for inspecting files, especially combined with -G.

-O  outfile
    This option causes mbswplspreprocess to output all data to a single file specified as outfile. By default, the program creates output files for each input file. If combined with -S, this will serve as the basename for a set of output files, one for each transducer.

-R  This option removes all rejected samples from pings before writing output.

-S  This option saves each transducer channel into a separate output file. This is the best way to handle simultaneous pinging in MB System and the only way to handle 3 or more transducer channel systems. The transducer channel will be appended to the output filename as follows:
    outfile_txer<channel>.mb222

EXAMPLES
Suppose that one has collected a SWATHplus datafile incorporating interferometric sonar data from a 2-transducer system pinging simultaneously. The file name is:

    20140418_150155.sxp

To split each transducer into its own file for better filtering support from MB System, to reset the amplitude values to their original pre-processed values, and to strip out any previously flagged data run:

    mbswplspreprocess -SAR -I20140418_150155.sxp

To export the data records stored in an SXP file to a text file:

    mbswplspreprocess -GN -I20140418_150155.sxp > output.txt

NOTES
The SXP file format does not contain sufficient information to completely re-process the data in MB System itself. For example, you should not attempt to re-calculate bathymetry based on new sound velocity information. Ridged translations and rotations are OK (static shifts in x, y, or z, rotations about the transducer reference point) provided that each transducer channel resides in its own file (see the -S option). It is always safe to edit and filter the soundings in mbedit and mbeditviz.

SXP files use a projected coordinate system for all transducer and sea floor sample coordinates. The user must supply a .PRJ file defining the coordinate system (usually UTM) for each input file before proceeding with further processing in MB System. The coordinate system is not stored in the SXP file data itself.

SEE ALSO
mbsystem(1), mbformat(1), mbinfo(1)

BUGS
Oh yeah.