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
d5038b8c
Commit
d5038b8c
authored
Jul 01, 2021
by
benjaminpillot
Browse files
Fix nb_processes and chunksize to 1 (for masking, multiprocessing is useless)
parent
aba5632e
Changes
1
Hide whitespace changes
Inline
Side-by-side
pyrasta/base.py
View file @
d5038b8c
...
...
@@ -173,8 +173,7 @@ class RasterBase:
def
mask
(
self
,
mask
,
gdal_driver
=
gdal
.
GetDriverByName
(
"Gtiff"
),
data_type
=
gdal
.
GetDataTypeByName
(
'Float32'
),
all_touched
=
True
,
no_data
=-
999
,
window_size
=
100
,
nb_processes
=
mp
.
cpu_count
(),
chunksize
=
MP_CHUNK_SIZE
):
all_touched
=
True
,
no_data
=-
999
,
window_size
=
500
):
""" Apply mask to raster
Parameters
...
...
@@ -192,18 +191,13 @@ class RasterBase:
output no data value in masked raster
window_size: int or list[int, int]
Size of window for raster calculation
nb_processes: int
Number of processes for multiprocessing
chunksize: int
chunk size used in imap multiprocessing function
Returns
-------
"""
return
_raster_mask
(
self
,
mask
,
gdal_driver
,
data_type
,
no_data
,
all_touched
,
window_size
,
nb_processes
,
chunksize
)
no_data
,
all_touched
,
window_size
)
@
classmethod
def
merge
(
cls
,
rasters
,
bounds
=
None
,
output_format
=
"Gtiff"
,
...
...
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