Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
David Youssefi
otb
Commits
360b8f16
Commit
360b8f16
authored
Jul 09, 2020
by
Julien Osman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: Read AverageBandHeight for Sentinel1 + fix little bug
parent
3ec03180
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
11 deletions
+34
-11
Data/Baseline/OTB/Files/ioTvImageMetadataInterfaceTest_Sentinel1.txt
...ne/OTB/Files/ioTvImageMetadataInterfaceTest_Sentinel1.txt
+3
-0
Modules/Core/Metadata/include/otbMetaDataKey.h
Modules/Core/Metadata/include/otbMetaDataKey.h
+1
-0
Modules/Core/Metadata/include/otbSentinel1ImageMetadataInterface.h
...ore/Metadata/include/otbSentinel1ImageMetadataInterface.h
+2
-0
Modules/Core/Metadata/src/otbMetaDataKey.cxx
Modules/Core/Metadata/src/otbMetaDataKey.cxx
+1
-0
Modules/Core/Metadata/src/otbSentinel1ImageMetadataInterface.cxx
.../Core/Metadata/src/otbSentinel1ImageMetadataInterface.cxx
+27
-11
No files found.
Data/Baseline/OTB/Files/ioTvImageMetadataInterfaceTest_Sentinel1.txt
View file @
360b8f16
...
...
@@ -11,6 +11,9 @@ TileHintX 17663
TileHintY 1
DataType 11
OrbitNumber 6447
NumberOfLines 31106
NumberOfColumns 17663
AverageSceneHeight 19
LineSpacing 4.08568
PixelSpacing 3.19483
AcquisitionDate 2015-06-19T19:50:43.223221Z
...
...
Modules/Core/Metadata/include/otbMetaDataKey.h
View file @
360b8f16
...
...
@@ -134,6 +134,7 @@ enum class MDNum
OrbitNumber
,
NumberOfLines
,
NumberOfColumns
,
AverageSceneHeight
,
// optical section
PhysicalGain
,
PhysicalBias
,
...
...
Modules/Core/Metadata/include/otbSentinel1ImageMetadataInterface.h
View file @
360b8f16
...
...
@@ -104,6 +104,8 @@ public:
/* fetch the noise LUTs */
std
::
vector
<
OTB_SARNoise
>
GetNoiseVector
(
XMLMetadataSupplier
)
const
;
double
getBandTerrainHeight
(
XMLMetadataSupplier
)
const
;
void
Parse
(
const
MetadataSupplierInterface
*
)
override
;
protected:
...
...
Modules/Core/Metadata/src/otbMetaDataKey.cxx
View file @
360b8f16
...
...
@@ -320,6 +320,7 @@ MDNumBmType MDNumNames = bimapGenerator<MDNum>(std::map<MDNum, std::string> {
{
MDNum
::
NoData
,
"NoData"
},
{
MDNum
::
NumberOfLines
,
"NumberOfLines"
},
{
MDNum
::
NumberOfColumns
,
"NumberOfColumns"
},
{
MDNum
::
AverageSceneHeight
,
"AverageSceneHeight"
},
{
MDNum
::
OrbitNumber
,
"OrbitNumber"
},
{
MDNum
::
PhysicalGain
,
"PhysicalGain"
},
{
MDNum
::
PhysicalBias
,
"PhysicalBias"
},
...
...
Modules/Core/Metadata/src/otbSentinel1ImageMetadataInterface.cxx
View file @
360b8f16
...
...
@@ -355,7 +355,7 @@ double Sentinel1ImageMetadataInterface::GetCenterIncidenceAngle() const
std
::
vector
<
OTB_azimuthFmRate
>
Sentinel1ImageMetadataInterface
::
GetAzimuthFmRate
(
XMLMetadataSupplier
xmlMS
)
const
{
std
::
vector
<
OTB_azimuthFmRate
>
azimuthFmRateVector
;
int
listCount
=
xmlMS
.
GetAs
<
double
>
(
"product.generalAnnotation.azimuthFmRateList.count"
);
int
listCount
=
xmlMS
.
GetAs
<
int
>
(
"product.generalAnnotation.azimuthFmRateList.count"
);
std
::
ostringstream
oss
;
for
(
int
listId
=
1
;
listId
<=
listCount
;
++
listId
)
{
...
...
@@ -375,7 +375,7 @@ std::vector<OTB_azimuthFmRate> Sentinel1ImageMetadataInterface::GetAzimuthFmRate
std
::
vector
<
OTB_dopplerCentroid
>
Sentinel1ImageMetadataInterface
::
GetDopplerCentroid
(
XMLMetadataSupplier
xmlMS
)
const
{
std
::
vector
<
OTB_dopplerCentroid
>
dopplerCentroidVector
;
int
listCount
=
xmlMS
.
GetAs
<
double
>
(
"product.dopplerCentroid.dcEstimateList.count"
);
int
listCount
=
xmlMS
.
GetAs
<
int
>
(
"product.dopplerCentroid.dcEstimateList.count"
);
std
::
ostringstream
oss
;
for
(
int
listId
=
1
;
listId
<=
listCount
;
++
listId
)
{
...
...
@@ -397,7 +397,7 @@ std::vector<OTB_dopplerCentroid> Sentinel1ImageMetadataInterface::GetDopplerCent
std
::
vector
<
OTB_Orbit
>
Sentinel1ImageMetadataInterface
::
GetOrbits
(
XMLMetadataSupplier
xmlMS
)
const
{
std
::
vector
<
OTB_Orbit
>
orbitVector
;
int
listCount
=
xmlMS
.
GetAs
<
double
>
(
"product.generalAnnotation.orbitList.count"
);
int
listCount
=
xmlMS
.
GetAs
<
int
>
(
"product.generalAnnotation.orbitList.count"
);
std
::
ostringstream
oss
;
for
(
int
listId
=
1
;
listId
<=
listCount
;
++
listId
)
{
...
...
@@ -406,12 +406,12 @@ std::vector<OTB_Orbit> Sentinel1ImageMetadataInterface::GetOrbits(XMLMetadataSup
std
::
string
path_root
=
"product.generalAnnotation.orbitList.orbit_"
+
oss
.
str
();
OTB_Orbit
orbit
;
std
::
istringstream
(
xmlMS
.
GetAs
<
std
::
string
>
(
path_root
+
".time"
))
>>
orbit
.
time
;
orbit
.
posX
=
xmlMS
.
GetAs
<
double
>
(
path_root
+
"
1
.position.x"
);
orbit
.
posY
=
xmlMS
.
GetAs
<
double
>
(
path_root
+
"
1
.position.y"
);
orbit
.
posZ
=
xmlMS
.
GetAs
<
double
>
(
path_root
+
"
1
.position.z"
);
orbit
.
velX
=
xmlMS
.
GetAs
<
double
>
(
path_root
+
"
1
.velocity.x"
);
orbit
.
velY
=
xmlMS
.
GetAs
<
double
>
(
path_root
+
"
1
.velocity.y"
);
orbit
.
velZ
=
xmlMS
.
GetAs
<
double
>
(
path_root
+
"
1
.velocity.z"
);
orbit
.
posX
=
xmlMS
.
GetAs
<
double
>
(
path_root
+
".position.x"
);
orbit
.
posY
=
xmlMS
.
GetAs
<
double
>
(
path_root
+
".position.y"
);
orbit
.
posZ
=
xmlMS
.
GetAs
<
double
>
(
path_root
+
".position.z"
);
orbit
.
velX
=
xmlMS
.
GetAs
<
double
>
(
path_root
+
".velocity.x"
);
orbit
.
velY
=
xmlMS
.
GetAs
<
double
>
(
path_root
+
".velocity.y"
);
orbit
.
velZ
=
xmlMS
.
GetAs
<
double
>
(
path_root
+
".velocity.z"
);
orbitVector
.
push_back
(
orbit
);
}
return
orbitVector
;
...
...
@@ -420,7 +420,7 @@ std::vector<OTB_Orbit> Sentinel1ImageMetadataInterface::GetOrbits(XMLMetadataSup
std
::
vector
<
OTB_calibrationVector
>
Sentinel1ImageMetadataInterface
::
GetCalibrationVector
(
XMLMetadataSupplier
xmlMS
)
const
{
std
::
vector
<
OTB_calibrationVector
>
calibrationVector
;
int
listCount
=
xmlMS
.
GetAs
<
double
>
(
"calibration.calibrationVectorList.count"
);
int
listCount
=
xmlMS
.
GetAs
<
int
>
(
"calibration.calibrationVectorList.count"
);
std
::
ostringstream
oss
;
for
(
int
listId
=
1
;
listId
<=
listCount
;
++
listId
)
{
...
...
@@ -469,7 +469,7 @@ std::vector<OTB_calibrationVector> Sentinel1ImageMetadataInterface::GetCalibrati
std
::
vector
<
OTB_SARNoise
>
Sentinel1ImageMetadataInterface
::
GetNoiseVector
(
XMLMetadataSupplier
xmlMS
)
const
{
std
::
vector
<
OTB_SARNoise
>
noiseVector
;
int
listCount
=
xmlMS
.
GetAs
<
double
>
(
"noise.noiseVectorList.count"
);
int
listCount
=
xmlMS
.
GetAs
<
int
>
(
"noise.noiseVectorList.count"
);
std
::
ostringstream
oss
;
for
(
int
listId
=
1
;
listId
<=
listCount
;
++
listId
)
{
...
...
@@ -491,6 +491,21 @@ std::vector<OTB_SARNoise> Sentinel1ImageMetadataInterface::GetNoiseVector(XMLMet
return
noiseVector
;
}
double
Sentinel1ImageMetadataInterface
::
getBandTerrainHeight
(
XMLMetadataSupplier
xmlMS
)
const
{
double
heightSum
=
0.0
;
int
listCount
=
xmlMS
.
GetAs
<
int
>
(
"product.generalAnnotation.terrainHeightList.count"
);
std
::
ostringstream
oss
;
for
(
int
listId
=
1
;
listId
<=
listCount
;
++
listId
)
{
oss
.
str
(
""
);
oss
<<
listId
;
std
::
string
path_root
=
"product.generalAnnotation.terrainHeightList.terrainHeight_"
+
oss
.
str
();
heightSum
+=
xmlMS
.
GetAs
<
double
>
((
path_root
+
".value"
).
c_str
());
}
return
heightSum
/
listCount
;
}
void
Sentinel1ImageMetadataInterface
::
Parse
(
const
MetadataSupplierInterface
*
mds
)
{
assert
(
mds
);
...
...
@@ -543,6 +558,7 @@ void Sentinel1ImageMetadataInterface::Parse(const MetadataSupplierInterface *mds
sarParam
.
orbits
=
this
->
GetOrbits
(
AnnotationMS
);
m_Imd
.
Add
(
MDNum
::
NumberOfLines
,
AnnotationMS
.
GetAs
<
int
>
(
"product.imageAnnotation.imageInformation.numberOfLines"
));
m_Imd
.
Add
(
MDNum
::
NumberOfColumns
,
AnnotationMS
.
GetAs
<
int
>
(
"product.imageAnnotation.imageInformation.numberOfSamples"
));
m_Imd
.
Add
(
MDNum
::
AverageSceneHeight
,
this
->
getBandTerrainHeight
(
AnnotationFilePath
));
// Calibration file
std
::
string
CalibrationFilePath
=
itksys
::
SystemTools
::
GetFilenamePath
(
AnnotationFilePath
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment