reson_7K_utils β Reson 7K to OMG HDCS Conversion Utilities
Overview & Purpose
The reson_7K_utils module (code/subr/reson_7K_utils.c and code/subr/reson_7K_utils.h) bridges low-level Teledyne Reson 7K Data Format records (reson_7K.h) and the internal Ocean Mapping Group (OMG) data structures (OMG_HDCS_jversion.h, jcu_nav.h, and j_EM_watercol.h).
It provides conversion functions that translate Reson 7K timestamps, navigation (Record 1003), roll/pitch/heave orientation (Record 1012), heading (Record 1013), attitude time series (Record 1016), and beamformed water-column/image data (Records 7011 and 7018) into standard OMG HDCS records. It also provides random-access loading of auxiliary .sonar_settings sidecar files via byte offsets stored in OMG_HDCS_profile_header.
Public Functions & Signatures
1. Sidecar Settings & Time Conversion
int load_7K_sonar_settings(FILE *sonar_settings_file, OMG_HDCS_profile_header *profile, Reson_7K_7000_Sonar_Settings *sonar_settings)Seeks toprofile->sonar_settings_offsetin the open.sonar_settingssidecar file and callsread_Reson_7K_7000_Sonar_Settings()to load the pingβs fullReson_7K_7000_Sonar_Settingsrecord. Returns0on success or1ifsonar_settings_fileisNULL.double convert_7K_time(Reson_7K_DRF *drf)Converts the Reson 7K Data Record Frame (Reson_7K_DRF) timestamp (year,jday,hour,minute,seconds) into double-precision Unix epoch seconds usingstdtime_from_jul_day().
2. Navigation & Attitude Conversion
int convert_7K_position(Reson_7K_DRF *drf, Reson_7K_1003_Position *position, jcu_nav_rec *nav)Converts a Reson 7K 1003 Position record (whenposition->type_flag == 0, geographical coordinates in radians) into ajcu_nav_recstructure:- Converts
latitudeandlongitudefrom radians to decimal degrees. - Stores
position->heightintonav->azi. - Computes integer seconds (
nav->time) and hundredths of a second (nav->centisecs) fromconvert_7K_time(drf).
- Converts
int convert_7K_orientation(Reson_7K_DRF *drf, Reson_7K_1012_Orientation *orientation, OMG_HDCS_summary_attitude *attitude_summary, OMG_HDCS_attitude *attitude)Converts a Reson 7K 1012 Roll/Pitch/Heave record into anOMG_HDCS_attitudestructure:- Computes
timeOffsetrelative toattitude_summary->refTimeandattitude_summary->timeScale. - Converts
rollandpitchfrom radians to hundredths of a degree (short), andheavefrom meters to centimeters (short).
- Computes
int convert_7K_heading(Reson_7K_DRF *drf, Reson_7K_1013_Heading *heading, OMG_HDCS_summary_attitude *heading_summary, OMG_HDCS_attitude *heading_out)Converts a Reson 7K 1013 Heading record from radians into hundredths of a degree (heading_out->heading) with corresponding HDCStimeOffset.int convert_7K_attitude(Reson_7K_DRF *drf, Reson_7K_1016_Attitude_sample *orientation, OMG_HDCS_summary_attitude *attitude_summary, OMG_HDCS_attitude *attitude)Converts a single sample from a Reson 7K 1016 Attitude record (addingorientation->time_offset / 1000.0seconds to the DRF timestamp) into anOMG_HDCS_attitudestruct containingroll,pitch,heave, andheading.
3. Water Column Conversion
int convert_7K_watercolumn(Reson_7K_DRF *drf, Reson_7K_7011_Image_Data *image, Reson_7K_7018_Beamformed_Data *watercolumn, OMG_HDCS_beam *beams, Reson_7K_7000_Sonar_Settings *settings, j_EM_watercolumn *watercolumn_out)Initializes and populates an OMGj_EM_watercolumnstructure from either a Reson 7K 7018 Beamformed Data record (watercolumn) or a 7011 Image Data record (image), usingReson_7K_7000_Sonar_Settingsfor sound velocity, sampling rate, projector vertical steering, and center frequency, andbeams[beam].Rc_steerfor beam pointing angles. Converts 16-bit linear amplitudes from Record 7018 into half-dBsigned charvalues via $2 \times 20 \log_{10}(\text{amplitude} + 1)$.int convert_7K_watercolumn_orig(Reson_7K_DRF *drf, Reson_7K_7018_Beamformed_Data *watercolumn, Reson_7K_7004_Beam_Geometry *geometry, Reson_7K_7000_Sonar_Settings *settings, j_EM_watercolumn *watercolumn_out)Earlier variant ofconvert_7K_watercolumnthat derives beam pointing angles directly from a Reson 7K 7004 Beam Geometry record (-1 * geometry->beams[beam].beam_horizontal_direction_anglein hundredths of a degree) rather than anOMG_HDCS_beamarray.
How It Fits Into the OMG Architecture
- 7K Ingestion Tools (
reson/7k2omg.c,reson/7k2nav.c,reson/7k2orientation.c): Useconvert_7K_position,convert_7K_orientation,convert_7K_heading,convert_7K_attitude, andconvert_7K_watercolumnto convert raw.s7kfiles into OMG.merged,.nav,.orientation, and.wcdfiles. - Sonar Geometry & Backscatter Calibration (
subr/sonar_geometry.c,subr/Echo_calib.c,omg/getAngularResponse.c,gsf/omg2gsf.c): Callload_7K_sonar_settings()to retrieve per-ping 7K sonar settings from.sonar_settingssidecar files during beam footprint and backscatter calibration.