Correlation coefficient should be scaled by 100 when a % sign is shown

This commit is contained in:
Dan Paulat 2025-01-20 00:23:14 -06:00
parent 3f5a0056e4
commit a92248b4d9
2 changed files with 25 additions and 0 deletions

View file

@ -51,6 +51,9 @@ static const std::unordered_map<common::Level2Product,
{common::Level2Product::ClutterFilterPowerRemoved,
wsr88d::rda::DataBlockType::MomentCfp}};
static const std::unordered_map<common::Level2Product, float> productScale_ {
{common::Level2Product::CorrelationCoefficient, 100.0f}};
static const std::unordered_map<common::Level2Product, std::string>
productUnits_ {{common::Level2Product::Reflectivity, "dBZ"},
{common::Level2Product::DifferentialReflectivity, "dB"},
@ -295,6 +298,15 @@ float Level2ProductView::unit_scale() const
break;
}
if (p->otherUnits_ == types::OtherUnits::Default)
{
auto it = productScale_.find(p->product_);
if (it != productScale_.cend())
{
return it->second;
}
}
return 1.0f;
}

View file

@ -29,6 +29,10 @@ static const auto logger_ = util::Logger::Create(logPrefix_);
static constexpr uint16_t RANGE_FOLDED = 1u;
static const std::unordered_map<common::Level3ProductCategory, float>
categoryScale_ {
{common::Level3ProductCategory::CorrelationCoefficient, 100.0f}};
static const std::unordered_map<common::Level3ProductCategory, std::string>
categoryUnits_ {
{common::Level3ProductCategory::Reflectivity, "dBZ"},
@ -217,6 +221,15 @@ float Level3ProductView::unit_scale() const
break;
}
if (p->otherUnits_ == types::OtherUnits::Default)
{
auto it = categoryScale_.find(p->category_);
if (it != categoryScale_.cend())
{
return it->second;
}
}
return 1.0f;
}