4.3. Format Conversion

4.3.1. Background

Many sonar systems provide data in unwieldy or un-editable formats. Hydrosweep DS2™ data in its raw format, produces no less than 9 data files for each 10 minute segment. Simrad data files encode navigation information at non-periodic intervals within the data such that there is not a specific position associated with each ping. Some sonars do not embed automated and or manual comments into their data files. Some do not have data structures to allow the flagging of beams for editing to occur. To cope with these differences MB-System™ provides for the conversion the the "raw" data formats into one of several alternative formats defined by MBIO . These formats are native only to MB-System™ but provide, in many cases, the only way to manage, manipulate, and process the data.

Since each sonar vendor format is somewhat different, we are forced to provide specific instructions for each. While not all raw sonar data formats supported by MB-System™ are discussed here, most will fall into one of the following sections.

Note

Typically, vendor provided sonar data viewing and editing software will not be able to read the MB-System™ -only formats. If there is a chance that you will need the data in its raw format, it is best to keep backup copies of the raw data before converting it. In the case of Hydrosweep DS2™ data, the nine files are such a burden that most ships convert the data to an alternate format immediately as an automated process and provide only the condensed MB-System™ file format to scientists unless the raw data is requested.

4.3.2. SeaBeam 2100

Lucky for us, SeaBeam 2100 series multibeam sonars provide data in an amenable format right out of the box. This format is MB-System™ format 41. Typical raw data files however are named with a date-time stamp followed by ".rec". All that is required is a renaming of the files to "date-time_stamp.mb41" to facilitate operations with MB-System™.

4.3.3. Converting Your Data

If it hasn't been done already, early on in the post processing we will want to convert our sonar data to one of the condensed MB-System™ data formats. This is done with the mbcopy process. mbcopy reads data files of a specific format, optionally windows them in time or space, may average specified numbers of pings, adds comments specifying when and by whom the data was converted (if the output format supports comments), and finally converts the data to a new MB-System™ format. mbcopy can read and write from STDIN and to STDOUT making it ideal for real-time automated processes. Alternatively, it may read and write to and from specific files. The general form of mbcopy with no ping averaging looks something like the following:

mbcopy -F182/183 -I 00011209011010.fsw -O 00011209011010.mb183

Here the input and output file formats are specified (182/183), as well as the names of the files from which to read and write (-I 00011209011010.fsw -O 00011209011010.mb183). Notice that we've renamed the file with MB-System™ 's standard naming conventions of .mbID#. This will allow interactive tools such as mbedit to automatically identify the data format.

At the time of this writing, mbcopy did not yet have a built-in way to convert multiple data files. Therefore I've provided a short script I call multi-copy that can be quite helpful with larger data sets.

#!/usr/bin/perl
#
#
# Usage: ls -1 | multi-copy
#
# Val Schmidt
# Lamont Doherty Earth Observatory
# 
# This script takes a directory full to 182 format multi
# beam files and converts them to 183 format files.

while (<>){
        if (/.*fsw$/){
            chomp;
            s/\.fsw//;
            $cmd="mbcopy -F182/183 -I$_"."\.fsw"." -O".$_."\.mb183";
            #print $cmd;
            system($cmd);
        }
    }

This script works as it is to convert Hydrosweep DS2™ data in the 182 format to the 183 format. You'll have to modify it to suite your particular data format and naming conventions. For example, raw Hydrosweep files end in "fsw", so I screen the file list with the statement "if (/.*.fsw$/)". If your files end in something else you'll have to edit that line and the others appropriately.

Before we move on, we should take am moment to discuss some other details regarding translation between data formats. With few exceptions, mbcopy will translate between any two data formats - even to those of other sonars. When the input and output formats are associated with the same sonar system the complete data stream is copied to the output file. When they are not, however, only the time stamp, navigation, and beam values are copied. This allows conversion of the bulk of the data, even though some formats do not make provisions for comments or other details in the data stream.

Note

Note however, typically data that has been edited cannot be translated back into the raw sonar format to be further viewed/edited in their proprietary software.

You will find that the data files in our example data set, (loihi/MBARI1998EM300) have already been converted to MB-System™ Format ID 57.

AUTHOR'S NOTE: THERE IS MORE TO BE ADDED HERE REGARDING THE DETAILS OF INDIVIDUAL FILE AND SONAR TYPES. INVESTIGATE THE DETAILS SURROUNDING PARTICULAR SONAR SYSTEMS AND DOCUMENT THEM HERE (I.E. WHAT SUPPORTS EDITING, WHEN IT WILL BE LOST, WHAT'S RECOMMENDED FOR EACH SONAR TYPE, ETC.)