elac: Honeywell / L-3 ELAC Nautik HydroStar Bathymetry Parser
Overview & Purpose
elac (elac.c / elac.h, 234 lines) is a binary file parser for Honeywell / L-3 ELAC Nautik BottomChart and SeaBeam 1180 / HydroStar Online bathymetric data files. It provides structures and little-endian binary reading routines (get_LE_* from jb_endian.h) to decode ping headers (HYDROSTARBATHYHEADER), individual multibeam sounding records (HYDROSTARBEAMDATA), and dynamically sized full-ping containers (ELAC_BATHY).
Key Constants & Data Structures
HYDROSTARBATHYHEADER (HYDROSTARBATHYHEADER_SIZE = 72 bytes)
typedef struct {
int iSizeofThisStruct; /* sizeof(HYDROSTARBATHYHEADER) */
unsigned long ulNumberOfBeams; /* Number of bathymetric beams in ping */
unsigned long ulPingNumber; /* Sonar-supplied sequential ping number */
unsigned long ulFrameTimeUTCSeconds; /* Frame time in UTC seconds since 00:00 1.1.1901 */
unsigned long ulFrameTimeMicroseconds;/* Microsecond fraction of UTC frame time */
double dFrequency; /* Acoustic frequency in Hz (-1.0 if not supplied) */
double dTxPulseLength; /* Transmit pulse length in seconds */
double dTxPower; /* Transmit power in dB */
double dFilterBandwidth; /* Receiver filter bandwidth in Hz */
double dSampleInterval; /* Sample interval in seconds */
double dSwath; /* Swath angular width in radians */
unsigned short unScale; /* Compression scale factor */
unsigned short unFanCode; /* Fan configuration code */
} HYDROSTARBATHYHEADER;
HYDROSTARBEAMDATA (HYDROSTARBEAMDATA_SIZE = 57 bytes)
typedef struct {
int iBeamNumber; /* Absolute beam index within the swath */
double dTravelTime; /* Two-way travel time in seconds */
unsigned char ucQuality; /* Quality flag (1..8: 1..4 = good, >4 = bad, 0 mapped to 8) */
float fAmplitude; /* Backscatter echo amplitude in dB */
double dDelay; /* Time offset of beam relative to ping frame time (seconds) */
double dBeamAngle; /* Beam launch angle in radians (-ve = port, +ve = starboard) */
double dRoll; /* Instantaneous roll angle in radians */
double dPitch; /* Instantaneous pitch angle in radians */
double dHeave; /* Instantaneous heave in meters */
} HYDROSTARBEAMDATA;
ELAC_BATHY Container Structure
Combines all header fields of HYDROSTARBATHYHEADER with a dynamically allocated array HYDROSTARBEAMDATA *beam, plus in-memory housekeeping fields bytesOnDisk and currentNumberOfBeams.
Public Functions & Signatures
Low-Level Header & Beam Readers
void readHYDROSTARBATHYHEADER(HYDROSTARBATHYHEADER *header, FILE *infile)Reads 72 bytes (HYDROSTARBATHYHEADER_SIZE) frominfileand unpacks each little-endian integer, long, double, and short field into*header.void printHYDROSTARBATHYHEADER(HYDROSTARBATHYHEADER *header)Prints a human-readable dump of allHYDROSTARBATHYHEADERfields tostdout.void readHYDROSTARBEAMDATA(HYDROSTARBEAMDATA *beam, FILE *infile)Reads 57 unaligned packed bytes (HYDROSTARBEAMDATA_SIZE) frominfileand unpacksiBeamNumber,dTravelTime,ucQuality,fAmplitude,dDelay,dBeamAngle,dRoll,dPitch, anddHeaveinto*beam.void printHYDROSTARBEAMDATA(HYDROSTARBEAMDATA *beam)Prints the contents of a singleHYDROSTARBEAMDATAbeam record tostdout.
High-Level ELAC_BATHY Lifecycle & Ping Reader
void elacInit(ELAC_BATHY *bathy)Initializesbathy->beam = NULLandbathy->currentNumberOfBeams = 0.void readELACHEADER(ELAC_BATHY *bathy, FILE *infile)Reads the 72-byte ping header directly into the header fields of anELAC_BATHYstruct.void readELAC_BATHY(ELAC_BATHY *bathy, FILE *infile)Reads a complete ping frominfile:- Calls
readELACHEADER(bathy, infile)and incrementsbathy->bytesOnDiskby 72. - Checks if
bathy->beam == NULLorbathy->currentNumberOfBeams != bathy->ulNumberOfBeams; if so, dynamically resizesbathy->beamviarealloc(). - Loops over
0 .. bathy->ulNumberOfBeams - 1, callingreadHYDROSTARBEAMDATA(&bathy->beam[i], infile)and updatingbathy->bytesOnDisk.
- Calls
void printELAC_BATHY(ELAC_BATHY *bathy)Prints the ping header followed by allulNumberOfBeamsbeam records.void freeELAC_BATHY(ELAC_BATHY *bathy)Freesbathy->beamif non-NULL.
How It Fits Into the OMG Architecture
elac provides the binary parsing layer for converting Honeywell / L-3 ELAC BottomChart (toolType = 1) and SeaBeam 1180 MkII (toolType = 21) HydroStar files into OMG HDCS .merged files. Note that ELACβs multi-ping swath sequence (where each beam carries its own dDelay, dRoll, dPitch, and dHeave) is preserved in OMG_rational_profile (multiRoll, multiPitch, multiHeave, multiTime).