Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
e8c6e7de
Commit
e8c6e7de
authored
Nov 23, 2020
by
Cédric Traizet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG: verify that the sensor is CosmoSkyMed before opening hdf5 datasets
parent
0777d9f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
23 deletions
+23
-23
Modules/Core/Metadata/src/otbCosmoImageMetadataInterface.cxx
Modules/Core/Metadata/src/otbCosmoImageMetadataInterface.cxx
+23
-23
No files found.
Modules/Core/Metadata/src/otbCosmoImageMetadataInterface.cxx
View file @
e8c6e7de
...
...
@@ -359,6 +359,29 @@ 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"
);
if
(
m_Imd
[
MDStr
::
Mission
]
!=
"CSK"
)
{
otbGenericExceptionMacro
(
MissingMetadataException
,
<<
"Not a CosmoSkyMed product"
);
}
Fetch
(
MDStr
::
Mode
,
mds
,
"Acquisition_Mode"
);
if
((
m_Imd
[
MDStr
::
Mode
]
!=
"HIMAGE"
)
&&
(
m_Imd
[
MDStr
::
Mode
]
!=
"SPOTLIGHT"
)
&&
(
m_Imd
[
MDStr
::
Mode
]
!=
"ENHANCED SPOTLIGHT"
))
{
itkWarningMacro
(
<<
"Not an expected acquisition mode (only HIMAGE and SPOTLIGHT expected)"
<<
m_Imd
[
MDStr
::
Mode
]
);
}
Fetch
(
MDStr
::
ProductType
,
mds
,
"Product_Type"
);
if
(
(
m_Imd
[
MDStr
::
ProductType
]
!=
"SCS_B"
)
&&
m_Imd
[
MDStr
::
ProductType
]
!=
"SCS_U"
)
{
itkWarningMacro
(
<<
"Not an expected product type (only SCS_B and SCS_U expected) "
<<
m_Imd
[
MDStr
::
ProductType
]
);
}
// Check SubDatasets (For COSMO, we need //S01/SBI dataset)
auto
subDsName
=
"HDF5:"
+
mds
.
GetResourceFile
()
+
"://S01/SBI"
;
auto
ds
=
(
GDALDataset
*
)
GDALOpen
(
subDsName
.
c_str
(),
GA_ReadOnly
);
...
...
@@ -375,29 +398,6 @@ void CosmoImageMetadataInterface::Parse(const MetadataSupplierInterface & mds)
<<
"Cannot find S01/SBI subdataset"
)
}
// Metadata read by GDAL
Fetch
(
MDStr
::
Mission
,
mds
,
"MISSION_ID"
);
Fetch
(
MDStr
::
Mode
,
mds
,
"Acquisition_Mode"
);
Fetch
(
MDStr
::
ProductType
,
mds
,
"Product_Type"
);
// Check Mission Id, acquisition mode and product type
if
(
!
(
m_Imd
[
MDStr
::
Mission
]
==
"CSK"
))
{
itkWarningMacro
(
<<
"Not a valid missionId"
<<
m_Imd
[
MDStr
::
Mission
]
);
}
if
((
m_Imd
[
MDStr
::
Mode
]
!=
"HIMAGE"
)
&&
(
m_Imd
[
MDStr
::
Mode
]
!=
"SPOTLIGHT"
)
&&
(
m_Imd
[
MDStr
::
Mode
]
!=
"ENHANCED SPOTLIGHT"
))
{
itkWarningMacro
(
<<
"Not an expected acquisition mode (only HIMAGE and SPOTLIGHT expected)"
<<
m_Imd
[
MDStr
::
Mode
]
);
}
if
(
(
m_Imd
[
MDStr
::
ProductType
]
!=
"SCS_B"
)
&&
m_Imd
[
MDStr
::
ProductType
]
!=
"SCS_U"
)
{
itkWarningMacro
(
<<
"Not an expected product type (only SCS_B and SCS_U expected) "
<<
m_Imd
[
MDStr
::
ProductType
]
);
}
m_Imd
.
Add
(
MDStr
::
SensorID
,
"CSK"
);
Fetch
(
MDStr
::
Instrument
,
mds
,
"Satellite_ID"
);
...
...
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