Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve naming #3

Merged
merged 1 commit into from
Dec 9, 2023
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
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
module to process CSMap, based on https://www.rinya.maff.go.jp/j/seibi/sagyoudo/attach/pdf/romou-12.pdf

```
usage: __main__.py [-h] [--chunk_size CHUNK_SIZE] [--gf_size GF_SIZE] [--gf_sigma GF_SIGMA]
[--cvt_size CVT_SIZE] [--height_scale HEIGHT_SCALE HEIGHT_SCALE]
usage: __main__.py [-h] [--chunk_size CHUNK_SIZE] [--max_workers MAX_WORKERS] [--gf_size GF_SIZE]
[--gf_sigma GF_SIGMA] [--curvature_size CURVATURE_SIZE]
[--height_scale HEIGHT_SCALE HEIGHT_SCALE]
[--slope_scale SLOPE_SCALE SLOPE_SCALE]
[--curvature_scale CURVATURE_SCALE CURVATURE_SCALE]
input_dem_path output_path
Expand All @@ -16,9 +17,10 @@ positional arguments:
options:
-h, --help show this help message and exit
--chunk_size CHUNK_SIZE
--max_workers MAX_WORKERS
--gf_size GF_SIZE
--gf_sigma GF_SIGMA
--cvt_size CVT_SIZE
--curvature_size CURVATURE_SIZE
--height_scale HEIGHT_SCALE HEIGHT_SCALE
--slope_scale SLOPE_SCALE SLOPE_SCALE
--curvature_scale CURVATURE_SCALE CURVATURE_SCALE
Expand Down
4 changes: 2 additions & 2 deletions csmap/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def parse_args():
parser.add_argument("--max_workers", type=int, default=1)
parser.add_argument("--gf_size", type=int, default=12)
parser.add_argument("--gf_sigma", type=int, default=3)
parser.add_argument("--cvt_size", type=int, default=1)
parser.add_argument("--curvature_size", type=int, default=1)
parser.add_argument("--height_scale", type=float, nargs=2, default=[0.0, 1000.0])
parser.add_argument("--slope_scale", type=float, nargs=2, default=[0.0, 1.5])
parser.add_argument("--curvature_scale", type=float, nargs=2, default=[-0.1, 0.1])
Expand All @@ -21,7 +21,7 @@ def parse_args():
params = CsmapParams(
gf_size=args.gf_size,
gf_sigma=args.gf_sigma,
cvt_size=args.cvt_size,
curvature_size=args.curvature_size,
height_scale=args.height_scale,
slope_scale=args.slope_scale,
curvature_scale=args.curvature_scale,
Expand Down
4 changes: 2 additions & 2 deletions csmap/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class CsmapParams:
gf_size: int
gf_sigma: int
cvt_size: int
curvature_size: int
height_scale: (float, float)
slope_scale: (float, float)
curvature_scale: (float, float)
Expand All @@ -26,7 +26,7 @@ def csmap(dem: np.ndarray, params: CsmapParams) -> np.ndarray:
# calclucate elements
slope = calc.slope(dem)
g = calc.gaussianfilter(dem, params.gf_size, params.gf_sigma)
curvature = calc.curvature(g, params.cvt_size)
curvature = calc.curvature(g, params.curvature_size)

# rgbify
dem_rgb = color.rgbify(dem, color.height_blackwhite, scale=params.height_scale)
Expand Down