Commit 75d0eb0a authored by Cyrille Valladeau's avatar Cyrille Valladeau

ENH : TSX calib in progress

parent e2ff51d8
......@@ -52,7 +52,7 @@ TerraSarImageMetadataInterface::GetSensorID( const MetaDataDictionaryType & dict
ossimKeywordlist kwl;
ImageKeywordlist.convertToOSSIMKeywordlist(kwl);
kwl.print(std::cout);
std::string key= "sensor";
ossimString keywordString = kwl.find(key.c_str());
std::string output(keywordString.chars());
......@@ -540,7 +540,6 @@ TerraSarImageMetadataInterface::GetNoiseTimeUTCList( const MetaDataDictionaryTyp
myDate.setMin(minu);
myDate.setSec(sec);
std::cout<<secDec*1e-5/0.864<<std::endl;
julianDay = myDate.getJulian();
// add the decimal second to the julian day (0.00001 <-> 0.864s)
julianDay += secDec*1e-5/0.864;
......
......@@ -34,7 +34,6 @@ TerraSarBrightnessImageFilter<TInputImage,TOutputImage>
Superclass::BeforeThreadedGenerateData();
// If the user doesn't set it AND the metadata is available, set calFactor using image metadata
std::cout<<this->GetCalFactor()<<std::endl;
if (this->GetCalFactor() == itk::NumericTraits<double>::min())
{
/** TODO : use a factory for RADAR image metadata interface */
......
......@@ -48,43 +48,43 @@ int otbTerraSarImageMetadataInterface (int argc, char* argv[])
otb::TerraSarImageMetadataInterface::Pointer lImageMetadata = otb::TerraSarImageMetadataInterface::New();
lImageMetadata->GetNoise(reader->GetOutput()->GetMetaDataDictionary())->print(std::cout);
std::cout<<lImageMetadata->GetNumberOfNoiseRecords(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
UIntVectorType deg = lImageMetadata->GetNoisePolynomialDegrees(reader->GetOutput()->GetMetaDataDictionary());
std::ofstream file;
file.open(outputFilename);
file<<"GetSensorID: "<<lImageMetadata->GetSensorID(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetMinute: "<<lImageMetadata->GetMinute(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetHour: "<<lImageMetadata->GetHour(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetDay: "<<lImageMetadata->GetDay(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetMonth: "<<lImageMetadata->GetMonth(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetYear: "<<lImageMetadata->GetYear(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetProductionDay: "<<lImageMetadata->GetProductionDay(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetProductionMonth: "<<lImageMetadata->GetProductionMonth(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetProductionYear: "<<lImageMetadata->GetProductionYear(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetCalibrationFactor: "<<lImageMetadata->GetCalibrationFactor(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetRadarFrequency: "<<lImageMetadata->GetRadarFrequency(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<std::endl;
file<<"Noise attributs: "<<std::endl;
UIntVectorType deg = lImageMetadata->GetNoisePolynomialDegrees(reader->GetOutput()->GetMetaDataDictionary());
DoubleVectorVectorType coeffs = lImageMetadata->GetNoisePolynomialCoefficientsList(reader->GetOutput()->GetMetaDataDictionary());
DoubleVectorType mins = lImageMetadata->GetNoiseValidityRangeMinList(reader->GetOutput()->GetMetaDataDictionary());
DoubleVectorType maxs = lImageMetadata->GetNoiseValidityRangeMaxList(reader->GetOutput()->GetMetaDataDictionary());
DoubleVectorType ref = lImageMetadata->GetNoiseReferencePointList(reader->GetOutput()->GetMetaDataDictionary());
DoubleVectorType time = lImageMetadata->GetNoiseTimeUTCList(reader->GetOutput()->GetMetaDataDictionary());
DoubleVectorType mins = lImageMetadata->GetNoiseValidityRangeMinList(reader->GetOutput()->GetMetaDataDictionary());
DoubleVectorType maxs = lImageMetadata->GetNoiseValidityRangeMaxList(reader->GetOutput()->GetMetaDataDictionary());
DoubleVectorType ref = lImageMetadata->GetNoiseReferencePointList(reader->GetOutput()->GetMetaDataDictionary());
DoubleVectorType time = lImageMetadata->GetNoiseTimeUTCList(reader->GetOutput()->GetMetaDataDictionary());
file<<"GetNumberOfNoiseRecords: "<< lImageMetadata->GetNumberOfNoiseRecords(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
for( unsigned int i=0; i<deg.size(); i++ )
{
std::cout<<"~~~~~~~ Polynome "<<i<<" ( degree: "<<deg[i]<<")"<<std::endl;
file<<"Noise Polynom "<<i<<" ( degree: "<<deg[i]<<")"<<std::endl;
file<<"coefficients: ";
for( unsigned int j=0; j<coeffs[i].size(); j++ )
{
std::cout<<coeffs[i][j]<<" ";
file<<coeffs[i][j]<<" ";
}
std::cout<<std::endl;
std::cout<<mins[i]<<std::endl;
std::cout<<maxs[i]<<std::endl;
std::cout<<ref[i]<<std::endl;
std::cout<<time[i]<<std::endl;
file<<std::endl;
file<<"Min validity range: "<<mins[i]<<std::endl;
file<<"Min validity range: "<<maxs[i]<<std::endl;
file<<"Reference point: "<<ref[i]<<std::endl;
file<<"Time UTC: "<<time[i]<<std::endl;
}
std::cout<<lImageMetadata->GetRadarFrequency(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
std::ofstream file;
file.open(outputFilename);
file<<"GetSensorID: "<<lImageMetadata->GetSensorID(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetMinute: "<<lImageMetadata->GetMinute(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetHour: "<<lImageMetadata->GetHour(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetDay: "<<lImageMetadata->GetDay(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetMonth: "<<lImageMetadata->GetMonth(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetYear: "<<lImageMetadata->GetYear(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetProductionDay: "<<lImageMetadata->GetProductionDay(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetProductionMonth: "<<lImageMetadata->GetProductionMonth(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetProductionYear: "<<lImageMetadata->GetProductionYear(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file<<"GetCalibrationFactor: "<<lImageMetadata->GetCalibrationFactor(reader->GetOutput()->GetMetaDataDictionary())<<std::endl;
file.close();
return EXIT_SUCCESS;
......
......@@ -218,7 +218,7 @@ bool ossimplugins::ossimTerraSarModel::open(const ossimFilename& file)
cout << "result of getting SceneID" << result << endl;
}
// Set the sensor ID to the mission ID.
// Set the sensor ID to the mission ID.
if (result)
{
result = tsDoc.getMission(xdoc, theSensorID);
......@@ -1839,6 +1839,7 @@ bool ossimplugins::ossimTerraSarModel::findTSXLeader(const ossimFilename& file,
}
}
}
return res;
}
......@@ -664,6 +664,8 @@ bool ossimplugins::ossimTerraSarProductDoc::getMission(
const ossimXmlDocument* xdoc, ossimString& s) const
{
ossimString path = "/level1Product/generalHeader/mission";
ossim::getPath(path, xdoc, s);
return ossim::getPath(path, xdoc, s);
}
......
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