new GPR parameters and some UI fixes

This commit is contained in:
Ayzen
2026-04-07 12:55:26 +03:00
parent 4b78c2808d
commit 202993325d
27 changed files with 1494 additions and 168 deletions
@@ -20,8 +20,6 @@ constexpr double kPi = 3.14159265358979323846;
constexpr double kSpeedOfLightMetersPerSec = 299'792'458.0;
constexpr double kAccumulatorXMarginM = 2.0;
constexpr double kAccumulatorZMinM = 0.20;
constexpr double kSnrThresh = 4.5;
constexpr double kSnrCompMax = 25.0;
constexpr std::size_t kGridWidth = 300U;
constexpr std::size_t kGridHeight = 300U;
constexpr double kGaussianSigma = 3.0;
@@ -1197,6 +1195,8 @@ auto GprProcessor::process_collection(
kSpeedOfLightMetersPerSec / std::sqrt(std::max(1e-6, static_cast<double>(run_config.gpr.relative_permittivity)));
const double start_hz = static_cast<double>(live_config.gpr_start_freq_mhz) * 1'000'000.0;
const double stop_hz = static_cast<double>(live_config.gpr_stop_freq_mhz) * 1'000'000.0;
const double snr_thresh = std::max(0.0, static_cast<double>(live_config.gpr_snr_thresh));
const double snr_comp_max = std::max(0.0, static_cast<double>(live_config.gpr_snr_comp_max));
std::unordered_map<PairKey, AscanResult> ascans_by_pair{};
double bandwidth_hz = 0.0;
@@ -1248,7 +1248,8 @@ auto GprProcessor::process_collection(
4.0,
std::floor(((velocity_mps / (2.0 * bandwidth_hz)) / z_step) * 0.7)
));
const auto peak_indices = find_peak_indices(ascan.amplitude, min_index, max_index, noise * kSnrThresh, min_distance);
const auto peak_indices =
find_peak_indices(ascan.amplitude, min_index, max_index, noise * snr_thresh, min_distance);
auto& peaks = peaks_by_pair[key];
peaks.reserve(peak_indices.size());
for (const auto peak_index : peak_indices) {
@@ -1259,7 +1260,7 @@ auto GprProcessor::process_collection(
attenuation / attenuation_at_depth(tx_index, rx_index, 3.0, selection.x_tx, selection.x_rx);
const double snr_comp = std::min(
snr_raw / (std::pow(attenuation_norm, static_cast<double>(live_config.gpr_comp_power)) + 1e-12),
kSnrCompMax
snr_comp_max
);
peaks.push_back(PeakRecord{
.z_app = z_app,