Changeset 4021
- Timestamp:
- Jun 12, 2019 6:33:33 AM (5 years ago)
- Location:
- palm/trunk/SCRIPTS/palm_csd_files
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palm_csd_files/palm_csd_canopy_generator.py
r3944 r4021 20 20 # Current revisions: 21 21 # ----------------- 22 # 22 # Added support for tree shape 23 23 # 24 24 # Former revisions: … … 79 79 tree_id_counter = tree_id_counter + 1 80 80 # print(" Processing tree No " + str(tree_id_counter) + " ...", end="") 81 lad_loc, bad_loc, x_loc, y_loc, z_loc, status = process_single_tree(dx,dz,tree_type[j,i], tree_height[j,i],tree_lai[j,i],tree_dia[j,i],trunk_dia[j,i],season)81 lad_loc, bad_loc, x_loc, y_loc, z_loc, status = process_single_tree(dx,dz,tree_type[j,i],fill,tree_height[j,i],tree_lai[j,i],tree_dia[j,i],trunk_dia[j,i],season) 82 82 if ( np.any(lad_loc) != fill ): 83 83 … … 116 116 117 117 118 def process_single_tree(dx,dz,tree_type,tree_ height,tree_lai,tree_dia,trunk_dia,season):118 def process_single_tree(dx,dz,tree_type,tree_shape,tree_height,tree_lai,tree_dia,trunk_dia,season): 119 119 120 120 # Set some parameters … … 236 236 tree_type = int(tree_type) 237 237 238 if ( tree_shape == fillvalues["tree_data"] ): 239 tree_shape = default_trees[tree_type].shape 240 238 241 if ( tree_height == fillvalues["tree_data"] ): 239 242 tree_height = default_trees[tree_type].height … … 254 257 255 258 # Assign values that are not defined as user input from lookup table 256 tree_shape = default_trees[tree_type].shape257 259 tree_ratio = default_trees[tree_type].ratio 258 260 lad_max_height = default_trees[tree_type].lad_max_height … … 453 455 454 456 455 # Dreate BAD array and populate456 bad_loc = np.where(lad_loc != fillvalues["tree_data"], lad_loc*0.01,lad_loc)457 # Create BAD array and populate. TODO: revise as low LAD inside the foliage does not result in low BAD values. 458 bad_loc = np.where(lad_loc != fillvalues["tree_data"],(1.0 - lad_loc)*0.1,lad_loc) 457 459 458 460 -
palm/trunk/SCRIPTS/palm_csd_files/palm_csd_tools.py
r3944 r4021 20 20 # Current revisions: 21 21 # ----------------- 22 # 22 # Bugfix: missing conversion to integer 23 # 23 24 # 24 25 # Former revisions: 25 26 # ----------------- 26 27 # $Id: palm_csd_tools.py 3773 2019-03-01 08:56:57Z maronga $ 27 # Unspecifi ced changes28 # Unspecified changes 28 29 # 29 30 # 3726 2019-02-07 18:22:49Z maronga … … 125 126 for m in range(0,len(y)-1): 126 127 if array_2d[m,l] != fill: 127 k_min = max( int( array_2d[m,l] - width)/dz, 0 )128 k_min = max( int((array_2d[m,l] - width)/dz), 0 ) 128 129 k_max = int(round(array_2d[m,l]/dz)) 129 130 array_3d[k_min:k_max+1,m,l] = 1
Note: See TracChangeset
for help on using the changeset viewer.