Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ESPACE-DEV
pyrasta
Commits
7b819327
Commit
7b819327
authored
Jun 30, 2021
by
benjaminpillot
Browse files
Fix raster calculation for resulting raster whose dimension if > 2 (3D raster)
parent
d8341759
Changes
1
Hide whitespace changes
Inline
Side-by-side
pyrasta/tools/calculator.py
View file @
7b819327
...
...
@@ -82,10 +82,11 @@ def _raster_calculation(raster_class, sources, fhandle, window_size,
desc
=
"Calculate raster expression"
):
with
mp
.
Pool
(
processes
=
nb_processes
)
as
pool
:
result
=
np
.
concatenate
(
list
(
pool
.
map
(
fhandle
,
win_gen
,
chunksize
=
chunksize
)),
axis
=
1
)
list_of_arrays
=
list
(
pool
.
map
(
fhandle
,
win_gen
,
chunksize
=
chunksize
))
result
=
np
.
concatenate
(
list_of_arrays
,
axis
=
list_of_arrays
[
0
].
ndim
-
1
)
if
is_first_run
:
if
result
.
ndim
==
2
:
...
...
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