7k2nav
Description
7k2nav is a utility designed to extract position data from Reson 7k (.s7k) files and convert it into a generic binary navigation file format (.nav). It specifically targets 7k_1003_Position records within the .s7k file, extracts the relevant timestamp, latitude, and longitude, and then writes them to a .nav file compatible with other OMG tools.
This tool is essential for providing position data for georeferencing multibeam sonar data when the .s7k file is the primary source of navigation.
Usage
7k2nav -s7k <input_name> -omg <omg_file_prefix> [-v] [-debug]
Arguments
| Option | Description | |
|---|---|---|
-s7k <input_name> | Required. Path to the input Reson 7k .s7k file. | |
-omg <omg_file_prefix> | Required. Prefix for the output OMG-HDCS files. The tool will generate: | |
* <omg_file_prefix>.nav: Binary navigation file. | ||
-v | Enable verbose output. | |
-debug | Enable debug output. |
How It Works
- Initialization: Parses command-line arguments to get input
.s7kfilename and output prefix. Initializes Reson 7k data structures (Reson_7K_Index,Reson_7K_DRF,Reson_7K_1003_Position) andjcu_nav_rec. - File Opening: Creates the output navigation file (
.nav). - 7k Indexing: Calls
build_Reson_7K_Index()(an external function) to create an index of all packet types within the.s7kfile. - Position Data Extraction: Iterates through each
7k_1003_Positionrecord found in the.s7kindex:- Seeks to the record’s file offset.
- Reads the
Reson_7K_DRFandReson_7K_1003_Positiondata. - Calls
convert_7K_position()(an external function) to convert the 7k position data into ajcu_nav_recstructure (nav_out). - Writes
nav_outto the.navfile usingnav_write()(an external function). - Increments
num_nav_recs.
- Cleanup: Closes all open files.
Output Files
<omg_file_prefix>.nav: A binary file containing navigation records (jcu_nav_rec).
Dependencies
Reson_7K_parser.h: For Reson 7k data structures andbuild_Reson_7K_Index,convert_7K_positionfunctions.jcu_nav.h: Forjcu_nav_recstructure andnav_writefunction.support.h: For general utility functions and error handling.
Notes
7k2nav provides a standardized way to extract navigation information from Reson 7k files, making it compatible with other tools in the OMG ecosystem that require JCU NAV format for georeferencing and processing. The tool creates a new file, preserving the original .s7k file. Accurate navigation is fundamental for all subsequent multibeam data processing.