xsonar2glo
Description
xsonar2glo is a utility designed to convert XSONAR merged GLORIA data to JCU GLORIA format. It handles XSONAR ping records, extracts navigation, attitude, and sidescan data, performs byte swapping if necessary, and converts it into GLORIA records.
Usage
xsonar2glo [-merid <value>] [-timeseries] [-reverse] [-in <infile>] -out <outfile>
Arguments
| Option | Description | Β |
|---|---|---|
-merid <value> | Specifies the central meridian for UTM zone calculations. Default is automatically determined. | -999.0 (default) |
-timeseries | Process data as time series. | Β |
-reverse | If specified, the tool will attempt to convert from JCU GLORIA to XSONAR format (currently not fully implemented). | Β |
-swapXS | Perform byte swapping (default is determined by system endianness). | Β |
-in <infile> | Required. The input XSONAR GLORIA file. | Β |
-out <outfile> | Required. The output JCU GLORIA format sidescan file. | Β |
How It Works
- Read XSONAR Record: The tool reads XSONAR ping records from the input file. Each record contains a header (
PingHeader) and raw sidescan data (port and starboard). - Byte Swapping: It performs byte swapping on various fields of the
PingHeaderand data arrays if the byte order of the input file differs from the systemβs endianness. - Time Conversion: Converts the XSONAR date and time fields into a Unix timestamp for the GLORIA record.
- Coordinate Conversion: Converts UTM coordinates (northing, easting) from the XSONAR header to latitude and longitude for the GLORIA record using Mercator projection.
- Populate GLORIA Header: Populates the fields of the GLORIA record header:
time,centisecs: From converted XSONAR time.lat,lon: Converted from XSONAR UTM coordinates.small_pixel: Calculated based on swath width and number of samples.pixel_size: Set to 0.azi: Fromfish_aziin the XSONAR header.fishdepth: Fromdepthin the XSONAR header.altitude: Fromaltin the XSONAR header.
- Convert Sidescan Data: The raw sidescan data from the XSONAR record (port and starboard channels) is copied into
out_rec.port_dataandout_rec.stbd_datafields of the GLORIA record. It handles differentno_samples_per_sidevalues. - Write GLORIA Record: The fully populated GLORIA record (
out_rec) is written to the output file. - Loop: This process repeats until the end of the input XSONAR file.