qmips2glo
Description
qmips2glo is a utility designed to convert QMIPS sidescan format data to JCU GLORIA format. It handles 8-bit or 16-bit QMIPS data, applies optional logarithmic scaling, and converts it into GLORIA records, generating two output files for different channels (e.g., channel 1 and channel 2).
Usage
qmips2glo [-v] [-log] [-reverse] [-swapsides] [-merid <value>] [-timeseries] [-in <infile>] -out <outfile_prefix>
Arguments
| Option | Description | Â |
|---|---|---|
-v | Enable verbose output. | Â |
-log | Apply logarithmic scaling to the input data. | Â |
-reverse | Not implemented. | Â |
-swapsides | Swap port and starboard sides. | Â |
-merid <value> | Specify the central meridian for coordinate conversion. | -999.0 (default, prompts for input) |
-timeseries | Process data as time series (default). | Â |
-in <infile> | Required. The input QMIPS sidescan file. | Â |
-out <outfile_prefix> | Required. The prefix for the output JCU GLORIA files. Two files will be created: <outfile_prefix>.chan1 and <outfile_prefix>.chan2. | Â |
How It Works
- Read QMIPS Header: The tool first reads the 1024-byte QMIPS header from the input file, extracting crucial parameters like
sampleRate,numImageryChannels,bitsPerPixel,pixelsPerChannelPerPing, andnumSonarChannels. - Initialize Parameters: Based on
bitsPerPixel, it sets up either an 8-bit or 16-bit processing path. Iflog_flagis set, it initializes a logarithmic lookup table. - Process QMIPS Records: The tool then iterates through the input file, reading QMIPS records:
- Read Imagery Data: It reads the imagery data for all channels (typically 4 channels) for the number of samples per ping.
- Byte Swapping: If
bitsPerPixelis 16, it performs byte swapping on the raw 16-bit data. - Logarithmic Scaling: If
log_flagis set, it applies logarithmic scaling to the imagery data. - Read Footer Data: It reads a 256-byte QMIPS footer, extracting time (day, month, year, hour, minute, seconds, thousandsSeconds), ping number, fish depth, heading, altitude, sound velocity, and ship latitude/longitude.
- Time Conversion: Converts the QMIPS time to a Unix timestamp.
- Populate GLORIA Header: Populates the fields of the GLORIA record header:
time,centisecs: From converted QMIPS time.lat,lon: From QMIPS ship latitude/longitude.small_pixel: Calculated based onqfooter.ch1_floatRawRangeand number of samples.pixel_size: Set to 0.azi: Fromqfooter.telemFishHeading.altitude: Fromqfooter.telemFishAlt.
- Convert Sidescan Data: It processes the imagery data based on
swapsidesflag andno_samples_per_sideto populate thestbd_dataandport_datafields of two GLORIA records (out_recandout_rec2). - Write GLORIA Record: The two GLORIA records are written to separate output files (
.chan1and.chan2).
- Loop: This process repeats until the end of the input QMIPS file.