Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Cabieces
otb
Commits
e8c6e7de
Commit
e8c6e7de
authored
4 years ago
by
Cédric Traizet
Browse files
Options
Downloads
Patches
Plain Diff
BUG: verify that the sensor is CosmoSkyMed before opening hdf5 datasets
parent
0777d9f3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Modules/Core/Metadata/src/otbCosmoImageMetadataInterface.cxx
+23
-23
23 additions, 23 deletions
Modules/Core/Metadata/src/otbCosmoImageMetadataInterface.cxx
with
23 additions
and
23 deletions
Modules/Core/Metadata/src/otbCosmoImageMetadataInterface.cxx
+
23
−
23
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"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment