Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel Scheffler
py_tools_ds
Commits
7503cec9
Commit
7503cec9
authored
Dec 13, 2018
by
Daniel Scheffler
Browse files
Improved output validation.
parent
ef22570c
Pipeline
#3388
passed with stages
in 9 minutes and 50 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
py_tools_ds/geo/raster/reproject.py
View file @
7503cec9
...
...
@@ -715,7 +715,15 @@ class SensorMapGeometryTransformer(object):
area_extent
=
out_extent
,
)
# type: AreaDefinition
return
self
.
_resample
(
self
.
swath_definition
,
self
.
area_definition
),
out_gt
,
out_prj
data_mapgeo
=
self
.
_resample
(
self
.
swath_definition
,
self
.
area_definition
)
# output validation
if
not
data_mapgeo
.
shape
==
(
rows_out
,
cols_out
):
raise
RuntimeError
(
'The computed map geometry output does not have the expected shape. '
'Expected: %s; output array shape: %s.'
%
(
rows_out
,
cols_out
),
data_mapgeo
.
shape
)
return
data_mapgeo
,
out_gt
,
out_prj
def
to_sensor_geometry
(
self
,
src_prj
,
src_extent
):
# type: (Union[str, int], List[float, float, float, float]) -> np.ndarray
...
...
@@ -729,4 +737,12 @@ class SensorMapGeometryTransformer(object):
self
.
area_definition
=
AreaDefinition
(
''
,
''
,
''
,
proj4_args
,
self
.
data
.
shape
[
1
],
self
.
data
.
shape
[
0
],
src_extent
)
return
self
.
_resample
(
self
.
area_definition
,
self
.
swath_definition
)
data_sensorgeo
=
self
.
_resample
(
self
.
area_definition
,
self
.
swath_definition
)
# output validation
if
not
data_sensorgeo
.
shape
==
self
.
lats
.
shape
:
raise
RuntimeError
(
'The computed sensor geometry output does not have the same size like the coordinates '
'array. Coordinates array: %s; output array: %s.'
%
(
self
.
lats
.
shape
,
data_sensorgeo
.
shape
))
return
data_sensorgeo
py_tools_ds/version.py
View file @
7503cec9
__version__
=
'0.14.2'
__versionalias__
=
'20181213_0
2
'
__versionalias__
=
'20181213_0
3
'
Write
Preview
Supports
Markdown
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