diff --git a/Code/IO/otbImageMetadataInterfaceBase.h b/Code/IO/otbImageMetadataInterfaceBase.h index 3ddc902354afbc343fec14ff64ac0b8e5917766d..664a4aa06f10e8c16511ea2dca127534a8976a59 100644 --- a/Code/IO/otbImageMetadataInterfaceBase.h +++ b/Code/IO/otbImageMetadataInterfaceBase.h @@ -210,8 +210,6 @@ protected: ImageMetadataInterfaceBase(); virtual ~ImageMetadataInterfaceBase() {}; -// bool IsSpot( const MetaDataDictionaryType & dict) const; - private: ImageMetadataInterfaceBase(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented diff --git a/Code/IO/otbTerraSarImageMetadataInterface.cxx b/Code/IO/otbTerraSarImageMetadataInterface.cxx index f51f7852deda75ea7bda8136f25c5344305c09df..18236f90cf07891809bc059a81fd1cf4f47e33b2 100644 --- a/Code/IO/otbTerraSarImageMetadataInterface.cxx +++ b/Code/IO/otbTerraSarImageMetadataInterface.cxx @@ -45,13 +45,14 @@ std::string TerraSarImageMetadataInterface::GetSensorID( const MetaDataDictionaryType & dict ) const { ImageKeywordlistType ImageKeywordlist; - + std::cout<<"theSensorID"<<std::endl; if (dict.HasKey(MetaDataKey::OSSIMKeywordlistKey)) { itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, ImageKeywordlist); } ossimKeywordlist kwl; ImageKeywordlist.convertToOSSIMKeywordlist(kwl); + std::cout<<kwl<<std::endl; std::string key= "sensor"; ossimString keywordString = kwl.find(key.c_str()); std::string output(keywordString.chars()); diff --git a/Code/IO/otbTerraSarImageMetadataInterface.h b/Code/IO/otbTerraSarImageMetadataInterface.h index 84e02598f9c37f7f0c1fe0cae19da78c5d89c7dd..6a9c0ca23f2b5c3c816b2e53ef5d9edf8475bd70 100644 --- a/Code/IO/otbTerraSarImageMetadataInterface.h +++ b/Code/IO/otbTerraSarImageMetadataInterface.h @@ -51,7 +51,7 @@ public: itkNewMacro(Self); /** Run-time type information (and related methods). */ - itkTypeMacro(ImageMetadataInterfaceBase, itk::Object); + itkTypeMacro(TerraSarImageMetadataInterface, itk::Object); typedef itk::ImageBase< 2 > ImageType; typedef itk::MetaDataDictionary MetaDataDictionaryType; diff --git a/Testing/Code/Radiometry/CMakeLists.txt b/Testing/Code/Radiometry/CMakeLists.txt index 9e83a06da2b6e2519642ae85c00def3425665c16..0a3a8bcc7193462054e7bb2a0b3b8a696b05b952 100644 --- a/Testing/Code/Radiometry/CMakeLists.txt +++ b/Testing/Code/Radiometry/CMakeLists.txt @@ -24,6 +24,8 @@ SET(RADIOMETRY_TESTS5 ${CXX_TEST_PATH}/otbRadiometryTests5) SET(RADIOMETRY_TESTS6 ${CXX_TEST_PATH}/otbRadiometryTests6) SET(RADIOMETRY_TESTS7 ${CXX_TEST_PATH}/otbRadiometryTests7) SET(RADIOMETRY_TESTS8 ${CXX_TEST_PATH}/otbRadiometryTests8) +SET(RADIOMETRY_TESTS9 ${CXX_TEST_PATH}/otbRadiometryTests9) + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbRADIOMETRY_TESTS1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1022,7 +1024,23 @@ ADD_TEST(raTvAeronet_ArcachonLevel10_ExtractData ${RADIOMETRY_TESTS8} ) +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbRADIOMETRY_TESTS9 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ------- TerraSarIntraCalibrationImageFilter ------------------------------ +ADD_TEST(raTuTerraSarIntraCalibrationImageFilterNew ${RADIOMETRY_TESTS9} + otbTerraSarIntraCalibrationImageFilterNew +) + +ADD_TEST(raTvTerraSarIntraCalibrationImageFilterTest ${RADIOMETRY_TESTS9} +# --compare-image ${EPSILON} +# ${BASELINE}/raTvTerraSarIntraCalibrationImageFilterTest.tif +# ${TEMP}/raTvTerraSarIntraCalibrationImageFilterTest.tif + otbTerraSarIntraCalibrationImageFilterTest + ${INPUTDATA}/TerraSarExtract.tif + ${TEMP}/raTvTerraSarIntraCalibrationImageFilterTest.tif +) # A enrichir @@ -1115,6 +1133,13 @@ otbAeronetExtractData.cxx otbAeronetExtractDataBadData.cxx ) +SET(Radiometry_SRCS9 +otbRadiometryTests9.cxx +otbTerraSarIntraCalibrationImageFilterNew.cxx +otbTerraSarIntraCalibrationImageFilterTest.cxx +) + + INCLUDE_DIRECTORIES(${OTB_SOURCE_DIR}/Testing/Code) OTB_ADD_EXECUTABLE(otbRadiometryTests1 "${Radiometry_SRCS1}" "OTBRadiometry;OTBIO;OTBTesting") @@ -1125,5 +1150,6 @@ OTB_ADD_EXECUTABLE(otbRadiometryTests5 "${Radiometry_SRCS5}" "OTBRadiometry;OTBI OTB_ADD_EXECUTABLE(otbRadiometryTests6 "${Radiometry_SRCS6}" "OTBRadiometry;OTBIO;OTBTesting") OTB_ADD_EXECUTABLE(otbRadiometryTests7 "${Radiometry_SRCS7}" "OTBRadiometry;OTBIO;OTBTesting") OTB_ADD_EXECUTABLE(otbRadiometryTests8 "${Radiometry_SRCS8}" "OTBRadiometry;OTBIO;OTBTesting") +OTB_ADD_EXECUTABLE(otbRadiometryTests9 "${Radiometry_SRCS9}" "OTBRadiometry;OTBIO;OTBTesting") ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING ) diff --git a/Utilities/otbossimplugins/ossim/ossimTerraSarModel.cpp b/Utilities/otbossimplugins/ossim/ossimTerraSarModel.cpp index 1114f691656243dacac97d2b481b1080128ab2f4..4f40c18351d696b11871787ada755dd3529398ad 100644 --- a/Utilities/otbossimplugins/ossim/ossimTerraSarModel.cpp +++ b/Utilities/otbossimplugins/ossim/ossimTerraSarModel.cpp @@ -59,8 +59,7 @@ ossimplugins::ossimTerraSarModel::ossimTerraSarModel() _sceneCenterRangeTime(0.0), _SrToGr_scaling_factor(0.0), _alt_srgr_coefset(3), - theProductXmlFile(), - theGenerationTime("") + theProductXmlFile() { } @@ -73,8 +72,7 @@ ossimplugins::ossimTerraSarModel::ossimTerraSarModel( _sceneCenterRangeTime(rhs._sceneCenterRangeTime), _SrToGr_scaling_factor(rhs._SrToGr_scaling_factor), _alt_srgr_coefset(rhs._alt_srgr_coefset), - theProductXmlFile(rhs.theProductXmlFile), - theGenerationTime(rhs.theGenerationTime) + theProductXmlFile(rhs.theProductXmlFile) { } @@ -163,10 +161,6 @@ bool ossimplugins::ossimTerraSarModel::open(const ossimFilename& file) { result = tsDoc.getMission(xdoc, theSensorID); } - if(result) - { - result = tsDoc.getGenerationTime(xdoc, theGenerationTime); - } // Set the base class gsd: result = tsDoc.initGsd(xdoc, theGSD); @@ -276,7 +270,6 @@ bool ossimplugins::ossimTerraSarModel::saveState(ossimKeywordlist& kwl, kwl.add(prefix, ALT_SR_GR_COEFFICIENT1_KW, _alt_srgr_coefset[1]); kwl.add(prefix, ALT_SR_GR_COEFFICIENT2_KW, _alt_srgr_coefset[2]); kwl.add(prefix, PRODUCT_XML_FILE_KW, theProductXmlFile.c_str()); - kwl.add(prefix, "generation_time", theGenerationTime.c_str()); // Call base save state: result = ossimGeometricSarSensorModel::saveState(kwl, prefix); @@ -343,13 +336,6 @@ bool ossimplugins::ossimTerraSarModel::loadState (const ossimKeywordlist &kwl, } } - // Get the product.xml file name. - lookup = kwl.find(prefix, "generation_time"); - if (lookup) - { - theGenerationTime = lookup; - } - // Load the base class. bool result = ossimGeometricSarSensorModel::loadState(kwl, prefix); @@ -566,23 +552,6 @@ bool ossimplugins::ossimTerraSarModel::loadState (const ossimKeywordlist &kwl, result = false; } - lookup = kwl.find(prefix, "generation_time"); - if (lookup) - { - theGenerationTime = lookup; - } - else - { - if (traceDebug()) - { - ossimNotify(ossimNotifyLevel_WARN) - << MODULE - << "\nRequired keyword not found: " - << "generation_time" << "\n"; - } - result = false; - } - } // matches: if (result) if (traceDebug()) @@ -631,9 +600,8 @@ std::ostream& ossimplugins::ossimTerraSarModel::print(std::ostream& out) const << ALT_SR_GR_COEFFICIENT0_KW << ": " << _alt_srgr_coefset[0] << "\n" << ALT_SR_GR_COEFFICIENT1_KW << ": " <<_alt_srgr_coefset[1] << "\n" << ALT_SR_GR_COEFFICIENT2_KW << ": " <<_alt_srgr_coefset[2] << "\n" - << PRODUCT_XML_FILE_KW << ": " << theProductXmlFile.c_str() << "\n" - << "Generation Time : " << theGenerationTime << "\n"; - + << PRODUCT_XML_FILE_KW << ": " << theProductXmlFile.c_str() << "\n"; + ossimGeometricSarSensorModel::print(out); // Reset flags. @@ -1394,18 +1362,6 @@ bool ossimplugins::ossimTerraSarModel::initRefPoint( { result = false; } - - if (tsDoc.getGenerationTime(xdoc, s) ) - { - if (! ossim::iso8601TimeStringToCivilDate(s, dateStart) ) - { - result = false; - } - } - else - { - result = false; - } double acq_msec_first = (double) dateStart.get_second() + dateStart.get_decimal(); diff --git a/Utilities/otbossimplugins/ossim/ossimTerraSarModel.h b/Utilities/otbossimplugins/ossim/ossimTerraSarModel.h index b773cef98fee4678a5000f44966211af06e29cee..49d8a992fb8ee8b8fec9c4b0bee1ff0c8a895a93 100644 --- a/Utilities/otbossimplugins/ossim/ossimTerraSarModel.h +++ b/Utilities/otbossimplugins/ossim/ossimTerraSarModel.h @@ -168,7 +168,6 @@ namespace ossimplugins std::vector<double> _alt_srgr_coefset; ossimFilename theProductXmlFile; - ossimString theGenerationTime; TYPE_DATA