readSWA
Description
readSWA is a utility designed to process Submetrix SWA (Swath Acoustics) format data files. It can output the extracted information in two primary formats:
- ASCII output: Latitude, longitude, and depth (and optionally across-track distance) for each beam.
- OMG_HDCS format: Converts the SWA data into the structured OMG_HDCS (Ocean Mapping Group Hydrographic Data Collection System) format, specifically as
ISIS_SWAtoolType.
The tool handles various components of SWA data, including position, time, attitude (heading, roll, pitch, transducer depth, tide), and multibeam depth soundings, to integrate them into standardized formats for further hydrographic analysis.
Usage
readSWA [-v] [-omg | -ascii [-across]] [-azishift <degrees>] [-out <outfile_prefix>] <swafile(s)>
Arguments
| Option | Description | Β |
|---|---|---|
-v | Enable verbose output, providing more detailed processing messages. | Β |
-omg | Output in OMG_HDCS merged format. | Β |
-ascii | Output in ASCII format (latitude, longitude, depth). This is the default if neither -omg nor -ascii is specified. | Β |
-across | Used with -ascii, outputs an additional column for across-track distance. | Β |
-azishift <degrees> | Apply an azimuth shift (in degrees) to correct for vessel heading. | 0.0 |
-out <outfile_prefix> | Required. Specifies a prefix for the output files. The tool will generate: <prefix>.merged (if -omg), <prefix>.ascii or <prefix>.ascii_across (if -ascii), and <prefix>.nav (JCU NAV). | Β |
<swafile(s)> | Required. One or more input raw SWA data files. | Β |
How It Works
- Initialization: The tool initializes global variables for processing, including structures for OMG_HDCS data (
summary,profile,beams), JCU NAV data (nav_rec), and various scaling factors. It also sets up coordinate projection (WGS84 ellipsoid). - File Opening: Opens the input SWA file(s) and creates multiple output files based on the chosen output format:
tidefile:.merged(for OMG_HDCS) or.ascii(for ASCII).navfile:.nav(for JCU NAV format).
- Process SWA Files: The tool iterates through each input
swafile:- Line-by-Line Parsing: It reads the SWA file line by line, identifying specific keywords and extracting data.
- Header Information Extraction: It parses header lines to extract scaling factors for depth, amplitude, horizontal range, roll, pitch, heading, transducer depth, and tide.
- Ping-Specific Data: It processes lines containing ping data, extracting:
- Position: UTM coordinates (
ping_east,ping_north) which are converted toping_lat,ping_lonusingutmgeo. - Time: Hour, minute, second, day, month, year are parsed and converted to
ping_time(Unix timestamp). - Attitude: Heading, roll, pitch, transducer depth, and tide are extracted.
- Multibeam Soundings:
depth_recstructures are read, containingx_offset,y_offset,weight, anddepthfor individual beams.
- Position: UTM coordinates (
- Data Transformation:
- Azimuth Shift (
-azishift): Applies a rotation to the across-track offsets (deast,dnorth) based onazishift. - JCU NAV Output: Each pingβs position and time are written to the
.navfile as ajcu_nav_rec. - ASCII Output (
-ascii): For each valid beam, latitude, longitude, and depth (and optionally across-track distance) are written to the ASCII output file (.asciior.ascii_across). - OMG_HDCS Output (
-omg):prime_summary_data: For the first ping, theOMG_HDCS_summary_headeris populated withrefTime,refLat,refLongand written to the.mergedfile.prime_profile_data: AnOMG_HDCS_profile_headeris populated with ping-specific data (time offset, vessel position/attitude, tide).write_out_swath: For each beam, anOMG_HDCS_beamstructure is populated with observed depth, across-track, along-track, and quality information.- These
profile_headerandbeamdata are then written to the.mergedfile.
- Azimuth Shift (
- Loop: This process continues until the end of the input SWA file(s).
- File Closing: All opened files are closed upon completion.