Changeset 3355
- Timestamp:
- Jul 18, 2006, 3:52:01 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/damage/inundation_damage.py
r3352 r3355 62 62 csv.get_column('C_VALUE') 63 63 ) 64 results_dic = edm.calc_damage_and_costs(verbose_csv=True )64 results_dic = edm.calc_damage_and_costs(verbose_csv=True, verbose=verbose) 65 65 for title, value in results_dic.iteritems(): 66 66 csv.set_column(title, value, overwrite=overwrite) … … 142 142 COLLAPSE_CSV_INFO_TITLE = "Calculation notes" 143 143 MAX_DEPTH_TITLE = "Inundation height above ground floor (m)" 144 STRUCT_COLLAPSED_TITLE = "1 if structure collapsed" 145 STRUCT_INUNDATED_TITLE = "1 if structure is inundated" 144 146 double_brick_damage_array = array([[-kinds.default_float_kind.MAX, 0.0], 145 147 [0.0-depth_epsilon, 0.0], … … 222 224 #assert self.structure_count == len(self.) 223 225 224 def calc_damage_and_costs(self, verbose_csv=False ):226 def calc_damage_and_costs(self, verbose_csv=False, verbose=False): 225 227 self.calc_damage_percentages() 226 228 collapse_probability = self.calc_collapse_probability() … … 233 235 ,self.CONTENTS_DAMAGE_TITLE:self.contents_damage 234 236 ,self.MAX_DEPTH_TITLE:self.max_depths 235 #,self.:self.236 #,self.:self.237 ,self.STRUCT_COLLAPSED_TITLE:self.struct_collapsed 238 ,self.STRUCT_INUNDATED_TITLE:self.struct_inundated 237 239 } 238 240 if verbose_csv: … … 245 247 struct_damage = zeros(self.structure_count,Float) 246 248 contents_damage = zeros(self.structure_count,Float) 247 #for i_building,249 self.struct_inundated = ['']* self.structure_count 248 250 249 251 for i,max_depth,shore_distance,wall in map(None, … … 259 261 if 0.0 > max_depth: 260 262 continue 263 264 # The definition of inundated is if the max_depth is > 0.0 265 self.struct_inundated[i] = 1.0 266 261 267 #calc structural damage % 262 268 damage_curve = self.struct_damage_curve.get(wall, … … 330 336 and collapse some houses 331 337 """ 338 339 self.struct_collapsed = ['']* self.structure_count 332 340 if verbose_csv: 333 341 self.collapse_csv_info = ['']* self.structure_count … … 347 355 self.contents_damage[house_index] = 1.0 348 356 house_indexes.remove(house_index) 357 self.struct_collapsed[house_index] = 1 358 349 359 # Warning, the collapse_probability list now lists 350 360 # houses that did not collapse, (though not all of them)
Note: See TracChangeset
for help on using the changeset viewer.