Commit 6b7043fc authored by Julien Michel's avatar Julien Michel
Browse files

Merge branch 'develop' into default_functor_filter

parents a004e492 c3fa194e
......@@ -115,8 +115,7 @@ def GenerateChoice(app,param,paramlist, count = 0):
return output
def GenerateParameterType(app,param):
if app.GetParameterType(param) == otbApplication.ParameterType_Empty \
or app.GetParameterType(param) == otbApplication.ParameterType_Bool:
if app.GetParameterType(param) == otbApplication.ParameterType_Bool:
return "Boolean"
if app.GetParameterType(param) == otbApplication.ParameterType_Int \
or app.GetParameterType(param) == otbApplication.ParameterType_Radius \
......@@ -367,9 +366,6 @@ def GetApplicationExamplePythonSnippet(app,idx,expand = False, inputpath="",outp
if paramtype == otbApplication.ParameterType_Choice:
#app.SetParameterString(param,value)
output+= "\t" + appname + ".SetParameterString(" + EncloseString(param) + "," + EncloseString(value) + ")" + linesep
if paramtype == otbApplication.ParameterType_Empty:
app.EnableParameter(param)
output+= "\t" + appname + ".EnableParameter("+EncloseString(param)+")" + linesep
if paramtype == otbApplication.ParameterType_Bool:
output+= "\t" + appname + ".SetParameterString("+EncloseString(param)+","+EncloseString(value)+")" + linesep
if paramtype == otbApplication.ParameterType_Int \
......
......@@ -375,41 +375,3 @@ that relate to geometry, projections, and also calibration.
Future developments will probably offer a more adapted structure to import and
export images between OTB and the Python world.
Setting of EmptyParameter
^^^^^^^^^^^^^^^^^^^^^^^^^
Most of the parameters are set using functions ``SetParameterXXX()``, except for
one type of parameter: the ``EmptyParameter``. This class was the first
implementation of a boolean. It is now **deprecated**, you should use ``BoolParameter``
instead.
Let's take an example with the application ``ReadImageInfo`` when it was still
using an ``EmptyParameter`` for parameter ``keywordlist``:
.. code-block:: python
import otbApplication as otb
app = otb.Registry.CreateApplication("ReadImageInfo")
If you want the get the state of parameter ``keywordlist``, a boolean, use:
.. code-block:: python
app.IsParameterEnabled("keywordlist")
To set this parameter ON/OFF, use the functions:
.. code-block:: python
app.EnableParameter("keywordlist")
app.DisableParameter("keywordlist")
Don't try to use other functions to set the state of a boolean. For instance,
try the following commands:
.. code-block:: python
app.SetParameterInt("keywordlist", 0)
app.IsParameterEnabled("keywordlist")
You will get a state ``True`` even if you asked the opposite.
......@@ -39,7 +39,7 @@ Open the \code{CMakeLists.txt} file and write in the few lines:
\begin{cmakecode}
PROJECT(Tutorials)
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.1.0)
FIND_PACKAGE(OTB)
IF(OTB_FOUND)
......@@ -102,7 +102,7 @@ Follow the following steps:
\begin{cmakecode}
project(MyFirstProcessing)
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.1.0)
find_package(OTB REQUIRED)
include(${OTB_USE_FILE})
......
......@@ -153,7 +153,7 @@ private:
AddParameter(ParameterType_OutputImage, "out", "Output Image");
AddParameter(ParameterType_Empty, "param1", "Example of boolean parameter");
AddParameter(ParameterType_Bool, "param1", "Example of boolean parameter");
MandatoryOff("param1");
AddParameter(ParameterType_Int, "param2", "Example of integer parameter");
......
......@@ -65,7 +65,6 @@ LearningApplicationBase<TInputValue,TOutputValue>
"regression accuracy parameter, then the node will not be split further.");
//UseSurrogates : don't need to be exposed !
//AddParameter(ParameterType_Empty, "classifier.dt.sur", "Surrogate splits will be built");
//SetParameterDescription("classifier.dt.sur","These splits allow working with missing data and compute variable importance correctly.");
//MaxCategories
......
......@@ -79,9 +79,6 @@ LearningApplicationBase<TInputValue,TOutputValue>
"possible depth of the tree. The actual depth may be smaller if the other termination criteria are met, and/or "
"if the tree is pruned.");
//UseSurrogates : don't need to be exposed !
//AddParameter(ParameterType_Empty, "classifier.gbt.sur", "Surrogate splits will be built");
//SetParameterDescription("classifier.gbt.sur","These splits allow working with missing data and compute variable importance correctly.");
#endif
}
......
......@@ -59,10 +59,6 @@ LearningApplicationBase<TInputValue,TOutputValue>
"and the values of the train samples in this node are smaller than this regression accuracy parameter, "
"then the node will not be split.");
//UseSurrogates : don't need to be exposed !
//AddParameter(ParameterType_Empty, "classifier.rf.sur", "Surrogate splits will be built");
//SetParameterDescription("classifier.rf.sur","These splits allow working with missing data and compute variable importance correctly.");
//MaxNumberOfCategories
AddParameter(ParameterType_Int, "classifier.rf.cat",
"Cluster possible values of a categorical variable into K <= cat clusters to find a suboptimal split");
......
......@@ -189,10 +189,6 @@ private:
SetParameterDescription("filter.meanshift.minsize", "Minimum size of a region (in pixel unit) in segmentation. Smaller clusters will be merged to the neighboring cluster with the closest radiometry."
" If set to 0 no pruning is done.");
//AddParameter(ParameterType_Empty, "filter.meanshift.useoptim", "use optimization");
//SetParameterDescription("filter.meanshift.useoptim", "Use mode optimization.");
//MandatoryOff("filter.meanshift.useoptim");
SetDefaultParameterInt("filter.meanshift.spatialr", 5);
SetDefaultParameterFloat("filter.meanshift.ranger", 15.0);
SetDefaultParameterFloat("filter.meanshift.thres", 0.1);
......
......@@ -56,7 +56,6 @@ private:
AddDocTag("Test");
//std::cout << "TestApplication::DoInit" << std::endl;
AddParameter(ParameterType_Empty, "empty", "Boolean (old impl.)");
AddParameter(ParameterType_Bool, "boolean", "Boolean");
AddParameter(ParameterType_Int, "int", "Integer");
MandatoryOff("int");
......
......@@ -90,6 +90,8 @@ int otbFourierMellinImageFilter(int itkNotUsed(argc), char* argv[])
imaginaryWriter->SetInput(imaginaryRescaler->GetOutput());
imaginaryWriter->Update();
// Hugly hack for cleaning fftw threads
#if defined( ITK_USE_FFTWF ) || defined( ITK_USE_FFTWD )
fftw_cleanup_threads();
#endif
return EXIT_SUCCESS;
}
......@@ -66,7 +66,7 @@ LibSVMMachineLearningModel<TInputValue,TOutputValue>
this->m_Problem.l = 0;
this->m_Problem.y = nullptr;
this->m_Problem.x = nullptr;
#ifndef NDEBUG
#ifdef NDEBUG
svm_set_print_string_function(&otb::Utils::PrintNothing);
#endif
}
......
......@@ -157,6 +157,8 @@ public:
unsigned long startLine;
TimeType azimuthStopTime;
unsigned long endLine;
unsigned long startSample;
unsigned long endSample;
friend std::ostream & operator<<(std::ostream & os, const BurstRecordType & v)
{
return os << "{ azimuthStartTime: " << v.azimuthStartTime
......@@ -454,6 +456,7 @@ protected:
static const double C;
static const unsigned int thePluginVersion; // version of the SarSensorModel plugin
static const unsigned int thePluginVersionMin; // minimal version required of the SarSensorModel plugin
private:
/** Disabled assignment operator. */
......
......@@ -61,6 +61,8 @@ namespace ossimplugins {
extern const std::string keyVelZ ;
extern const std::string keyStartLine ;
extern const std::string keyEndLine ;
extern const std::string keyStartSample ;
extern const std::string keyEndSample ;
extern const std::string keyAzimuthStartTime ;
extern const std::string keyAzimuthStopTime ;
} // ossimplugins namespace
......
......@@ -107,7 +107,8 @@ namespace ossimplugins
const double ossimSarSensorModel::C = 299792458;
const unsigned int ossimSarSensorModel::thePluginVersion = 2;
const unsigned int ossimSarSensorModel::thePluginVersion = 3;
const unsigned int ossimSarSensorModel::thePluginVersionMin = 2;
ossimSarSensorModel::ProductType::ProductType(string_view const& s)
{
......@@ -1166,7 +1167,22 @@ bool ossimSarSensorModel::worldToAzimuthRangeTime(const ossimGpt& worldPt, TimeT
ossimSarSensorModel::BurstRecordType burstRecord;
get(kwl, burstPrefix + keyStartLine, burstRecord.startLine);
get(kwl, burstPrefix + keyEndLine, burstRecord.endLine);
get(kwl, burstPrefix + keyAzimuthStartTime, burstRecord.azimuthStartTime);
try {
unsigned int version;
get(kwl, HEADER_PREFIX, "version", version);
// startSample and endSample since version 3
if (version >= 3)
{
get(kwl, burstPrefix + keyStartSample, burstRecord.startSample);
get(kwl, burstPrefix + keyEndSample, burstRecord.endSample);
}
}
catch (...) {
throw std::runtime_error("Geom file generated with previous version of ossim plugins");
}
get(kwl, burstPrefix + keyAzimuthStartTime, burstRecord.azimuthStartTime);
get(kwl, burstPrefix + keyAzimuthStopTime, burstRecord.azimuthStopTime);
burstRecords.push_back(burstRecord);
}
......@@ -1185,6 +1201,8 @@ bool ossimSarSensorModel::worldToAzimuthRangeTime(const ossimGpt& worldPt, TimeT
add(kwl, burstPrefix + keyStartLine, (ossim_uint32) burstRecords[burstId].startLine);
add(kwl, burstPrefix + keyEndLine, (ossim_uint32) burstRecords[burstId].endLine);
add(kwl, burstPrefix + keyStartSample, (ossim_uint32) burstRecords[burstId].startSample);
add(kwl, burstPrefix + keyEndSample, (ossim_uint32) burstRecords[burstId].endSample);
add(kwl, burstPrefix + keyAzimuthStartTime, burstRecords[burstId].azimuthStartTime);
add(kwl, burstPrefix + keyAzimuthStopTime, burstRecords[burstId].azimuthStopTime);
}
......@@ -1389,7 +1407,7 @@ bool ossimSarSensorModel::worldToAzimuthRangeTime(const ossimGpt& worldPt, TimeT
try {
unsigned int version;
get(kwl, HEADER_PREFIX, "version", version);
if (version < thePluginVersion) {
if (version < thePluginVersionMin) {
throw std::runtime_error("Geom file generated with previous version of ossim plugins");
}
} catch (...) {
......
......@@ -26,39 +26,41 @@
#include "ossim/ossimSarSensorModelPathsAndKeys.h"
namespace ossimplugins {
const std::string HEADER_PREFIX = "header.";
const std::string SUPPORT_DATA_PREFIX = "support_data.";
const std::string GEOM_PREFIX = "support_data.geom";
const std::string SRD_PREFIX = "support_data.geom.srd";
const std::string SR_PREFIX = "support_data.geom.srd.coords.sr";
const std::string GR_PREFIX = "support_data.geom.srd.coords.gr";
const std::string BURST_PREFIX = "support_data.geom.bursts.burst";
const std::string BURST_NUMBER_KEY = "support_data.geom.bursts.number";
const std::string ORBIT_PREFIX = "orbitList.orbit";
const std::string ORBIT_NUMBER_KEY = "orbitList.nb_orbits";
const std::string GCP_PREFIX = "support_data.geom.gcp";
const std::string GCP_NUMBER_KEY = "support_data.geom.gcp.number";
const std::string NUMBER_KEY = "number";
const std::string HEADER_PREFIX = "header.";
const std::string SUPPORT_DATA_PREFIX = "support_data.";
const std::string GEOM_PREFIX = "support_data.geom";
const std::string SRD_PREFIX = "support_data.geom.srd";
const std::string SR_PREFIX = "support_data.geom.srd.coords.sr";
const std::string GR_PREFIX = "support_data.geom.srd.coords.gr";
const std::string BURST_PREFIX = "support_data.geom.bursts.burst";
const std::string BURST_NUMBER_KEY = "support_data.geom.bursts.number";
const std::string ORBIT_PREFIX = "orbitList.orbit";
const std::string ORBIT_NUMBER_KEY = "orbitList.nb_orbits";
const std::string GCP_PREFIX = "support_data.geom.gcp";
const std::string GCP_NUMBER_KEY = "support_data.geom.gcp.number";
const std::string NUMBER_KEY = "number";
const std::string keySr0 = "sr0";
const std::string keyGr0 = "gr0";
const std::string keyAzimuthTime = "azimuthTime";
const std::string keySlantRangeTime = "slant_range_time";
const std::string keyImPtX = "im_pt.x";
const std::string keyImPtY = "im_pt.y";
const std::string keyWorldPtLat = "world_pt.lat";
const std::string keyWorldPtLon = "world_pt.lon";
const std::string keyWorldPtHgt = "world_pt.hgt";
const std::string keyTime = "time";
const std::string keyPosX = "x_pos";
const std::string keyPosY = "y_pos";
const std::string keyPosZ = "z_pos";
const std::string keyVelX = "x_vel";
const std::string keyVelY = "y_vel";
const std::string keyVelZ = "z_vel";
const std::string keyStartLine = "start_line";
const std::string keyEndLine = "end_line";
const std::string keyAzimuthStartTime = "azimuth_start_time";
const std::string keyAzimuthStopTime = "azimuth_stop_time";
const std::string keySr0 = "sr0";
const std::string keyGr0 = "gr0";
const std::string keyAzimuthTime = "azimuthTime";
const std::string keySlantRangeTime = "slant_range_time";
const std::string keyImPtX = "im_pt.x";
const std::string keyImPtY = "im_pt.y";
const std::string keyWorldPtLat = "world_pt.lat";
const std::string keyWorldPtLon = "world_pt.lon";
const std::string keyWorldPtHgt = "world_pt.hgt";
const std::string keyTime = "time";
const std::string keyPosX = "x_pos";
const std::string keyPosY = "y_pos";
const std::string keyPosZ = "z_pos";
const std::string keyVelX = "x_vel";
const std::string keyVelY = "y_vel";
const std::string keyVelZ = "z_vel";
const std::string keyStartLine = "start_line";
const std::string keyEndLine = "end_line";
const std::string keyStartSample = "start_sample";
const std::string keyEndSample = "end_sample";
const std::string keyAzimuthStartTime = "azimuth_start_time";
const std::string keyAzimuthStopTime = "azimuth_stop_time";
} // ossimplugins namespace
......@@ -51,6 +51,7 @@ namespace {// Anonymous namespace
const ossimString attAdsHeader = "adsHeader";
const ossimString attAzimuthTime = "azimuthTime";
const ossimString attFirstValidSample = "firstValidSample";
const ossimString attLastValidSample = "lastValidSample";
const ossimString attGr0 = "gr0";
const ossimString attGrsrCoefficients = "grsrCoefficients";
const ossimString attHeight = "height";
......@@ -354,10 +355,15 @@ namespace ossimplugins
const bool ret2 = safePlatform->getChildTextValue(instrumentId, "safe:number");
if (ret1 && ret2) {
theManifestKwl.add("support_data.",
// theManifestKwl.add("support_data.",
// "instrument",
// "S1" + instrumentId,
// true);
theManifestKwl.add("manifest_data.",
"instrument",
"S1" + instrumentId,
true);
"S1" + instrumentId,
true);
return familyName + instrumentId;
}
throw std::runtime_error("Cannot obtain Sensor ID");
......@@ -401,7 +407,8 @@ namespace ossimplugins
{
static const char MODULE[] = "ossimSentinel1ProductDoc::parseSafe";
const ossimString prefix = "support_data.";
//const ossimString prefix = "support_data.";
const ossimString prefix = "manifest_data.";
const ossimRefPtr<ossimXmlNode> safeProcessing = manifestDoc.getRoot()->findFirstNode("metadataSection/metadataObject/metadataWrap/xmlData/safe:processing");
const ossimRefPtr<ossimXmlNode> facility = safeProcessing->findFirstNode("safe:facility");
......@@ -686,6 +693,8 @@ namespace ossimplugins
add(theProductKwl, HEADER_PREFIX, "version", thePluginVersion);
//RK maybe use this->getManifestPrefix()
add(theProductKwl, SUPPORT_DATA_PREFIX, "first_line_time", getTextFromFirstNode(adsHeader, "startTime").string());
add(theProductKwl, SUPPORT_DATA_PREFIX, "last_line_time", getTextFromFirstNode(adsHeader, "stopTime").string());
add(theProductKwl, SUPPORT_DATA_PREFIX, "mds1_tx_rx_polar", polarisation);
......@@ -741,7 +750,10 @@ namespace ossimplugins
const ossimXmlNode & downlinkInformation =
getExpectedFirstNode(*productRoot, "generalAnnotation/downlinkInformationList/downlinkInformation");
addOptional(theProductKwl, SUPPORT_DATA_PREFIX, "pulse_repetition_frequency", downlinkInformation, "prf");
//addOptional(theProductKwl, SUPPORT_DATA_PREFIX, "pulse_repetition_frequency", downlinkInformation, "prf");
const double azimuthFrequency = getDoubleFromFirstNode(imageInformation, "azimuthFrequency");
add(theProductKwl, SUPPORT_DATA_PREFIX, "pulse_repetition_frequency", azimuthFrequency);
ossimXmlNode const& swathProcParams =
getExpectedFirstNode(*productRoot, "imageAnnotation/processingInformation/swathProcParamsList/swathProcParams");
......@@ -753,6 +765,12 @@ namespace ossimplugins
addOptional(theProductKwl, SUPPORT_DATA_PREFIX, "range_looks", rangeProcessingNode, "numberOfLooks");
addOptional(theProductKwl, SUPPORT_DATA_PREFIX, "azimuth_looks", azimuthProcessingNode, "numberOfLooks");
// azimuth steering rate for tops_sar only
if (theTOPSAR)
{
addOptional(theProductKwl, SUPPORT_DATA_PREFIX, "azimuth_steering_rate", productInformation, "azimuthSteeringRate");
}
if(!theTOPSAR || !theSLC)
{
addOptional(theProductKwl, SUPPORT_DATA_PREFIX, ossimKeywordNames::NUMBER_SAMPLES_KW, imageInformation, "numberOfSamples");
......@@ -782,6 +800,16 @@ namespace ossimplugins
addDopplerCentroidCoefficients(*dcEstimateList);
}
ossimXmlNodePtr const& aziFmRateList = productRoot->findFirstNode("generalAnnotation/azimuthFmRateList");
if (!aziFmRateList)
{
ossimNotify(ossimNotifyLevel_DEBUG) << "No azimuth fm rate coefficients available in metadata!!\n";
}
else
{
addAzimuthFmRateCoefficients(*aziFmRateList);
}
readBurstRecords(*productRoot, imageInformation);
readGeoLocationGrid(*productRoot);
......@@ -935,6 +963,10 @@ namespace ossimplugins
burstRecord.azimuthStartTime = add(theProductKwl, BURST_PREFIX, "[0].azimuth_start_time", getTimeFromFirstNode(imageInformation, "productFirstLineUtcTime"));
burstRecord.azimuthStopTime = add(theProductKwl, BURST_PREFIX, "[0].azimuth_stop_time", getTimeFromFirstNode(imageInformation, "productLastLineUtcTime"));
burstRecord.endLine = add(theProductKwl, BURST_PREFIX, "[0].end_line", getFromFirstNode<unsigned int>(imageInformation, "numberOfLines")-1);
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);
theBurstRecords.push_back(burstRecord);
}
else
......@@ -942,17 +974,22 @@ namespace ossimplugins
char burstPrefix[1024];
const unsigned int linesPerBurst = getFromFirstNode<unsigned int>(productRoot, "swathTiming/linesPerBurst");
const unsigned int samplesPerBurst = getFromFirstNode<unsigned int>(productRoot, "swathTiming/samplesPerBurst");
unsigned int burstId(0);
for(std::vector<ossimRefPtr<ossimXmlNode> >::iterator itNode = xnodes.begin(); itNode!=xnodes.end();++itNode,++burstId)
{
BurstRecordType burstRecord;
const TimeType azTime = getTimeFromFirstNode(**itNode, attAzimuthTime);
ossimString const& s = getTextFromFirstNode(**itNode, attFirstValidSample);
ossim_int64 first_valid(0), last_valid(0);
ossim_int64 first_valid(0), last_valid(0);
bool begin_found(false), end_found(false);
ossim_int64 first_sample_valid(0), last_sample_valid(samplesPerBurst-1);
const TimeType azTime = getTimeFromFirstNode(**itNode, attAzimuthTime);
// Scan firstValidSample to define the first valid sample and valid lines
ossimString const& s = getTextFromFirstNode(**itNode, attFirstValidSample);
std::vector<ossimString> ssp = s.split(" ");
for (std::vector<ossimString>::const_iterator sIt = ssp.begin(), e = ssp.end()
......@@ -960,6 +997,7 @@ namespace ossimplugins
; ++sIt
)
{
// Find valid lines
if(!begin_found)
{
if(*sIt!="-1")
......@@ -983,11 +1021,62 @@ namespace ossimplugins
++last_valid;
}
}
// Find first valid samples
if(*sIt!="-1")
{
int Fvs = samplesPerBurst;
try
{
Fvs = std::stoi(*sIt);
}
catch( ... )
{
// Throw an execption
throw std::runtime_error("Failed to convert firstValidSample value.");
}
if (Fvs > first_sample_valid && Fvs < samplesPerBurst)
{
first_sample_valid = Fvs;
}
}
}
// Scan lastValidSample to define the last valid sample
ossimString const& sLast = getTextFromFirstNode(**itNode, attLastValidSample);
std::vector<ossimString> sspLast = sLast.split(" ");
for (std::vector<ossimString>::const_iterator sIt = sspLast.begin(), e = sspLast.end()
; sIt != e ; ++sIt)
{
// Last first valid samples
if(*sIt!="-1")
{
int Lvs = 0;
try
{
Lvs = std::stoi(*sIt);
}
catch( ... )
{
// Throw an execption
throw std::runtime_error("Failed to convert lastValidSample value.");
}
if (Lvs < last_sample_valid && Lvs > 0)
{
last_sample_valid = Lvs;
}
}
}
s_printf(burstPrefix, "%s[%d].", BURST_PREFIX.c_str(), burstId);
burstRecord.startLine = add(theProductKwl,burstPrefix + keyStartLine, burstId*linesPerBurst + first_valid);
burstRecord.endLine = add(theProductKwl,burstPrefix + keyEndLine, burstId*linesPerBurst + last_valid);
burstRecord.startSample = add(theProductKwl,burstPrefix + keyStartSample, first_sample_valid);
burstRecord.endSample = add(theProductKwl,burstPrefix + keyEndSample, last_sample_valid);
// TODO: check units.
burstRecord.azimuthStartTime = add(theProductKwl,burstPrefix + keyAzimuthStartTime, azTime + (first_valid*theAzimuthTimeInterval));
burstRecord.azimuthStopTime = add(theProductKwl,burstPrefix + keyAzimuthStopTime, azTime + (last_valid*theAzimuthTimeInterval));
......@@ -995,6 +1084,12 @@ namespace ossimplugins
theBurstRecords.push_back(burstRecord);
}
add(theProductKwl, BURST_NUMBER_KEY, burstId);
const std::string BURST_NUMBER_LINES_KEY = "support_data.geom.bursts.number_lines_per_burst";
add(theProductKwl, BURST_NUMBER_LINES_KEY, linesPerBurst);
const std::string BURST_NUMBER_SAMPLES_KEY = "support_data.geom.bursts.number_samples_per_burst";
add(theProductKwl, BURST_NUMBER_SAMPLES_KEY, samplesPerBurst);
}
}
......@@ -1184,6 +1279,11 @@ namespace ossimplugins
ossimString count_str;
dcEstimateList.getAttributeValue(count_str, "count");
const int count = count_str.toInt();
char prefix_main[256];
s_printf(prefix_main, "dopplerCentroid.dop_coef_nb_list");
add(theProductKwl, prefix_main, "", count);
if( count < 1)
{
ossimNotify(ossimNotifyLevel_DEBUG) << "No doppler centroid coefficients available in metadata!!\n";
......@@ -1206,7 +1306,10 @@ namespace ossimplugins
assert(dcEstimate.get());
addOptional(theProductKwl, prefix, "dop_coef_time", *dcEstimate, "azimuthTime");
//RK
const double ref_time = getOptionalTextFromFirstNode(*dcEstimate, "t0").toFloat64() * 1e9; // s to ns
//const double ref_time = getOptionalTextFromFirstNode(*dcEstimate, "t0").toFloat64() * 1e9; // s to ns
const double ref_time = getOptionalTextFromFirstNode(*dcEstimate, "t0").toFloat64(); // remain in s
add(theProductKwl, prefix, keySlantRangeTime, ref_time);
ossimString const& ns = getOptionalTextFromFirstNode(*dcEstimate, "ns");
......@@ -1228,18 +1331,104 @@ namespace ossimplugins
for (int count = 1 ; coeff != result.end() ; ++count, ++coeff)
{
char coeff_prefix[256];
s_printf(coeff_prefix, "%s%d.dop_coef", prefix, count);
s_printf(coeff_prefix, "%s%d.geo_dop_coef", prefix, count);
add(theProductKwl, coeff_prefix, coeff->string());
}
} //if (!coeffStr.empty())
ossimString const& coeffDopStr = getOptionalTextFromFirstNode(*dcEstimate, "dataDcPolynomial");
if (!coeffDopStr.empty())
{
const ossimString separatorList = " ";
std::vector<ossimString> result;
coeffDopStr.split(result, separatorList, true);
std::vector<ossimString>::const_iterator coeff = result.begin();
for (int count = 1 ; coeff != result.end() ; ++count, ++coeff)
{
char coeff_prefix[256];
s_printf(coeff_prefix, "%s%d.dop_coef", prefix, count);
add(theProductKwl, coeff_prefix, coeff->string());
}
} //if (!coeffDopStr.empty())
} // for each dcEstimate