glreplace
Description
glreplace is a utility designed to replace the image data (sidescan pixel values) of one JCU GLORIA format file with the image data from a second GLORIA file, while retaining the header information from the first file. This effectively allows for updating the imagery of a GLORIA file without altering its navigational or other metadata.
Usage
glreplace <header_file> <image_file> <outfile>
Arguments
| Option | Description |
|---|---|
<header_file> | Required. The input JCU GLORIA file whose header information will be retained. |
<image_file> | Required. The input JCU GLORIA file whose image data will be used for replacement. |
<outfile> | Required. The output JCU GLORIA file with the header from <header_file> and image data from <image_file>. |
How It Works
- Input Files: The tool takes two JCU GLORIA files as input:
infile1(referred to as<header_file>)infile2(referred to as<image_file>)
- Output File: It creates a new output JCU GLORIA file (
outfile). - File Length Check: It determines the number of records in
infile1and assumesinfile2has the same number of records. - Record-by-Record Processing: For each corresponding record in the input files:
- It reads a record from
infile1intoin_rec1. - It reads a record from
infile2intoin_rec2. - It first copies the entire content of
in_rec2toout_rec. This meansout_recinitially contains the header and image data fromimage_file. - Then, it copies only the header portion (
HEADER_LENGTHorsizeof(jcu_all_rec)) fromin_rec1toout_rec. This overwrites the header fromimage_filewith the header fromheader_file, while retaining the image data (port and starboard arrays) that was copied fromimage_file. - The resulting
out_recnow contains the header fromheader_fileand the image data fromimage_file.
- It reads a record from
- Write Output: The
out_recis written to the output file. - Loop: This process repeats until all records from both input files have been processed.