From 03bc4a2c1c2c292fb5c79be8cf85138b0993972f Mon Sep 17 00:00:00 2001
From: remi <remi.cresson@irstea.fr>
Date: Thu, 3 Oct 2019 14:15:16 +0200
Subject: [PATCH] ENH: output gains and offsets to parameters

---
 app/otbHarmonizer.cxx | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/app/otbHarmonizer.cxx b/app/otbHarmonizer.cxx
index 79d9c4e..0878f33 100644
--- a/app/otbHarmonizer.cxx
+++ b/app/otbHarmonizer.cxx
@@ -428,6 +428,8 @@ private:
       {
       otbAppLogINFO("Using linear correction model (y=ax+b)");
       }
+
+    std::vector<std::string> outputgains, outputoffsets;
     for (unsigned int band = 0 ; band < refImage->GetNumberOfComponentsPerPixel() ; band++)
     {
       float meanY = m_StatsFilter->GetMeans().at(band)[0][0];
@@ -460,9 +462,15 @@ private:
 
       gain[band] = b1;
       offset[band] = b0;
+
+      outputgains.push_back(std::to_string(b1));
+      outputoffsets.push_back(std::to_string(b0));
     }
     exp << "}";
 
+    SetParameterStringList("outoffsets", outputoffsets);
+    SetParameterStringList("outgains", outputgains);
+
     otbAppLogINFO("BandMathX expression: " << exp.str());
 
     if (this->HasValue("out"))
-- 
GitLab