DDSsmb_read
Description
DDSsmb_read is a C program designed to convert raw Mesotech DDS (Digital Data Stream) SMB (Sonar Message Block) files, which typically contain raw element sonar data, into the Ocean Mapping Group (OMG) data format. In addition to the primary sonar data, it extracts and processes associated navigation and attitude information, outputting these into separate OMG-compatible files for further processing and analysis within the OMG ecosystem.
Usage
DDSsmb_read [OPTIONS] -DDSsmb <filename(s)> -out <prefix>
Arguments
| Option | Description | Default / Example |
|---|---|---|
-v | Enables verbose output, providing more detailed status messages during execution. | |
-debug | Activates debug messages, useful for troubleshooting and understanding internal processes. | |
-pie | Flag to indicate the creation of PIE (Post-Interp Echosounder) data. | |
-dumpTA | Flag to dump TA (Transducer Array) data. | |
-interp | Activates interpolation of beams, enhancing data quality. | |
-pixel <value> | Sets the pixel size for processed data. | |
-maxdepth <value> | Defines the maximum depth of interest for filtering or processing. | |
-mindepth <value> | Defines the minimum depth of interest for filtering or processing. | |
-left_across <value> | Specifies the left across-track range. | |
-right_across <value> | Specifies the right across-track range. | |
-dB_range <min_dB> <max_dB> | Sets the decibel range for packing data, likely for intensity values. | |
-ping_start <value> | Specifies a starting ping number for processing. | |
-ping_end <value> | Specifies an ending ping number for processing. | |
-time_start <Y JD H M S> | Defines a start time window (Year, Julian Day, Hour, Minute, Second) to filter data. | |
-time_end <Y JD H M S> | Defines an end time window (Year, Julian Day, Hour, Minute, Second) to filter data. | |
-pack_samp <value> | Sets a packing sample value. | |
-DDSsmb <filename(s)> | Required. Specifies one or more input Mesotech DDS SMB raw data files. | data.smb |
-out <prefix> | Required. Defines the prefix for all generated output files. | output_survey |
Output Files
<prefix>.merged: Main merged data output.<prefix>.merged.ss_data: Sidescan-like data.<prefix>.merged.16_data: 16-bit data.<prefix>.merged.ph_data: Phase data.<prefix>.merged.ph16_data: 16-bit phase data.<prefix>.orientation: Attitude data in OMG format.<prefix>.nav: Navigation data in OMG format.
How It Works
- Command-line Argument Parsing: Provides extensive command-line options to control the conversion process, offering flexibility in data selection and output.
- File Handling and I/O: Manages the opening of input
.smbfiles and a suite of output files, ensuring data can be written in various formats. Iterates through each specified input.smbfile, reading its content. - SMB Data Extraction and Parsing: Uses
jSMB_get_next_tuple_header(an external function, likely defined inMesotech_SMB.hor a related library) to sequentially parse the input SMB file. This function extractsSMB_Tuple_Header(smb_head) andSMB_Tuple_Footer(smb_foot) structures, along with the raw data payload (tdata) for each data block. Identifies different types of data telegrams within the SMB stream based onsmb_head.DataType(e.g.,0x1008for PMB profile solutions,0x2001for 16-bit amplitude and phase images). - Time-based Filtering: If a time window is specified via
-time_startand-time_end, the program checks each ping’sping_timeand skips processing for pings that fall outside this window. - Output Data Generation:
- Navigation Output (
write_out_M3_nav): This function takes ping time, latitude, and longitude, and formats them into anjcu_nav_recstructure, which is then written to the OMG-compatible.navfile usingnav_write. It incorporates a mechanism to prevent writing redundant navigation records ifonly_redundantis set. - Attitude Output (
write_out_M3_attitude): This function extracts roll, pitch, heading, and heave data. It constructs anOMG_HDCS_summary_attitudeheader for the.orientationfile upon the first record and then writes individualOMG_HDCS_attituderecords usingOMG_HDCS_write_attitude. - While other output files (
.merged,.merged.ss_data, etc.) are opened, the specific logic for writing to these files based on the parsed SMB data types is not fully elaborated in the provided code excerpt, implying it resides within the SMB data type parsing blocks.
- Navigation Output (
- Memory Management: Allocates a large
tdatabuffer (10MB) for reading raw SMB data and ensures it is freed before program exit. - Error and Usage Reporting: Utilizes
error(),warning(), andusage()functions (presumably fromsupport.h) to provide informative messages for critical errors, non-critical issues, and command-line argument misuse, respectively.
Dependencies
support.h: Provides general utility functions for command-line parsing (strtoint,strtodbl), error handling (error,warning,check_error), and string manipulation (mem_strappend,mem_stripext).stdtime.h: Offers functions for converting and formatting time data (stdtime_from_jul_day,stdtime_nicetime).OMG_HDCS_jversion.h: Defines structures and functions specific to the OMG Hydrographic Data Collection System (HDCS) format, includingOMG_HDCS_summary_attitude,OMG_HDCS_attitude,OMG_HDCS_dump_att_summary,OMG_HDCS_write_attitude, andOMG_HDCS_fileID_tag.jcu_nav.h: Provides data structures (jcu_nav_rec) and functions (nav_write) for handling navigation data in a specific format.Mesotech_SMB.h: Crucial for defining the structures of Mesotech SMB data (SMB_Tuple_Header,SMB_Tuple_Footer) and the functionjSMB_get_next_tuple_headerused for parsing these proprietary files.
Notes
The primary purpose of DDSsmb_read.c is to serve as a vital data ingest tool for Mesotech DDS SMB sonar data. By converting this proprietary format into the standardized OMG format, it enables seamless integration of Mesotech data into the broader OMG processing, visualization, and analysis workflows. The program’s filtering capabilities (by ping number or time) and flexible output options make it a versatile utility for hydrographic data management and quality control.