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

REFAC: only test the number of band in an assertion when needed

parent 0ce954ad
......@@ -357,8 +357,6 @@ std::vector<Orbit> CosmoImageMetadataInterface::getOrbits(const MetadataSupplier
void CosmoImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
{
assert(mds.GetNbBands() == this->m_Imd.Bands.size());
// Check Mission Id, acquisition mode and product type
Fetch(MDStr::Mission, mds, "MISSION_ID");
......@@ -431,7 +429,6 @@ void CosmoImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
sarParam.orbits = this->getOrbits(mds, reference_UTC);
m_Imd.Bands[0].Add(MDGeom::SAR, sarParam);
}
......
......@@ -246,8 +246,6 @@ Radarsat2ImageMetadataInterface::UIntVectorType Radarsat2ImageMetadataInterface:
void Radarsat2ImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
{
assert(mds.GetNbBands() == this->m_Imd.Bands.size());
// Metadata read by GDAL
Fetch(MDTime::AcquisitionStartTime, mds, "ACQUISITION_START_TIME");
// Fetch(MDTime::AcquisitionStopTime, mds, "PROCESSING_TIME");
......@@ -285,6 +283,8 @@ void Radarsat2ImageMetadataInterface::Parse(const MetadataSupplierInterface & md
m_Imd.Add(MDNum::CenterIncidenceAngle, this->GetCenterIncidenceAngle());
assert(mds.GetNbBands() == this->m_Imd.Bands.size());
SARParam sarParam;
for (int bandId = 0 ; bandId < mds.GetNbBands() ; ++bandId)
{
......
......@@ -526,7 +526,6 @@ double Sentinel1ImageMetadataInterface::getBandTerrainHeight(const XMLMetadataSu
void Sentinel1ImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
{
assert(mds.GetNbBands() == this->m_Imd.Bands.size());
// Metadata read by GDAL
Fetch(MDTime::AcquisitionStartTime, mds, "ACQUISITION_START_TIME");
Fetch(MDTime::AcquisitionStopTime, mds, "ACQUISITION_STOP_TIME");
......@@ -555,6 +554,7 @@ void Sentinel1ImageMetadataInterface::Parse(const MetadataSupplierInterface & md
ManifestMS.GetFirstAs<MetaData::Time>("xfdu:XFDU.metadataSection.metadataObject_#.metadataWrap.xmlData.safe:acquisitionPeriod.safe:startTime"));
}
assert(mds.GetNbBands() == this->m_Imd.Bands.size());
// Band metadata
for (int bandId = 0 ; bandId < mds.GetNbBands() ; ++bandId)
{
......
......@@ -1248,8 +1248,6 @@ void TerraSarImageMetadataInterface::PrintSelf(std::ostream& os, itk::Indent ind
void TerraSarImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
{
assert(mds.GetNbBands() == this->m_Imd.Bands.size());
// Metadata read by GDAL
Fetch(MDNum::LineSpacing, mds, "ROW_SPACING");
Fetch(MDStr::Mode, mds, "IMAGING_MODE");
......@@ -1286,6 +1284,8 @@ void TerraSarImageMetadataInterface::Parse(const MetadataSupplierInterface & mds
}
assert(mds.GetNbBands() == this->m_Imd.Bands.size());
SARParam sarParam;
for (int bandId = 0 ; bandId < mds.GetNbBands() ; ++bandId)
{
......
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