Commit 224c4015 authored by Cédric Traizet's avatar Cédric Traizet

Merge branch 'NewMetadata_S1Model' into 'develop'

Add a new metadata (azimuthAnxTime) to Sentinel 1 Model

See merge request !586
parents f4b9516d e64149e1
Pipeline #2623 passed with stages
in 85 minutes and 23 seconds
......@@ -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;
......
......@@ -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
......
......@@ -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";
......
......@@ -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);
......
......@@ -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
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment