Skip to content

Commit

Permalink
linting, rm Doku_hints
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrunn committed Oct 23, 2024
1 parent 892941d commit fdeb7bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 29 deletions.
23 changes: 0 additions & 23 deletions Doku_hints.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ def cleanup():
grass.run_command("g.remove", type="raster", name=rmrast, **kwargs)
grass.del_temp_region()


def numsamplecheck(number_samples, rastername):
raster_samples = int(grass.parse_command("r.univar", map=rastername, flags="g")["n"])
if number_samples > raster_samples:
Expand All @@ -176,6 +177,7 @@ def numsamplecheck(number_samples, rastername):
number_samples = raster_samples
return number_samples


def main():
global rm_rasters, tmp_mask_old

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#
# MODULE: r.trees.traindata
#
# AUTHOR(S): Markus Metz, Lina Krisztian, Guido Riembauer,
# AUTHOR(S): Markus Metz, Lina Krisztian, Guido Riembauer,
# Victoria-Leandra Brunn
#
# PURPOSE: Creates a preliminary tree map for random forest classification
# PURPOSE: Creates a preliminary tree map for random forest classification
# and/or post processing.
#
# COPYRIGHT: (C) 2023 - 2024 by mundialis and the GRASS Development Team
Expand Down Expand Up @@ -317,13 +317,12 @@ def main():
if options["trees_pixel_ndvi"]:
trees_pixel_ndvi = options["trees_pixel_ndvi"]
else:
trees_pixel_ndvi = "trees_pixel_ndvi"
rm_rasters.append(trees_pixel_ndvi)
trees_pixel_ndvi = "trees_pixel_ndvi"
rm_rasters.append(trees_pixel_ndvi)

grass.mapcalc(
f"{trees_pixel_ndvi} = if({ndvi_split}_max2 < {ndvi_threshold}, null(), {nearest})"
)


# cut to nir: all pixels below 100 are not vegetation
# removes shadows with high ndvi e.g. on roofs
Expand Down Expand Up @@ -503,7 +502,7 @@ def main():
grass.mapcalc(f"{options['traindata_r']} = if(isnull(trees_object_filt_large), null(), 2)")
if not options["traindata_v"]:
rm_vectors.append("trees_object_filt_large")

if options["traindata_v"]:
grass.run_command(
"g.rename",
Expand Down

0 comments on commit fdeb7bd

Please sign in to comment.