Skip to content

Commit adde1e0

Browse files
committed
Added svf combined layer to e4MSTP in blend.py
1 parent 81b705e commit adde1e0

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

rvt/blend.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,11 +1408,31 @@ def e4mstp(dem, resolution, default: rvt.default.DefaultValues = rvt.default.Def
14081408
svf_arr = svf_temp["svf"].squeeze()
14091409
neg_opns_arr = default.get_neg_opns(dem, resolution).squeeze()
14101410

1411+
# For SVF 2 (FLAT)
1412+
default_2 = rvt.default.DefaultValues()
1413+
default_2.svf_r_max = 20
1414+
default_2.svf_noise = 3
1415+
svf_flat = default.get_sky_view_factor(dem, resolution, compute_svf=True, compute_opns=False)["svf"].squeeze()
1416+
14111417
# 1) MSTP
14121418
mstp_arr = default.get_mstp(dem_arr=dem) # todo: check values in tiled
14131419

14141420
# 2) Comb svf
1415-
comb_svf_arr = None # todo: Write function
1421+
comb_svf = rvt.blend.BlenderCombination()
1422+
comb_svf.create_layer(vis_method="Sky-view factor", normalization="Value",
1423+
minimum=0.7, maximum=1,
1424+
blend_mode="normal", opacity=50,
1425+
image=svf_arr
1426+
)
1427+
comb_svf.create_layer(vis_method="Sky-view factor", normalization="Value",
1428+
minimum=0.9, maximum=1,
1429+
blend_mode="normal", opacity=100,
1430+
image=svf_flat
1431+
)
1432+
cs_svf = comb_svf.render_all_images(save_visualizations=False,
1433+
save_render_path=None,
1434+
no_data=np.nan)
1435+
comb_svf_arr = cs_svf.astype("float32")
14161436

14171437
# 3) Comb openness LD
14181438
comb_ol = rvt.blend.BlenderCombination()

0 commit comments

Comments
 (0)