- Timestamp:
- Jan 14, 2019 12:49:24 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palm_csd_files/palm_csd_canopy_generator.py
r3629 r3668 25 25 # ----------------- 26 26 # $Id$ 27 # Various improvements and bugfixes 28 # 29 # 3629 2018-12-13 12:18:54Z maronga 27 30 # Initial revision 28 31 # … … 72 75 if valid_pixels[j,i]: 73 76 tree_id_counter = tree_id_counter + 1 74 print(" Processing tree No " + str(tree_id_counter) + " ...", end="") 75 77 # print(" Processing tree No " + str(tree_id_counter) + " ...", end="") 76 78 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) 77 79 if ( np.any(lad_loc) != fill ): … … 101 103 102 104 103 if ( status == 0 ):104 status_char = " ok."105 else:106 status_char = " skipped."107 print(status_char)105 # if ( status == 0 ): 106 # status_char = " ok." 107 # else: 108 # status_char = " skipped." 109 # print(status_char) 108 110 109 111 del lad_loc, x_loc, y_loc, z_loc, status … … 131 133 default_trees = [] 132 134 #1 #2 #3 #4 #5 #6 #7 #8 #9 133 default_trees.append(tree("Default", 1.0, 1.0, 4.0, 12.0, 2.0, 0.1, 0.6, 0.025, 0.35))134 default_trees.append(tree("Abies", 3.0, 1.0, 4.0, 12.0, 2.0, 0.1, 0.6, 0.025, 0.80))135 default_trees.append(tree("Acer", 1.0, 1.0, 7.0, 12.0, 2.0, 0.1, 0.6, 0.025, 0.80))136 default_trees.append(tree("Aesculus", 1.0, 1.0, 7.0, 12.0, 2.0, 0.1, 0.6, 0.025, 1.00))137 default_trees.append(tree("Ailanthus", 1.0, 1.0, 8.5, 13.5, 2.0, 0.1, 0.6, 0.025, 1.30))138 default_trees.append(tree("Alnus", 3.0, 1.0, 6.0, 16.0, 2.0, 0.1, 0.6, 0.025, 1.20))139 default_trees.append(tree("Amelanchier", 1.0, 1.0, 3.0, 4.0, 2.0, 0.1, 0.6, 0.025, 1.20))140 default_trees.append(tree("Betula", 1.0, 1.0, 6.0, 14.0, 2.0, 0.1, 0.6, 0.025, 0.30))141 default_trees.append(tree("Buxus", 1.0, 1.0, 4.0, 4.0, 2.0, 0.1, 0.6, 0.025, 0.90))142 default_trees.append(tree("Calocedrus", 3.0, 1.0, 5.0, 10.0, 2.0, 0.1, 0.6, 0.025, 0.50))143 default_trees.append(tree("Caragana", 1.0, 1.0, 3.5, 6.0, 2.0, 0.1, 0.6, 0.025, 0.90))144 default_trees.append(tree("Carpinus", 1.0, 1.0, 6.0, 10.0, 2.0, 0.1, 0.6, 0.025, 0.70))145 default_trees.append(tree("Carya", 1.0, 1.0, 5.0, 17.0, 2.0, 0.1, 0.6, 0.025, 0.80))146 default_trees.append(tree("Castanea", 1.0, 1.0, 4.5, 7.0, 2.0, 0.1, 0.6, 0.025, 0.80))147 default_trees.append(tree("Catalpa", 1.0, 1.0, 5.5, 6.5, 2.0, 0.1, 0.6, 0.025, 0.70))148 default_trees.append(tree("Cedrus", 1.0, 1.0, 8.0, 13.0, 2.0, 0.1, 0.6, 0.025, 0.80))149 default_trees.append(tree("Celtis", 1.0, 1.0, 6.0, 9.0, 2.0, 0.1, 0.6, 0.025, 0.80))150 default_trees.append(tree("Cercidiphyllum", 1.0, 1.0, 3.0, 6.5, 2.0, 0.1, 0.6, 0.025, 0.80))151 default_trees.append(tree("Cercis", 1.0, 1.0, 2.5, 7.5, 2.0, 0.1, 0.6, 0.025, 0.90))152 default_trees.append(tree("Chamaecyparis", 5.0, 1.0, 3.5, 9.0, 2.0, 0.1, 0.6, 0.025, 0.70))153 default_trees.append(tree("Cladrastis", 1.0, 1.0, 5.0, 10.0, 2.0, 0.1, 0.6, 0.025, 0.80))154 default_trees.append(tree("Cornus", 1.0, 1.0, 4.5, 6.5, 2.0, 0.1, 0.6, 0.025, 1.20))155 default_trees.append(tree("Corylus", 1.0, 1.0, 5.0, 9.0, 2.0, 0.1, 0.6, 0.025, 0.40))156 default_trees.append(tree("Cotinus", 1.0, 1.0, 4.0, 4.0, 2.0, 0.1, 0.6, 0.025, 0.70))157 default_trees.append(tree("Crataegus", 3.0, 1.0, 3.5, 6.0, 2.0, 0.1, 0.6, 0.025, 1.40))158 default_trees.append(tree("Cryptomeria", 3.0, 1.0, 5.0, 10.0, 2.0, 0.1, 0.6, 0.025, 0.50))159 default_trees.append(tree("Cupressocyparis", 3.0, 1.0, 3.0, 8.0, 2.0, 0.1, 0.6, 0.025, 0.40))160 default_trees.append(tree("Cupressus", 3.0, 1.0, 5.0, 7.0, 2.0, 0.1, 0.6, 0.025, 0.40))161 default_trees.append(tree("Cydonia", 1.0, 1.0, 2.0, 3.0, 2.0, 0.1, 0.6, 0.025, 0.90))162 default_trees.append(tree("Davidia", 1.0, 1.0,10.0, 14.0, 2.0, 0.1, 0.6, 0.025, 0.40))163 default_trees.append(tree("Elaeagnus", 1.0, 1.0, 6.5, 6.0, 2.0, 0.1, 0.6, 0.025, 1.20))164 default_trees.append(tree("Euodia", 1.0, 1.0, 4.5, 6.0, 2.0, 0.1, 0.6, 0.025, 0.90))165 default_trees.append(tree("Euonymus", 1.0, 1.0, 4.5, 6.0, 2.0, 0.1, 0.6, 0.025, 0.60))166 default_trees.append(tree("Fagus", 1.0, 1.0,10.0, 12.5, 2.0, 0.1, 0.6, 0.025, 0.50))167 default_trees.append(tree("Fraxinus", 1.0, 1.0, 5.5, 10.5, 2.0, 0.1, 0.6, 0.025, 1.60))168 default_trees.append(tree("Ginkgo", 3.0, 1.0, 4.0, 8.5, 2.0, 0.1, 0.6, 0.025, 0.80))169 default_trees.append(tree("Gleditsia", 1.0, 1.0, 6.5, 10.5, 2.0, 0.1, 0.6, 0.025, 0.60))170 default_trees.append(tree("Gymnocladus", 1.0, 1.0, 5.5, 10.0, 2.0, 0.1, 0.6, 0.025, 0.80))171 default_trees.append(tree("Hippophae", 1.0, 1.0, 9.5, 8.5, 2.0, 0.1, 0.6, 0.025, 0.80))172 default_trees.append(tree("Ilex", 1.0, 1.0, 4.0, 7.5, 2.0, 0.1, 0.6, 0.025, 0.80))173 default_trees.append(tree("Juglans", 1.0, 1.0, 7.0, 9.0, 2.0, 0.1, 0.6, 0.025, 0.50))174 default_trees.append(tree("Juniperus", 5.0, 1.0, 3.0, 7.0, 2.0, 0.1, 0.6, 0.025, 0.90))175 default_trees.append(tree("Koelreuteria", 1.0, 1.0, 3.5, 5.5, 2.0, 0.1, 0.6, 0.025, 0.50))176 default_trees.append(tree("Laburnum", 1.0, 1.0, 3.0, 6.0, 2.0, 0.1, 0.6, 0.025, 0.60))177 default_trees.append(tree("Larix", 3.0, 1.0, 7.0, 16.5, 2.0, 0.1, 0.6, 0.025, 0.60))178 default_trees.append(tree("Ligustrum", 1.0, 1.0, 3.0, 6.0, 2.0, 0.1, 0.6, 0.025, 1.10))179 default_trees.append(tree("Liquidambar", 3.0, 1.0, 3.0, 7.0, 2.0, 0.1, 0.6, 0.025, 0.30))180 default_trees.append(tree("Liriodendron", 3.0, 1.0, 4.5, 9.5, 2.0, 0.1, 0.6, 0.025, 0.50))181 default_trees.append(tree("Lonicera", 1.0, 1.0, 7.0, 9.0, 2.0, 0.1, 0.6, 0.025, 0.70))182 default_trees.append(tree("Magnolia", 1.0, 1.0, 3.0, 5.0, 2.0, 0.1, 0.6, 0.025, 0.60))183 default_trees.append(tree("Malus", 1.0, 1.0, 4.5, 5.0, 2.0, 0.1, 0.6, 0.025, 0.30))184 default_trees.append(tree("Metasequoia", 5.0, 1.0, 4.5, 12.0, 2.0, 0.1, 0.6, 0.025, 0.50))185 default_trees.append(tree("Morus", 1.0, 1.0, 7.5, 11.5, 2.0, 0.1, 0.6, 0.025, 1.00))186 default_trees.append(tree("Ostrya", 1.0, 1.0, 2.0, 6.0, 2.0, 0.1, 0.6, 0.025, 1.00))187 default_trees.append(tree("Parrotia", 1.0, 1.0, 7.0, 7.0, 2.0, 0.1, 0.6, 0.025, 0.30))188 default_trees.append(tree("Paulownia", 1.0, 1.0, 4.0, 8.0, 2.0, 0.1, 0.6, 0.025, 0.40))189 default_trees.append(tree("Phellodendron", 1.0, 1.0,13.5, 13.5, 2.0, 0.1, 0.6, 0.025, 0.50))190 default_trees.append(tree("Picea", 3.0, 1.0, 3.0, 13.0, 2.0, 0.1, 0.6, 0.025, 0.90))191 default_trees.append(tree("Pinus", 3.0, 1.0, 6.0, 16.0, 2.0, 0.1, 0.6, 0.025, 0.80))192 default_trees.append(tree("Platanus", 1.0, 1.0,10.0, 14.5, 2.0, 0.1, 0.6, 0.025, 1.10))193 default_trees.append(tree("Populus", 1.0, 1.0, 9.0, 20.0, 2.0, 0.1, 0.6, 0.025, 1.40))194 default_trees.append(tree("Prunus", 1.0, 1.0, 5.0, 7.0, 2.0, 0.1, 0.6, 0.025, 1.60))195 default_trees.append(tree("Pseudotsuga", 3.0, 1.0, 6.0, 17.5, 2.0, 0.1, 0.6, 0.025, 0.70))196 default_trees.append(tree("Ptelea", 1.0, 1.0, 5.0, 4.0, 2.0, 0.1, 0.6, 0.025, 1.10))197 default_trees.append(tree("Pterocaria", 1.0, 1.0,10.0, 12.0, 2.0, 0.1, 0.6, 0.025, 0.50))198 default_trees.append(tree("Pterocarya", 1.0, 1.0,11.5, 14.5, 2.0, 0.1, 0.6, 0.025, 1.60))199 default_trees.append(tree("Pyrus", 3.0, 1.0, 3.0, 6.0, 2.0, 0.1, 0.6, 0.025, 1.80))135 default_trees.append(tree("Default", 1.0, 1.0, 4.0, 12.0, 3.0, 0.8, 0.6, 0.025, 0.35)) 136 default_trees.append(tree("Abies", 3.0, 1.0, 4.0, 12.0, 3.0, 0.8, 0.6, 0.025, 0.80)) 137 default_trees.append(tree("Acer", 1.0, 1.0, 7.0, 12.0, 3.0, 0.8, 0.6, 0.025, 0.80)) 138 default_trees.append(tree("Aesculus", 1.0, 1.0, 7.0, 12.0, 3.0, 0.8, 0.6, 0.025, 1.00)) 139 default_trees.append(tree("Ailanthus", 1.0, 1.0, 8.5, 13.5, 3.0, 0.8, 0.6, 0.025, 1.30)) 140 default_trees.append(tree("Alnus", 3.0, 1.0, 6.0, 16.0, 3.0, 0.8, 0.6, 0.025, 1.20)) 141 default_trees.append(tree("Amelanchier", 1.0, 1.0, 3.0, 4.0, 3.0, 0.8, 0.6, 0.025, 1.20)) 142 default_trees.append(tree("Betula", 1.0, 1.0, 6.0, 14.0, 3.0, 0.8, 0.6, 0.025, 0.30)) 143 default_trees.append(tree("Buxus", 1.0, 1.0, 4.0, 4.0, 3.0, 0.8, 0.6, 0.025, 0.90)) 144 default_trees.append(tree("Calocedrus", 3.0, 1.0, 5.0, 10.0, 3.0, 0.8, 0.6, 0.025, 0.50)) 145 default_trees.append(tree("Caragana", 1.0, 1.0, 3.5, 6.0, 3.0, 0.8, 0.6, 0.025, 0.90)) 146 default_trees.append(tree("Carpinus", 1.0, 1.0, 6.0, 10.0, 3.0, 0.8, 0.6, 0.025, 0.70)) 147 default_trees.append(tree("Carya", 1.0, 1.0, 5.0, 17.0, 3.0, 0.8, 0.6, 0.025, 0.80)) 148 default_trees.append(tree("Castanea", 1.0, 1.0, 4.5, 7.0, 3.0, 0.8, 0.6, 0.025, 0.80)) 149 default_trees.append(tree("Catalpa", 1.0, 1.0, 5.5, 6.5, 3.0, 0.8, 0.6, 0.025, 0.70)) 150 default_trees.append(tree("Cedrus", 1.0, 1.0, 8.0, 13.0, 3.0, 0.8, 0.6, 0.025, 0.80)) 151 default_trees.append(tree("Celtis", 1.0, 1.0, 6.0, 9.0, 3.0, 0.8, 0.6, 0.025, 0.80)) 152 default_trees.append(tree("Cercidiphyllum", 1.0, 1.0, 3.0, 6.5, 3.0, 0.8, 0.6, 0.025, 0.80)) 153 default_trees.append(tree("Cercis", 1.0, 1.0, 2.5, 7.5, 3.0, 0.8, 0.6, 0.025, 0.90)) 154 default_trees.append(tree("Chamaecyparis", 5.0, 1.0, 3.5, 9.0, 3.0, 0.8, 0.6, 0.025, 0.70)) 155 default_trees.append(tree("Cladrastis", 1.0, 1.0, 5.0, 10.0, 3.0, 0.8, 0.6, 0.025, 0.80)) 156 default_trees.append(tree("Cornus", 1.0, 1.0, 4.5, 6.5, 3.0, 0.8, 0.6, 0.025, 1.20)) 157 default_trees.append(tree("Corylus", 1.0, 1.0, 5.0, 9.0, 3.0, 0.8, 0.6, 0.025, 0.40)) 158 default_trees.append(tree("Cotinus", 1.0, 1.0, 4.0, 4.0, 3.0, 0.8, 0.6, 0.025, 0.70)) 159 default_trees.append(tree("Crataegus", 3.0, 1.0, 3.5, 6.0, 3.0, 0.8, 0.6, 0.025, 1.40)) 160 default_trees.append(tree("Cryptomeria", 3.0, 1.0, 5.0, 10.0, 3.0, 0.8, 0.6, 0.025, 0.50)) 161 default_trees.append(tree("Cupressocyparis", 3.0, 1.0, 3.0, 8.0, 3.0, 0.8, 0.6, 0.025, 0.40)) 162 default_trees.append(tree("Cupressus", 3.0, 1.0, 5.0, 7.0, 3.0, 0.8, 0.6, 0.025, 0.40)) 163 default_trees.append(tree("Cydonia", 1.0, 1.0, 2.0, 3.0, 3.0, 0.8, 0.6, 0.025, 0.90)) 164 default_trees.append(tree("Davidia", 1.0, 1.0,10.0, 14.0, 3.0, 0.8, 0.6, 0.025, 0.40)) 165 default_trees.append(tree("Elaeagnus", 1.0, 1.0, 6.5, 6.0, 3.0, 0.8, 0.6, 0.025, 1.20)) 166 default_trees.append(tree("Euodia", 1.0, 1.0, 4.5, 6.0, 3.0, 0.8, 0.6, 0.025, 0.90)) 167 default_trees.append(tree("Euonymus", 1.0, 1.0, 4.5, 6.0, 3.0, 0.8, 0.6, 0.025, 0.60)) 168 default_trees.append(tree("Fagus", 1.0, 1.0,10.0, 12.5, 3.0, 0.8, 0.6, 0.025, 0.50)) 169 default_trees.append(tree("Fraxinus", 1.0, 1.0, 5.5, 10.5, 3.0, 0.8, 0.6, 0.025, 1.60)) 170 default_trees.append(tree("Ginkgo", 3.0, 1.0, 4.0, 8.5, 3.0, 0.8, 0.6, 0.025, 0.80)) 171 default_trees.append(tree("Gleditsia", 1.0, 1.0, 6.5, 10.5, 3.0, 0.8, 0.6, 0.025, 0.60)) 172 default_trees.append(tree("Gymnocladus", 1.0, 1.0, 5.5, 10.0, 3.0, 0.8, 0.6, 0.025, 0.80)) 173 default_trees.append(tree("Hippophae", 1.0, 1.0, 9.5, 8.5, 3.0, 0.8, 0.6, 0.025, 0.80)) 174 default_trees.append(tree("Ilex", 1.0, 1.0, 4.0, 7.5, 3.0, 0.8, 0.6, 0.025, 0.80)) 175 default_trees.append(tree("Juglans", 1.0, 1.0, 7.0, 9.0, 3.0, 0.8, 0.6, 0.025, 0.50)) 176 default_trees.append(tree("Juniperus", 5.0, 1.0, 3.0, 7.0, 3.0, 0.8, 0.6, 0.025, 0.90)) 177 default_trees.append(tree("Koelreuteria", 1.0, 1.0, 3.5, 5.5, 3.0, 0.8, 0.6, 0.025, 0.50)) 178 default_trees.append(tree("Laburnum", 1.0, 1.0, 3.0, 6.0, 3.0, 0.8, 0.6, 0.025, 0.60)) 179 default_trees.append(tree("Larix", 3.0, 1.0, 7.0, 16.5, 3.0, 0.8, 0.6, 0.025, 0.60)) 180 default_trees.append(tree("Ligustrum", 1.0, 1.0, 3.0, 6.0, 3.0, 0.8, 0.6, 0.025, 1.10)) 181 default_trees.append(tree("Liquidambar", 3.0, 1.0, 3.0, 7.0, 3.0, 0.8, 0.6, 0.025, 0.30)) 182 default_trees.append(tree("Liriodendron", 3.0, 1.0, 4.5, 9.5, 3.0, 0.8, 0.6, 0.025, 0.50)) 183 default_trees.append(tree("Lonicera", 1.0, 1.0, 7.0, 9.0, 3.0, 0.8, 0.6, 0.025, 0.70)) 184 default_trees.append(tree("Magnolia", 1.0, 1.0, 3.0, 5.0, 3.0, 0.8, 0.6, 0.025, 0.60)) 185 default_trees.append(tree("Malus", 1.0, 1.0, 4.5, 5.0, 3.0, 0.8, 0.6, 0.025, 0.30)) 186 default_trees.append(tree("Metasequoia", 5.0, 1.0, 4.5, 12.0, 3.0, 0.8, 0.6, 0.025, 0.50)) 187 default_trees.append(tree("Morus", 1.0, 1.0, 7.5, 11.5, 3.0, 0.8, 0.6, 0.025, 1.00)) 188 default_trees.append(tree("Ostrya", 1.0, 1.0, 2.0, 6.0, 3.0, 0.8, 0.6, 0.025, 1.00)) 189 default_trees.append(tree("Parrotia", 1.0, 1.0, 7.0, 7.0, 3.0, 0.8, 0.6, 0.025, 0.30)) 190 default_trees.append(tree("Paulownia", 1.0, 1.0, 4.0, 8.0, 3.0, 0.8, 0.6, 0.025, 0.40)) 191 default_trees.append(tree("Phellodendron", 1.0, 1.0,13.5, 13.5, 3.0, 0.8, 0.6, 0.025, 0.50)) 192 default_trees.append(tree("Picea", 3.0, 1.0, 3.0, 13.0, 3.0, 0.8, 0.6, 0.025, 0.90)) 193 default_trees.append(tree("Pinus", 3.0, 1.0, 6.0, 16.0, 3.0, 0.8, 0.6, 0.025, 0.80)) 194 default_trees.append(tree("Platanus", 1.0, 1.0,10.0, 14.5, 3.0, 0.8, 0.6, 0.025, 1.10)) 195 default_trees.append(tree("Populus", 1.0, 1.0, 9.0, 20.0, 3.0, 0.8, 0.6, 0.025, 1.40)) 196 default_trees.append(tree("Prunus", 1.0, 1.0, 5.0, 7.0, 3.0, 0.8, 0.6, 0.025, 1.60)) 197 default_trees.append(tree("Pseudotsuga", 3.0, 1.0, 6.0, 17.5, 3.0, 0.8, 0.6, 0.025, 0.70)) 198 default_trees.append(tree("Ptelea", 1.0, 1.0, 5.0, 4.0, 3.0, 0.8, 0.6, 0.025, 1.10)) 199 default_trees.append(tree("Pterocaria", 1.0, 1.0,10.0, 12.0, 3.0, 0.8, 0.6, 0.025, 0.50)) 200 default_trees.append(tree("Pterocarya", 1.0, 1.0,11.5, 14.5, 3.0, 0.8, 0.6, 0.025, 1.60)) 201 default_trees.append(tree("Pyrus", 3.0, 1.0, 3.0, 6.0, 3.0, 0.8, 0.6, 0.025, 1.80)) 200 202 default_trees.append(tree("Quercus", 1.0, 1.0, 8.0, 14.0, 3.1, 0.1, 0.6, 0.025, 0.40)) # 201 default_trees.append(tree("Rhamnus", 1.0, 1.0, 4.5, 4.5, 2.0, 0.1, 0.6, 0.025, 1.30))202 default_trees.append(tree("Rhus", 1.0, 1.0, 7.0, 5.5, 2.0, 0.1, 0.6, 0.025, 0.50))203 default_trees.append(tree("Robinia", 1.0, 1.0, 4.5, 13.5, 2.0, 0.1, 0.6, 0.025, 0.50))204 default_trees.append(tree("Salix", 1.0, 1.0, 7.0, 14.0, 2.0, 0.1, 0.6, 0.025, 1.10))205 default_trees.append(tree("Sambucus", 1.0, 1.0, 8.0, 6.0, 2.0, 0.1, 0.6, 0.025, 1.40))206 default_trees.append(tree("Sasa", 1.0, 1.0,10.0, 25.0, 2.0, 0.1, 0.6, 0.025, 0.60))207 default_trees.append(tree("Sequoiadendron", 5.0, 1.0, 5.5, 10.5, 2.0, 0.1, 0.6, 0.025, 1.60))208 default_trees.append(tree("Sophora", 1.0, 1.0, 7.5, 10.0, 2.0, 0.1, 0.6, 0.025, 1.40))209 default_trees.append(tree("Sorbus", 1.0, 1.0, 4.0, 7.0, 2.0, 0.1, 0.6, 0.025, 1.10))210 default_trees.append(tree("Syringa", 1.0, 1.0, 4.5, 5.0, 2.0, 0.1, 0.6, 0.025, 0.60))211 default_trees.append(tree("Tamarix", 1.0, 1.0, 6.0, 7.0, 2.0, 0.1, 0.6, 0.025, 0.50))212 default_trees.append(tree("Taxodium", 5.0, 1.0, 6.0, 16.5, 2.0, 0.1, 0.6, 0.025, 0.60))213 default_trees.append(tree("Taxus", 2.0, 1.0, 5.0, 7.5, 2.0, 0.1, 0.6, 0.025, 1.50))214 default_trees.append(tree("Thuja", 3.0, 1.0, 3.5, 9.0, 2.0, 0.1, 0.6, 0.025, 0.70))215 default_trees.append(tree("Tilia", 3.0, 1.0, 7.0, 12.5, 2.0, 0.1, 0.6, 0.025, 0.70))216 default_trees.append(tree("Tsuga", 3.0, 1.0, 6.0, 10.5, 2.0, 0.1, 0.6, 0.025, 1.10))217 default_trees.append(tree("Ulmus", 1.0, 1.0, 7.5, 14.0, 2.0, 0.1, 0.6, 0.025, 0.80))218 default_trees.append(tree("Zelkova", 1.0, 1.0, 4.0, 5.5, 2.0, 0.1, 0.6, 0.025, 1.20))219 default_trees.append(tree("Zenobia", 1.0, 1.0, 5.0, 5.0, 2.0, 0.1, 0.6, 0.025, 0.40))203 default_trees.append(tree("Rhamnus", 1.0, 1.0, 4.5, 4.5, 3.0, 0.8, 0.6, 0.025, 1.30)) 204 default_trees.append(tree("Rhus", 1.0, 1.0, 7.0, 5.5, 3.0, 0.8, 0.6, 0.025, 0.50)) 205 default_trees.append(tree("Robinia", 1.0, 1.0, 4.5, 13.5, 3.0, 0.8, 0.6, 0.025, 0.50)) 206 default_trees.append(tree("Salix", 1.0, 1.0, 7.0, 14.0, 3.0, 0.8, 0.6, 0.025, 1.10)) 207 default_trees.append(tree("Sambucus", 1.0, 1.0, 8.0, 6.0, 3.0, 0.8, 0.6, 0.025, 1.40)) 208 default_trees.append(tree("Sasa", 1.0, 1.0,10.0, 25.0, 3.0, 0.8, 0.6, 0.025, 0.60)) 209 default_trees.append(tree("Sequoiadendron", 5.0, 1.0, 5.5, 10.5, 3.0, 0.8, 0.6, 0.025, 1.60)) 210 default_trees.append(tree("Sophora", 1.0, 1.0, 7.5, 10.0, 3.0, 0.8, 0.6, 0.025, 1.40)) 211 default_trees.append(tree("Sorbus", 1.0, 1.0, 4.0, 7.0, 3.0, 0.8, 0.6, 0.025, 1.10)) 212 default_trees.append(tree("Syringa", 1.0, 1.0, 4.5, 5.0, 3.0, 0.8, 0.6, 0.025, 0.60)) 213 default_trees.append(tree("Tamarix", 1.0, 1.0, 6.0, 7.0, 3.0, 0.8, 0.6, 0.025, 0.50)) 214 default_trees.append(tree("Taxodium", 5.0, 1.0, 6.0, 16.5, 3.0, 0.8, 0.6, 0.025, 0.60)) 215 default_trees.append(tree("Taxus", 2.0, 1.0, 5.0, 7.5, 3.0, 0.8, 0.6, 0.025, 1.50)) 216 default_trees.append(tree("Thuja", 3.0, 1.0, 3.5, 9.0, 3.0, 0.8, 0.6, 0.025, 0.70)) 217 default_trees.append(tree("Tilia", 3.0, 1.0, 7.0, 12.5, 3.0, 0.8, 0.6, 0.025, 0.70)) 218 default_trees.append(tree("Tsuga", 3.0, 1.0, 6.0, 10.5, 3.0, 0.8, 0.6, 0.025, 1.10)) 219 default_trees.append(tree("Ulmus", 1.0, 1.0, 7.5, 14.0, 3.0, 0.8, 0.6, 0.025, 0.80)) 220 default_trees.append(tree("Zelkova", 1.0, 1.0, 4.0, 5.5, 3.0, 0.8, 0.6, 0.025, 1.20)) 221 default_trees.append(tree("Zenobia", 1.0, 1.0, 5.0, 5.0, 3.0, 0.8, 0.6, 0.025, 0.40)) 220 222 221 223 # Define fill values … … 237 239 if (season == "summer"): 238 240 tree_lai = default_trees[tree_type].lai_summer 241 239 242 else: 240 243 tree_lai = default_trees[tree_type].lai_winter … … 279 282 280 283 lad_max = tree_lai / (lad_max_part_1[0] + lad_max_part_2[0]) 281 282 284 283 285 … … 298 300 z = np.arange(0,nz*dz,dz) 299 301 z[1:] = z[1:] - 0.5 * dz 300 301 302 302 303 # Define center of the tree position inside the local LAD domain … … 468 469 469 470 470 def process_patch(dz,patch_height, patch_lai,alpha,beta):471 def process_patch(dz,patch_height,max_height_lad,patch_lai,alpha,beta): 471 472 472 473 # Define fill values … … 481 482 pch_index = np.where( (pch_index[:,:] == -1) ,0,pch_index[:,:]) 482 483 483 max_canopy_height = max( patch_height.flatten())484 max_canopy_height = max(max(patch_height.flatten()),max_height_lad) 484 485 485 486 z = np.arange(0,math.floor(max_canopy_height/dz)*dz+2*dz,dz) … … 500 501 int_bpdf = 0.0 501 502 if ( (patch_height[j,i] != fillvalues["tree_data"]) & (patch_height[j,i] >= (0.5*dz)) ): 502 for k in range( 0,pch_index[j,i]):503 for k in range(1,pch_index[j,i]): 503 504 int_bpdf = int_bpdf + ( ( ( z[k] / patch_height[j,i] )**( alpha - 1 ) ) * ( ( 1.0 - ( z[k] / patch_height[j,i] ) )**(beta - 1 ) ) * ( dz / patch_height[j,i] ) ) 504 505 505 for k in range( 0,pch_index[j,i]):506 for k in range(1,pch_index[j,i]): 506 507 pre_lad[k] = patch_lai[j,i] * ( ( ( dz*k / patch_height[j,i] )**( alpha - 1.0 ) ) * ( ( 1.0 - ( dz*k / patch_height[j,i] ) )**(beta - 1.0 ) ) / int_bpdf ) / patch_height[j,i] 507 508 … … 538 539 # dbh: default trunk diameter at breast height (1.4 m) (m) 539 540 # 540 #541 541 class tree: 542 542 def __init__(self, species, shape, ratio, diameter, height, lai_summer, lai_winter, lad_max_height, bad_scale, dbh):
Note: See TracChangeset
for help on using the changeset viewer.