From 11e154451d2b71c9dd43a35e316674f9e447b977 Mon Sep 17 00:00:00 2001
From: Christophe Palmann <christophe.palmann@c-s.fr>
Date: Fri, 19 Dec 2014 16:38:52 +0100
Subject: [PATCH] ENH: OpticalCalibration app; test if RSR file is correclty
 set (atmo.rsr).

---
 Applications/Radiometry/otbOpticalCalibration.cxx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Applications/Radiometry/otbOpticalCalibration.cxx b/Applications/Radiometry/otbOpticalCalibration.cxx
index 1d19d8d582..4abd6a24df 100644
--- a/Applications/Radiometry/otbOpticalCalibration.cxx
+++ b/Applications/Radiometry/otbOpticalCalibration.cxx
@@ -94,8 +94,6 @@ public:
                                                      DoubleVectorImageType>          ReflectanceToSurfaceReflectanceImageFilterType;
   typedef ReflectanceToSurfaceReflectanceImageFilterType::FilterFunctionValuesType  FilterFunctionValuesType;
   typedef FilterFunctionValuesType::ValuesVectorType                                ValuesVectorType;
-  //typedef AtmosphericCorrectionParameters                                           AtmosphericCorrectionParametersType; chris
-  //typedef AtmosphericCorrectionParametersType::AerosolModelType                     AerosolModelType; chris
 
   typedef otb::AtmosphericCorrectionParameters                              AtmoCorrectionParametersType;
   typedef otb::AtmosphericCorrectionParameters::Pointer                     AtmoCorrectionParametersPointerType;
@@ -805,7 +803,10 @@ private:
         // Relative Spectral Response File
         if (IsParameterEnabled("atmo.rsr"))
         {
-          m_paramAcqui->LoadFilterFunctionValue(GetParameterString("atmo.rsr"));
+          if ( !(GetParameterString("atmo.rsr") == "") )
+            m_paramAcqui->LoadFilterFunctionValue(GetParameterString("atmo.rsr"));
+          else
+            otbAppLogFATAL("Please, set a sensor relative spectral response file.");  
         }
         else if (IMIName != IMIOptDfltName)
         {
-- 
GitLab