kflto8
Overview
kflto8 converts 32-bit IEEE floating-point sub-bottom trace files (<prefix>.merged.fl_data, such as those produced by readSB_SEGY, readixBlueXTF, or readEA600) into 8-bit unsigned byte trace files (<prefix>.merged.ss_data) so they can be plotted with makeSeisPlot or inspected in SwathEd.
Usage
kflto8 (-v) (-log | -lin) (-max16 8000) (-min16 10) (-nosams 16000) \
-in infile.merged.fl_data -out outfile.merged.ss_data
CLI Options
| Flag | Arguments | Default | Description |
|---|---|---|---|
-in | <infile> | required | Input 32-bit float trace file (<prefix>.merged.fl_data); also opens <prefix>.merged via mem_stripext(inname). |
-out | <outfile> | required | Output 8-bit trace file (<prefix>.merged.ss_data). |
-min16 | <float_val> | 1.0 | Minimum floating-point sample value mapped to 0 (clamped below min16). |
-max16 | <float_val> | 65535.0 | Maximum floating-point sample value mapped to 255 (clamped above max16). |
-nosams | <samples> | 0 (from .merged) | Override the number of samples per trace when determining record count (file_size / (nosams * 4)). |
-lin / -log | none | -lin | Set linear or logarithmic mode flag (note: current loop performs linear clamping and scaling 255.0 * (val - min16) / (max16 - min16)). |
-custom_dump | <prefix> | none | Set custom dump prefix flag. |
-v | none | 0 | Enable verbose output (prints per-trace and overall file min/max float values). |
How It Works
- Companion
.mergedLookup: Opens-in(.merged.fl_data) and strips the last extension (mem_stripext(inname)) to open the.mergedfile and readOMG_HDCS_summary_header. - Trace Seeking & Float Byte-Swapping: For each ping
i, readsOMG_HDCS_profile_headerandOMG_HDCS_beamfrom.merged, getstracelength = beams[0].no_samples, seeks tobeams[0].offset * sizeof(float)in.merged.fl_data, and readstracelengthbyte-swapped floats viajswapfloat_fread(). - 8-Bit Scaling: Maps each float sample linearly from
[min16, max16]into[0, 255](clamping values<= min16to0and>= max16to255) and writestracelengthbytes to-out.
Practical Examples
Inspect float dynamic range and re-scale .merged.fl_data to .merged.ss_data
kflto8 -v -min16 -60.0 -max16 0.0 \
-in ek80_line01.merged.fl_data -out ek80_line01.merged.ss_data