- Timestamp:
- Nov 24, 2020 10:40:20 AM (4 years ago)
- Location:
- palm/trunk/SCRIPTS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palm_csd
r4793 r4794 25 25 # ----------------- 26 26 # $Id$ 27 # Removed debug output; assign negative ids for tree patches 28 # 29 # 4793 2020-11-24 09:48:21Z maronga 27 30 # Added output of tree_type (species or classification). Added tree_id for 28 31 # vegetation patches. Allow for overlapping vegetation with buildings … … 1105 1108 lai = nc_read_from_file_2d(input_file_lai[ii[i]], 'Band1', domain_x0[i], domain_x1[i], domain_y0[i], domain_y1[i]) 1106 1109 1107 nc_write_to_file_2d(filename[i], 'patch_height', patch_height, datatypes["tree_data"],'y','x',fillvalues["tree_data"])1108 nc_write_attribute(filename[i], 'patch_height', 'long_name', 'tree type')1109 nc_write_attribute(filename[i], 'patch_height', 'units', '')1110 nc_write_attribute(filename[i], 'patch_height', 'res_orig', domain_px[i])1111 nc_write_attribute(filename[i], 'patch_height', 'coordinates', 'E_UTM N_UTM lon lat')1112 nc_write_attribute(filename[i], 'patch_height', 'grid_mapping', 'E_UTM N_UTM lon lat')1113 1110 1114 1111 # Determine all pixels that do not already have an LAD but which are high vegetation to a dummy value of 1.0 and remove all other pixels … … 1153 1150 lad_patch, patch_id, patch_types, patch_nz, status = process_patch(domain_dz[i],patch_height,vegetation_type,max(zlad),lai_high,settings_lai_alpha,settings_lai_beta) 1154 1151 1155 # Increase the patch ids by the maximum id for street trees to avoid double ids 1156 max_id = max(tree_id.flatten()) 1157 patch_id = np.where( patch_id != fillvalues["tree_id"], patch_id+max_id, patch_id) 1152 # Set negative ids for patches 1153 patch_id = np.where( patch_id != fillvalues["tree_id"], -patch_id, patch_id) 1158 1154 1159 1155 # 2D loop in order to avoid memory problems with large arrays -
palm/trunk/SCRIPTS/palm_csd_files/palm_csd_canopy_generator.py
r4793 r4794 25 25 # ----------------- 26 26 # $Id: palm_csd_canopy_generator.py 3773 2019-03-01 08:56:57Z maronga $ 27 # tree_type for patches is now considered by negative values accrordng to the 28 # vegetation_type classification 29 # 30 # 3773 2019-03-01 08:56:57Z maronga 27 31 # Bugfix: do not allow BAD < 0, revised treatment of tree trunks 28 32 # … … 550 554 vegetation_type_int = vegetation_type.astype(int) 551 555 patch_id[k,:,:] = np.where((patch_id_2d != 0) & (lad_loc[k,:,:] != fillvalues["tree_data"]), patch_id_2d, fillvalues["tree_id"]) 552 patch_type[k,:,:] = np.where((patch_id_2d != 0) & (lad_loc[k,:,:] != fillvalues["tree_data"]), np.byte( 100+vegetation_type), fillvalues["tree_type"])556 patch_type[k,:,:] = np.where((patch_id_2d != 0) & (lad_loc[k,:,:] != fillvalues["tree_data"]), np.byte(-vegetation_type), fillvalues["tree_type"]) 553 557 554 558 return lad_loc, patch_id, patch_type, nz, 0
Note: See TracChangeset
for help on using the changeset viewer.