Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion python/grass/temporal/aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,17 @@ def collect_map_names(sp, dbif, start, end, sampling):


def aggregate_raster_maps(
inputs, base, start, end, count: int, method, register_null, dbif, offset: int = 0
inputs,
base,
start,
end,
count: int,
method,
register_null,
dbif,
offset: int = 0,
*,
nprocs: int = 0,
):
"""Aggregate a list of raster input maps with r.series

Expand All @@ -130,6 +140,7 @@ def aggregate_raster_maps(
time raster dataset, if false not
:param dbif: The temporal database interface to use
:param offset: Offset to be added to the map counter to create the map ids
:param nprocs: Number of cores to use for processing (0 means use all available cores)
"""

msgr = get_tgis_message_interface()
Expand Down Expand Up @@ -174,6 +185,7 @@ def aggregate_raster_maps(
if len(inputs) > 1000:
gs.run_command(
"r.series",
nprocs=nprocs,
flags="z",
file=filename,
output=output,
Expand All @@ -183,6 +195,7 @@ def aggregate_raster_maps(
else:
gs.run_command(
"r.series",
nprocs=nprocs,
file=filename,
output=output,
overwrite=gs.overwrite(),
Expand Down Expand Up @@ -271,6 +284,7 @@ def aggregate_by_topology(
r_series = pymod.Module(
"r.series",
output="spam",
nprocs=1,
method=[method],
overwrite=overwrite,
quiet=True,
Expand Down
3 changes: 3 additions & 0 deletions python/grass/temporal/univar_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ def compute_univar_stats(
if stats_module.name == "r3.univar" or not registered_map_info["semantic_label"]
else registered_map_info["semantic_label"]
)
# Only r.univar, not r3.univar has nprocs parameter
if stats_module.name == "r.univar":
stats_module.inputs.nprocs = 1

stats_module.inputs.map = id
if rast_region and (stats_module.inputs.zones or stats_module.name == "r3.univar"):
Expand Down
Loading