omg_wassp
Overview & Purpose
omg_wassp provides a binary packet parser, stream synchronizer, and backscatter calibrator for ENL WASSP (Wide Angle Sonar Seafloor Profiler) multibeam echosounder data files. WASSP network/disk streams consist of little-endian packets framed by a 32-bit sync pattern (0x77f9345a), a 32-bit byte size, and an 8-character ASCII packet type identifier (such as "GENBATHY" for generic bathymetry/backscatter pings and "GEN_SENS" for serial navigation/attitude sensor records).
Key Data Structures, Constants & Macros
Constants
WASSP_MAX_NUM_BEAMS(256): Maximum nominal beam count per WASSP ping.- Fixed Header & Record Sizes:
WASSP_PACKET_HEADER_SIZE(16bytes: 4Bsync_pattern, 4Bsize, 8Bheader).WASSP_GEN_BATHY_HEADER_SIZE(88bytes).WASSP_GEN_BATHY_BEAM_SIZE(16bytes).WASSP_GEN_SENS_HEADER_SIZE(29bytes).
Core Structs
WASSP_Packet_Header: 16-byte framing header (sync_pattern,size, and null-terminatedheader[9]).WASSP_Gen_Bathy_Header: 88-byteGENBATHYping header containing:- Framing & Version:
sync_pattern,size,header[9],version. - Timing & Identity:
utc_milliseconds,utc_day,utc_month,utc_year,ping_number,sonar_model, 64-bit serial number (serial_number1,serial_number2). - Acoustic Settings:
num_beams,flags,sampling_rate(Hz),frequency(Hz),source_level(volts/dB),pulse_width(ms),absorption(dB/km),spreading(dB),sample_type,sound_speed(m/s). unsigned char inbuffer[88]: Raw byte copy preserved for writing to.sonar_settingssidecar files.
- Framing & Version:
WASSP_Gen_Bathy_Beam: 16-byte per-beam record (float rangein samples,float anglein degrees,unsigned int flags,float backscatter).WASSP_Gen_Bathy: CompleteGENBATHYpacket (WASSP_Gen_Bathy_Header header, dynamically allocatedWASSP_Gen_Bathy_Beam *beams,checksum, and capacitysize_beams).WASSP_Gen_Sensor: CompleteGEN_SENSpacket (sync_pattern,size,header[9],version,double timein ms,port_number, dynamically allocated ASCIIchar *serial_data, andchecksum).WASSP_Calibrator: Backscatter calibration context (ping_number,beam_number, pointers toOMG_HDCS_summary_header,OMG_HDCS_profile_header,OMG_HDCS_beam,WASSP_Gen_Bathy_Header *sonar_settings,grazing_angles,dB_shift,dB_scale,rx_beamwidth,tx_beamwidth,attenuation_coefficient,skip_all_corrections,debug).
Public Functions & Signatures
Packet Synchronization & Parsing
int init_WASSP_Header(WASSP_Packet_Header *data)/int read_WASSP_Header(WASSP_Packet_Header *data, FILE *infile)- Initializes or reads the 16-byte packet framing header.
int seek_next_WASSP_Packet(FILE *infile, int file_size, WASSP_Packet_Header *header)- Scans
infilebyte-by-byte until finding the little-endian magic word0x77f9345a, rewinds 16 bytes to leaveinfilepositioned at the start of the packet, and populatesheader. Returns0on match,1on EOF.
- Scans
int init_WASSP_Gen_Bathy(WASSP_Gen_Bathy *data)/int read_WASSP_Gen_Bathy_Header(WASSP_Gen_Bathy_Header *header, FILE *infile)/int read_WASSP_Gen_Bathy(WASSP_Gen_Bathy *data, FILE *infile)/int print_WASSP_Gen_Bathy(WASSP_Gen_Bathy *data)- Reads the 88-byte
GENBATHYheader, reallocatesdata->beamsfornum_beams, unpacks each 16-byte beam record (range,angle,flags,backscatter), and reads the trailing 4-byte checksum.
- Reads the 88-byte
int init_WASSP_Gen_Sensor(WASSP_Gen_Sensor *data)/int read_WASSP_Gen_Sensor(WASSP_Gen_Sensor *data, FILE *infile)/int print_WASSP_Gen_Sensor(WASSP_Gen_Sensor *data)- Reads the 29-byte
GEN_SENSheader, computes the payload lengthsize_serial = data->size - (WASSP_GEN_SENS_HEADER_SIZE + 4), reads the NMEA/serial string intodata->serial_data, and unpacks the 4-byte checksum.
- Reads the 29-byte
Sonar Settings & Calibration
int load_WASSP_sonar_settings(FILE *sonar_settings_file, OMG_HDCS_profile_header *profile, WASSP_Gen_Bathy_Header *sonar_settings)- Seeks to
profile->sonar_settings_offsetin.sonar_settingsand loads the 88-byteWASSP_Gen_Bathy_Header.
- Seeks to
int init_WASSP_Calibrator(WASSP_Calibrator *calibrator)/int calibrate_WASSP(WASSP_Calibrator *calibrator)- Initializes default beamwidths and
dB_scale = 2.0, and computes ensonified area (ensonified_area), source level, spreading ($40\log_{10}R$), and attenuation adjustments to populatecalibrator->beam->calibratedBackscatter.
- Initializes default beamwidths and
How It Fits Into the OMG Architecture
omg_wassp supports wasspTool and wassp2omg (code/wassp/) for inspecting and converting raw WASSP data streams into OMG HDCS files, and integrates with Echo_calib, makess, get_ADH_SRA, and swathed (SE) for backscatter processing.