Commit 0ef13638 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

REFAC: remove unused metadata SarParam.SARNoise

parent f7b253fd
......@@ -69,20 +69,6 @@ struct OTBMetadata_EXPORT DopplerCentroid
std::vector<double> geoDopCoef;
};
/** \struct SARNoise
*
* \brief This structure is used to handle Noise look up tables
*/
struct OTBMetadata_EXPORT SARNoise
{
/** Image line at which the noise vector applies */
int line;
/** Zero Doppler azimuth time at which noise vector applies */
MetaData::Time azimuthTime;
/** Noise look up talbe */
MetaData::LUT1D noiseLut;
};
/** \struct Orbit
*
* \brief This structure is used to handle orbit information
......@@ -165,9 +151,6 @@ struct OTBMetadata_EXPORT SARParam
/** Doppler centroid estimates */
std::vector<DopplerCentroid> dopplerCentroids;
/** Noise look up tables */
std::vector<SARNoise> noiseVector;
/** List of orbit information */
std::vector<Orbit> orbits;
......
......@@ -116,7 +116,6 @@ public:
std::vector<DopplerCentroid> GetDopplerCentroidGeom() const;
std::vector<Orbit> GetOrbitsGeom() const;
std::vector<BurstRecord> GetBurstRecordsGeom() const;
std::vector<SARNoise> GetNoiseVectorGeom() const;
/**
* @brief Loads the radiometric calibration data to the SARCalib
......
......@@ -128,9 +128,6 @@ protected:
/* Fetch the Orbits metadata */
std::vector<Orbit> GetOrbits(const XMLMetadataSupplier&) const;
/* Fetch the noise LUTs */
std::vector<SARNoise> GetNoiseVector(const XMLMetadataSupplier&) const;
/* Fetch the burst records */
std::vector<BurstRecord> GetBurstRecords(const XMLMetadataSupplier&, const MetaData::DurationType & azimuthTimeInterval) const;
......
......@@ -307,33 +307,6 @@ std::vector<BurstRecord> SarImageMetadataInterface::GetBurstRecordsGeom() const
return burstRecords;
}
std::vector<SARNoise> SarImageMetadataInterface::GetNoiseVectorGeom() const
{
std::vector<SARNoise> noiseVector;
// This streams wild hold the iteration number
std::ostringstream oss;
// Path: noise.noiseVector[<listId>].{azimuthTime,line,noiseLut,pixel,pixel_count}
for (int listId = 0 ; m_MetadataSupplierInterface->GetAs<std::string>("", std::string("noise.noiseVector[")+std::to_string(listId)+std::string("].pixel_count")) != "" ; ++listId)
{
oss.str("");
oss << listId;
// Base path to the data, that depends on the iteration number
std::string path_root = "noise.noiseVector[" + oss.str() + "]";
SARNoise noiseVect;
std::istringstream(m_MetadataSupplierInterface->GetAs<std::string>(path_root + ".azimuthTime")) >> noiseVect.azimuthTime;
MetaData::LUT1D noiseLut;
MetaData::LUTAxis ax1;
// note: in some geom products pixel_count does not match the vector size in noiseVector.
ax1.Values = m_MetadataSupplierInterface->GetAsVector<double>(path_root + ".pixel", ' ');
ax1.Size = ax1.Values.size();
noiseLut.Axis[0] = ax1;
noiseLut.Array = m_MetadataSupplierInterface->GetAsVector<double>(path_root + ".noiseLut", ' ', ax1.Size);
noiseVect.noiseLut = std::move(noiseLut);
noiseVector.push_back(std::move(noiseVect));
}
return noiseVector;
}
bool SarImageMetadataInterface::GetSAR(SARParam & sarParam) const
{
bool hasValue;
......@@ -344,7 +317,6 @@ bool SarImageMetadataInterface::GetSAR(SARParam & sarParam) const
sarParam.azimuthFmRates = this->GetAzimuthFmRateGeom();
sarParam.dopplerCentroids = this->GetDopplerCentroidGeom();
sarParam.orbits = this->GetOrbitsGeom();
sarParam.noiseVector = this->GetNoiseVectorGeom();
sarParam.burstRecords = this->GetBurstRecordsGeom();
const std::string supportDataPrefix = "support_data.";
......
......@@ -607,52 +607,6 @@ std::vector<Orbit> Sentinel1ImageMetadataInterface::GetOrbits(const XMLMetadataS
return orbitVector;
}
std::vector<SARNoise> Sentinel1ImageMetadataInterface::GetNoiseVector(const XMLMetadataSupplier &xmlMS) const
{
std::vector<SARNoise> noiseVector;
std::string rangeNoisePrefix = "noise.noiseVectorList.";
std::string rangeVectorName = "noiseVector_";
std::string rangeLUTName = ".noiseLut";
// Number of entries in the vector
int listCount = xmlMS.GetAs<int>(0, rangeNoisePrefix + "count");
// Starting with IPF 2.9.0, the noiseLut field has been renamed into noiseRangeVectorList, and the
// noiseAzimuthVectorList has been added.
// Ref: MPC-0392 DI-MPC-TN Issue 1.1 2017,Nov.28 Thermal Denoising of Products Generated by the S-1 IPF
if (!listCount)
{
rangeNoisePrefix = "noise.noiseRangeVectorList.";
rangeVectorName = "noiseRangeVector_";
rangeLUTName = ".noiseRangeLut";
listCount = xmlMS.GetAs<int>(rangeNoisePrefix + "count");
}
// This streams wild hold the iteration number
std::ostringstream oss;
for (int listId = 1 ; listId <= listCount ; ++listId)
{
oss.str("");
oss << listId;
// Base path to the data, that depends on the iteration number
std::string path_root = rangeNoisePrefix + rangeVectorName + oss.str();
SARNoise noiseVect;
std::istringstream(xmlMS.GetAs<std::string>(path_root + ".azimuthTime")) >> noiseVect.azimuthTime;
MetaData::LUT1D noiseLut;
MetaData::LUTAxis ax1;
ax1.Size = xmlMS.GetAs<int>(path_root + ".pixel.count");
ax1.Values = xmlMS.GetAsVector<double>(path_root + ".pixel", ' ', ax1.Size);
noiseLut.Axis[0] = ax1;
noiseLut.Array = xmlMS.GetAsVector<double>(path_root + rangeLUTName,
' ', xmlMS.GetAs<int>(path_root + rangeLUTName + ".count"));
noiseVect.noiseLut = noiseLut;
noiseVector.push_back(noiseVect);
}
return noiseVector;
}
std::vector<BurstRecord> Sentinel1ImageMetadataInterface::GetBurstRecords(const XMLMetadataSupplier &xmlMS, const MetaData::DurationType& azimuthTimeInterval) const
{
std::vector<BurstRecord> burstRecords;
......@@ -1014,8 +968,6 @@ void Sentinel1ImageMetadataInterface::ParseGdal(ImageMetadata & imd)
{
otbGenericExceptionMacro(MissingMetadataException,<<"Missing Noise file for image '"<<ManifestFilePath<<"'");
}
XMLMetadataSupplier NoiseMS(NoiseFilePath);
sarParam.noiseVector = this->GetNoiseVector(NoiseMS);
imd.Add(MDGeom::SAR, sarParam);
......@@ -1024,6 +976,8 @@ void Sentinel1ImageMetadataInterface::ParseGdal(ImageMetadata & imd)
std::istringstream(CalibrationMS.GetAs<std::string>("calibration.adsHeader.stopTime")) >> sarCalib.calibrationStopTime;
LoadRadiometricCalibrationData(sarCalib, *m_MetadataSupplierInterface, imd);
CreateCalibrationLookupData(sarCalib, imd, CalibrationMS, false);
XMLMetadataSupplier NoiseMS(NoiseFilePath);
CreateThermalNoiseLookupData(sarCalib, imd, NoiseMS, false);
imd.Add(MDGeom::SARCalib, sarCalib);
}
......
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