Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Daniel Scheffler
geoarray
Commits
a5270c1f
Commit
a5270c1f
authored
Sep 20, 2017
by
Daniel Scheffler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed wring stretching of GeoArray.show() in case image contains np.nan.
parent
b1755e6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
geoarray/baseclasses.py
geoarray/baseclasses.py
+3
-2
No files found.
geoarray/baseclasses.py
View file @
a5270c1f
...
...
@@ -991,10 +991,11 @@ class GeoArray(object):
palette
=
cmap
if
cmap
else
plt
.
cm
.
gray
if
nodataVal
is
not
None
and
np
.
std
(
image2plot
)
!=
0
:
# do not show nodata
image2plot
=
np
.
ma
.
masked_equal
(
image2plot
,
nodataVal
)
vmin_auto
,
vmax_auto
=
np
.
percentile
(
image2plot
.
compressed
(),
2
),
np
.
percentile
(
image2plot
.
compressed
(),
98
)
vmin_auto
,
vmax_auto
=
\
np
.
nanpercentile
(
image2plot
.
compressed
(),
2
),
np
.
nanpercentile
(
image2plot
.
compressed
(),
98
)
palette
.
set_bad
(
'aqua'
,
0
)
else
:
vmin_auto
,
vmax_auto
=
np
.
percentile
(
image2plot
,
2
),
np
.
percentile
(
image2plot
,
98
)
vmin_auto
,
vmax_auto
=
np
.
nan
percentile
(
image2plot
,
2
),
np
.
percentile
(
image2plot
,
98
)
vmin
=
vmin
if
vmin
is
not
None
else
vmin_auto
vmax
=
vmax
if
vmax
is
not
None
else
vmax_auto
...
...
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