diff --git a/Modules/ThirdParty/OssimPlugins/include/ossim/ossimSarSensorModel.h b/Modules/ThirdParty/OssimPlugins/include/ossim/ossimSarSensorModel.h index 971bf0e4fbf1eb0b27efe16f762c43f93f34e37b..f6a4360e8d96d5c9d8a5cf7bb1cc0ec5b6ba7c09 100644 --- a/Modules/ThirdParty/OssimPlugins/include/ossim/ossimSarSensorModel.h +++ b/Modules/ThirdParty/OssimPlugins/include/ossim/ossimSarSensorModel.h @@ -159,12 +159,16 @@ public: unsigned long endLine; unsigned long startSample; unsigned long endSample; + double azimuthAnxTime; friend std::ostream & operator<<(std::ostream & os, const BurstRecordType & v) { return os << "{ azimuthStartTime: " << v.azimuthStartTime << ", azimuthStopTime: " << v.azimuthStopTime << ", startLine: " << v.startLine << ", stopLine: " << v.endLine + << ", startSample: " << v.startSample + << ", stopSample: " << v.endSample + << ", azimuthAnxTime:" << v.azimuthAnxTime << "}"; } }; @@ -518,6 +522,8 @@ protected: TimeType theFirstLineTime; TimeType theLastLineTime; + unsigned int theGeomVersion; // version of input geom + unsigned long theNumberOfLinesPerBurst; unsigned long theNumberOfSamplesPerBurst; diff --git a/Modules/ThirdParty/OssimPlugins/include/ossim/ossimSarSensorModelPathsAndKeys.h b/Modules/ThirdParty/OssimPlugins/include/ossim/ossimSarSensorModelPathsAndKeys.h index a2dfed36f8ee1cd657a38698c13df5144220c996..5d1bd4652ad796bb6574ffdc7adecc49ac84d3d4 100644 --- a/Modules/ThirdParty/OssimPlugins/include/ossim/ossimSarSensorModelPathsAndKeys.h +++ b/Modules/ThirdParty/OssimPlugins/include/ossim/ossimSarSensorModelPathsAndKeys.h @@ -65,6 +65,7 @@ namespace ossimplugins { extern const std::string keyEndSample ; extern const std::string keyAzimuthStartTime ; extern const std::string keyAzimuthStopTime ; + extern const std::string keyAzimuthAnxTime ; } // ossimplugins namespace diff --git a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimCosmoSkymedModel.cpp b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimCosmoSkymedModel.cpp index ca9d72ece58a9fa1152c685af6d5c9fad184afd1..b5a718b5f9c0352f23edec21b1f499000eb52684 100644 --- a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimCosmoSkymedModel.cpp +++ b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimCosmoSkymedModel.cpp @@ -476,6 +476,8 @@ namespace ossimplugins burstRecord.azimuthStopTime = add(theProductKwl, BURST_PREFIX, "[0].azimuth_stop_time", ossimplugins::time::toModifiedJulianDate(last_line_time)); + burstRecord.azimuthAnxTime = add(theProductKwl, BURST_PREFIX, "[0].azimuth_anx_time", 0); + theBurstRecords.push_back(burstRecord); const std::string BURST_NUMBER_LINES_KEY = "support_data.geom.bursts.number_lines_per_burst"; diff --git a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp index 0449388ff54da71a40e95a151ad50b8c262309ab..01952209dd11269e848580bc08219e50910a1c9c 100644 --- a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp +++ b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp @@ -107,7 +107,7 @@ namespace ossimplugins const double ossimSarSensorModel::C = 299792458; - const unsigned int ossimSarSensorModel::thePluginVersion = 3; + const unsigned int ossimSarSensorModel::thePluginVersion = 4; const unsigned int ossimSarSensorModel::thePluginVersionMin = 2; ossimSarSensorModel::ProductType::ProductType(string_view const& s) @@ -1187,6 +1187,11 @@ bool ossimSarSensorModel::worldToAzimuthRangeTime(const ossimGpt& worldPt, TimeT { get(kwl, burstPrefix + keyStartSample, burstRecord.startSample); get(kwl, burstPrefix + keyEndSample, burstRecord.endSample); + + if (version >= 4) + { + get(kwl, burstPrefix + keyAzimuthAnxTime, burstRecord.azimuthAnxTime); + } } } catch (...) { @@ -1216,6 +1221,7 @@ bool ossimSarSensorModel::worldToAzimuthRangeTime(const ossimGpt& worldPt, TimeT add(kwl, burstPrefix + keyEndSample, (ossim_uint32) burstRecords[burstId].endSample); add(kwl, burstPrefix + keyAzimuthStartTime, burstRecords[burstId].azimuthStartTime); add(kwl, burstPrefix + keyAzimuthStopTime, burstRecords[burstId].azimuthStopTime); + add(kwl, burstPrefix + keyAzimuthAnxTime, burstRecords[burstId].azimuthAnxTime); } } @@ -1415,6 +1421,8 @@ bool ossimSarSensorModel::worldToAzimuthRangeTime(const ossimGpt& worldPt, TimeT theBurstRecords.clear(); get(kwl, theBurstRecords); + get(kwl, HEADER_PREFIX, "version", theGeomVersion); + if(theBurstRecords.size() > 1) { unsigned int version; @@ -1484,6 +1492,12 @@ bool ossimSarSensorModel::deburst(std::vector<std::pair<unsigned long, unsigned unsigned long currentStart = it->startLine; TimeType deburstAzimuthStartTime = it->azimuthStartTime; + double deburstAzimuthAnxTime = 0; + if (theGeomVersion >= 4) + { + deburstAzimuthAnxTime = it->azimuthAnxTime; + } + unsigned long deburstEndLine = 0; samples = std::make_pair(it->startSample, it->endSample); @@ -1551,6 +1565,7 @@ bool ossimSarSensorModel::deburst(std::vector<std::pair<unsigned long, unsigned deburstBurst.azimuthStartTime = deburstAzimuthStartTime; deburstBurst.endLine = deburstEndLine; deburstBurst.azimuthStopTime = deburstAzimuthStopTime; + deburstBurst.azimuthAnxTime = deburstAzimuthAnxTime; if (onlyValidSample) { @@ -1654,7 +1669,8 @@ ossimSarSensorModel::burstExtraction(const unsigned int burst_index, oneBurst.azimuthStopTime = theLastLineTime; oneBurst.startSample = 0; oneBurst.endSample = samples.second - samples.first; - + oneBurst.azimuthAnxTime = 0; + theBurstRecords.push_back(oneBurst); } else @@ -1677,7 +1693,13 @@ ossimSarSensorModel::burstExtraction(const unsigned int burst_index, oneBurst.azimuthStopTime = burstAzimuthStopTime; oneBurst.startSample = 0; oneBurst.endSample = samples.second - samples.first; - + + oneBurst.azimuthAnxTime = 0; + if (theGeomVersion >= 4) + { + oneBurst.azimuthAnxTime = burstInd_Record.azimuthAnxTime; + } + theBurstRecords.push_back(oneBurst); // Adapt general metadata : theNearRangeTime, first_time_line, last_time_line @@ -1768,8 +1790,14 @@ ossimSarSensorModel::deburstAndConcatenate(std::vector<std::pair<unsigned long,u std::vector<BurstRecordType>::const_iterator next = it+1; std::vector<BurstRecordType>::const_iterator itend = theBurstRecords.end(); - unsigned long currentStart = it->startLine; + unsigned long currentStart = it->startLine; TimeType deburstAzimuthStartTime = it->azimuthStartTime; + + double deburstAzimuthAnxTime = 0; + if (theGeomVersion >= 4) + { + deburstAzimuthAnxTime = it->azimuthAnxTime; + } unsigned long deburstEndLine = 0; @@ -1926,6 +1954,7 @@ ossimSarSensorModel::deburstAndConcatenate(std::vector<std::pair<unsigned long,u deburstBurst.azimuthStopTime = deburstAzimuthStopTime; deburstBurst.startSample = 0; deburstBurst.endSample = samples.second - samples.first; + deburstBurst.azimuthAnxTime = deburstAzimuthAnxTime; theBurstRecords.push_back(deburstBurst); diff --git a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModelPathsAndKeys.cpp b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModelPathsAndKeys.cpp index 1515b4c1b0337d9a9ccbcd0b6083e7c185ba4fd0..7969bfceeaa49f2ddbb0c05b4f5ee2e48e18c550 100644 --- a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModelPathsAndKeys.cpp +++ b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModelPathsAndKeys.cpp @@ -62,5 +62,6 @@ namespace ossimplugins { const std::string keyEndSample = "end_sample"; const std::string keyAzimuthStartTime = "azimuth_start_time"; const std::string keyAzimuthStopTime = "azimuth_stop_time"; + const std::string keyAzimuthAnxTime = "azimuth_anx_time"; } // ossimplugins namespace diff --git a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp index caad19359c90da6c982376cfb2230887e9dfd28d..8c624c67743b2aa407ae8665ce524354fdd84947 100644 --- a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp +++ b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp @@ -50,8 +50,9 @@ namespace {// Anonymous namespace ossimTrace traceDebug ("ossimSentinel1Model:debug"); const ossimString attAdsHeader = "adsHeader"; const ossimString attAzimuthTime = "azimuthTime"; + const ossimString attAzimuthAnxTime = "azimuthAnxTime"; const ossimString attFirstValidSample = "firstValidSample"; - const ossimString attLastValidSample = "lastValidSample"; + const ossimString attLastValidSample = "lastValidSample"; const ossimString attGr0 = "gr0"; const ossimString attGrsrCoefficients = "grsrCoefficients"; const ossimString attHeight = "height"; @@ -967,6 +968,8 @@ namespace ossimplugins burstRecord.startSample = add(theProductKwl, BURST_PREFIX, "[0].start_sample", 0); burstRecord.endSample = add(theProductKwl, BURST_PREFIX, "[0].end_sample", getFromFirstNode<unsigned int>(imageInformation, "numberOfSamples")-1); + burstRecord.azimuthAnxTime = add(theProductKwl, BURST_PREFIX, "[0].azimuth_anx_time", 0); + theBurstRecords.push_back(burstRecord); } else @@ -988,6 +991,9 @@ namespace ossimplugins const TimeType azTime = getTimeFromFirstNode(**itNode, attAzimuthTime); + // Azimuth Anx Time + const double azAnxTime = getFromFirstNode<double>(**itNode, attAzimuthAnxTime); + // Scan firstValidSample to define the first valid sample and valid lines ossimString const& s = getTextFromFirstNode(**itNode, attFirstValidSample); std::vector<ossimString> ssp = s.split(" "); @@ -1081,6 +1087,8 @@ namespace ossimplugins burstRecord.azimuthStartTime = add(theProductKwl,burstPrefix + keyAzimuthStartTime, azTime + (first_valid*theAzimuthTimeInterval)); burstRecord.azimuthStopTime = add(theProductKwl,burstPrefix + keyAzimuthStopTime, azTime + (last_valid*theAzimuthTimeInterval)); + burstRecord.azimuthAnxTime = add(theProductKwl, burstPrefix + keyAzimuthAnxTime, azAnxTime); + theBurstRecords.push_back(burstRecord); } add(theProductKwl, BURST_NUMBER_KEY, burstId);