Ignore:
Timestamp:
Jun 12, 2019 6:33:33 AM (2 years ago)
Author:
maronga
Message:

minor changes in palm_csd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/palm_csd_files/palm_csd_canopy_generator.py

    r3944 r4021  
    2020# Current revisions:
    2121# -----------------
    22 #
     22# Added support for tree shape
    2323#
    2424# Former revisions:
     
    7979               tree_id_counter = tree_id_counter + 1
    8080#               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)
    8282               if ( np.any(lad_loc) != fill ):
    8383 
     
    116116
    117117
    118 def process_single_tree(dx,dz,tree_type,tree_height,tree_lai,tree_dia,trunk_dia,season):
     118def process_single_tree(dx,dz,tree_type,tree_shape,tree_height,tree_lai,tree_dia,trunk_dia,season):
    119119
    120120#  Set some parameters
     
    236236      tree_type = int(tree_type)
    237237
     238   if ( tree_shape == fillvalues["tree_data"] ):
     239      tree_shape = default_trees[tree_type].shape
     240
    238241   if ( tree_height == fillvalues["tree_data"] ):
    239242      tree_height = default_trees[tree_type].height
     
    254257 
    255258#  Assign values that are not defined as user input from lookup table
    256    tree_shape          = default_trees[tree_type].shape
    257259   tree_ratio          = default_trees[tree_type].ratio
    258260   lad_max_height      = default_trees[tree_type].lad_max_height
     
    453455
    454456
    455 Dreate BAD array and populate
    456    bad_loc = np.where(lad_loc != fillvalues["tree_data"],lad_loc*0.01,lad_loc)
     457Create 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)
    457459   
    458460
Note: See TracChangeset for help on using the changeset viewer.