Changeset 4021


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

minor changes in palm_csd

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  
    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
  • palm/trunk/SCRIPTS/palm_csd_files/palm_csd_tools.py

    r3944 r4021  
    2020# Current revisions:
    2121# -----------------
    22 #
     22# Bugfix: missing conversion to integer
     23#
    2324#
    2425# Former revisions:
    2526# -----------------
    2627# $Id: palm_csd_tools.py 3773 2019-03-01 08:56:57Z maronga $
    27 # Unspecificed changes
     28# Unspecified changes
    2829#
    2930# 3726 2019-02-07 18:22:49Z maronga
     
    125126         for m in range(0,len(y)-1):
    126127            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 )
    128129               k_max = int(round(array_2d[m,l]/dz))
    129130               array_3d[k_min:k_max+1,m,l] = 1
Note: See TracChangeset for help on using the changeset viewer.