Changeset 4504


Ignore:
Timestamp:
May 28, 2007, 6:08:39 PM (17 years ago)
Author:
sexton
Message:

minor change to inundation_damage + updates to damage scripts for all scenarios

Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/damage_modelling/inundation_damage.py

    r4503 r4504  
    141141    interate_over = [x for x in dir_ls if base in x and x[-4:] == '.sww']
    142142    #print "interate_over", interate_over
    143 
     143    from os import sep
    144144    for this_sww_file in interate_over:
    145         callable_sww = file_function(this_sww_file,
     145        callable_sww = file_function(dir+sep+this_sww_file,
    146146                                     quantities=quantities,
    147147                                     interpolation_points=points,
  • anuga_core/source/anuga/shallow_water/smf.py

    r4023 r4504  
    366366        for i in range(N):
    367367            try:
     368                if i == 10: print 'hello', x[i], x0, xr[i]
    368369                z[i] =  -(am/am2) / (amin*(cosh(kappa*(yr[i]-y0)/(wi+wa)))**2) \
    369370                            * (exp(-((xr[i]-x0)/wa)**2) - \
  • anuga_work/production/broome_2006/export_results.py

    r4429 r4504  
    1 import project, os
     1import project_urs, os
    22import sys
    33
     
    55from os import sep
    66
    7 time_dir = '20070423_040235_run' #
     7#time_dir = '20070423_040235_run' #
     8#time_dir = '20070509_015227_run_final_4.9_nbartzis' # HAT 1 in 10000 yr wave height for Dampier
     9time_dir = '20070518_060438_run_final_0_nbartzis' # MSL 1 in 10000 yr wave height for Dampier
    810cellsize = 25
    911timestep = None
    10 directory = project.output_dir
     12directory = project_urs.output_dir
    1113#name = directory + time_dir + sep + project.scenario_name
    12 name = directory+time_dir+sep+project.scenario_name
     14name = directory+time_dir+sep+project_urs.scenario_name
    1315
    1416is_parallel = True
     
    1618print 'output dir:', name
    1719
    18 which_var = 2
    19 if which_var == 0:  # Stage
    20     outname = name + '_stage'
    21     quantityname = 'stage'
     20var = [2,3,4]
    2221
    23 if which_var == 1:  # Absolute Momentum
    24     outname = name + '_momentum_i1'
    25     quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
     22for which_var in var:
     23    if which_var == 0:  # Stage
     24        outname = name + '_stage'
     25        quantityname = 'stage'
    2626
    27 if which_var == 2:  # Depth
    28     outname = name + '_depth'
    29     quantityname = 'stage-elevation
     27    if which_var == 1:  # Absolute Momentum
     28        outname = name + '_momentum_i1'
     29        quantityname = '(xmomentum**2 + ymomentum**2)**0.5
    3030
    31 if which_var == 3:  # Speed
    32     outname = name + '_speed_i0'
    33     quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
     31    if which_var == 2:  # Depth
     32        outname = name + '_depth'
     33        quantityname = 'stage-elevation' 
    3434
    35 if which_var == 4:  # Elevation
    36     outname = name + '_elevation'
    37     quantityname = 'elevation'  #Elevation
     35    if which_var == 3:  # Speed
     36        outname = name + '_speed'
     37        quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
    3838
     39    if which_var == 4:  # Elevation
     40        outname = name + '_elevation'
     41        quantityname = 'elevation'  #Elevation
    3942
    40 
    41 if is_parallel == True:
    42 #    print 'is_parallel',is_parallel
    43     for i in range(0,nodes):
    44         namei = name + '_P%d_%d' %(i,nodes)
    45         outnamei = outname + '_P%d_%d' %(i,nodes)
    46         print 'start sww2dem for sww file %d' %(i)
    47         sww2dem(namei, basename_out = outnamei,
     43    if is_parallel == True:
     44    #    print 'is_parallel',is_parallel
     45        for i in range(0,nodes):
     46            namei = name + '_P%d_%d' %(i,nodes)
     47            outnamei = outname + '_P%d_%d' %(i,nodes)
     48            print 'start sww2dem for sww file %d' %(i)
     49            sww2dem(namei, basename_out = outnamei,
     50                        quantity = quantityname,
     51                        timestep = timestep,
     52                        cellsize = cellsize,     
     53                        easting_min = project_urs.e_min_area,
     54                        easting_max = project_urs.e_max_area,
     55                        northing_min = project_urs.n_min_area,
     56                        northing_max = project_urs.n_max_area,       
     57                        reduction = max,
     58                        verbose = True,
     59                        format = 'asc')
     60    else:
     61        print 'start sww2dem'
     62        sww2dem(name, basename_out = outname,
    4863                    quantity = quantityname,
    4964                    timestep = timestep,
    5065                    cellsize = cellsize,     
    51                     easting_min = project.e_min_area,
    52                     easting_max = project.e_max_area,
    53                     northing_min = project.n_min_area,
    54                     northing_max = project.n_max_area,       
     66                    #easting_min = project.e_min_area,
     67                    #easting_max = project.e_max_area,
     68                    #northing_min = project.n_min_area,
     69                    #northing_max = project.n_max_area,       
    5570                    reduction = max,
    5671                    verbose = True,
    5772                    format = 'asc')
    58 else:
    59     print 'start sww2dem'
    60     sww2dem(name, basename_out = outname,
    61                 quantity = quantityname,
    62                 timestep = timestep,
    63                 cellsize = cellsize,     
    64                 easting_min = project.e_min_area,
    65                 easting_max = project.e_max_area,
    66                 northing_min = project.n_min_area,
    67                 northing_max = project.n_max_area,       
    68                 reduction = max,
    69                 verbose = True,
    70                 format = 'asc')
     73
  • anuga_work/production/broome_2006/run_building_inundation.py

    r4314 r4504  
    2020
    2121from anuga.damage_modelling.inundation_damage import add_depth_and_momentum2csv, inundation_damage
    22 import project
     22import project_urs
    2323
    2424# Inputs
    25 #timestampdir = '20060704_063005' # HAT
    26 #timestampdir = '20060704_063112' # LAT
    27 #timestampdir = '20060704_063234' # MSL
    28 timestampdir = '20060515_001733' # DTED MSL
    29 file_loc = project.outputdir + timestampdir + sep
    30 swwfile = file_loc + project.basename + '.sww'
    31 buildings_filename = project.buildings_filename
    32 buildings_filename_out = file_loc + project.buildings_filename_out
     25#timestampdir = '20070509_015227_run_final_4.9_nbartzis' # HAT
     26timestampdir = '20070518_060438_run_final_0_nbartzis' # MSL
     27file_loc = project_urs.output_dir + timestampdir + sep
     28swwfile = file_loc + project_urs.scenario_name #+ '.sww'
     29buildings_filename = project_urs.buildings_filename
     30buildings_filename_out = file_loc + project_urs.buildings_filename_out
    3331
    3432#add_depth_and_momentum2csv(swwfile, buildings_filename, buildings_filename_out)
  • anuga_work/production/dampier_2006/project.py

    r4430 r4504  
    127127community_KD = gauges_dir + 'community_KD.csv'
    128128
    129 #buildings_filename = gauges_dir + 'dampier_res_nexis.csv'
    130 buildings_filename_damage_out = 'dampier_res_nexis_modified.csv'
     129buildings_filename = gauges_dir + 'Dampier_res_Project.csv'
     130buildings_filename_out = 'Dampier_res_Project_modified.csv'
    131131###############################
    132132# Domain definitions
  • anuga_work/production/dampier_2006/run_building_inundation.py

    r4314 r4504  
    2323
    2424# Inputs
    25 #timestampdir = '20060704_063005' # HAT
    26 #timestampdir = '20060704_063112' # LAT
    27 #timestampdir = '20060704_063234' # MSL
    28 timestampdir = '20060515_001733' # DTED MSL
    29 file_loc = project.outputdir + timestampdir + sep
    30 swwfile = file_loc + project.basename + '.sww'
     25#timestampdir = '20070419_065050_run' # HAT 1 in 10000 yr Dampier event
     26timestampdir = '20070419_065018_run' # MSL 1 in 10000 yr Dampier event
     27file_loc = project.output_dir + timestampdir + sep
     28swwfilebasename = file_loc + project.scenario_name #+ '.sww'
    3129buildings_filename = project.buildings_filename
    3230buildings_filename_out = file_loc + project.buildings_filename_out
    33 
    34 #add_depth_and_momentum2csv(swwfile, buildings_filename, buildings_filename_out)
    35 inundation_damage(swwfile, buildings_filename, buildings_filename_out)
     31print 'hello', swwfilebasename
     32add_depth_and_momentum2csv(swwfilebasename, buildings_filename, buildings_filename_out)
     33inundation_damage(swwfilebasename, buildings_filename, buildings_filename_out)
    3634
    3735print '\n Augmented building file written to %s \n' \
  • anuga_work/production/exmouth_2006/run_building_inundation.py

    r4314 r4504  
    2323
    2424# Inputs
    25 #timestampdir = '20060704_063005' # HAT
    26 #timestampdir = '20060704_063112' # LAT
    27 #timestampdir = '20060704_063234' # MSL
    28 timestampdir = '20060515_001733' # DTED MSL
    29 file_loc = project.outputdir + timestampdir + sep
    30 swwfile = file_loc + project.basename + '.sww'
     25#timestampdir = '' # HAT
     26#timestampdir = '' # MSL
     27file_loc = project.output_dir + timestampdir + sep
     28swwfile = file_loc + project.scenario_name + '.sww'
    3129buildings_filename = project.buildings_filename
    3230buildings_filename_out = file_loc + project.buildings_filename_out
  • anuga_work/production/onslow_2006/export_results.py

    r4479 r4504  
    55from os import sep
    66
    7 time_dir = '20070507_215717_run_final_1.5_nbartzis' # HAT 1 in Dampier 10000 yr
     7#time_dir = '20070507_215717_run_final_1.5_nbartzis' # HAT 1 in Dampier 10000 yr
    88#time_dir = '20070517_061654_run_final_0.0_nbartzis' # MSL 1 in Dampier 10000 yr
    99#time_dir = '' # HAT 1 in Broome 10000 yr
     
    1515#time_dir = '' # HAT 1 in Exmouth 10000 yr
    1616#time_dir = '' # MSL 1 in Exmouth 10000 yr
    17 cellsize = 25
     17time_dir = '20060704_063005' # 2006 simulation HAT Mw9
     18#cellsize = 30
     19cellsize = 250
    1820timestep = None
    1921directory = project.outputdir
    2022#name = directory + time_dir + sep + project.scenario_name
    21 name = directory+time_dir+sep+project.scenario_name
     23#name = directory+time_dir+sep+project.scenario_name
     24name = directory+time_dir+sep+'source'
    2225
    23 is_parallel = True
     26is_parallel = False
     27#is_parallel = True
    2428if is_parallel == True: nodes = 4
    2529print 'output dir:', name
    2630
    27 var = [2,3,4] # depth and speed
     31#var = [2,3,4] # depth and speed
     32var = [3] # depth and speed
    2833
    2934for which_var in var:
     
    7176                    timestep = timestep,
    7277                    cellsize = cellsize,     
    73                     easting_min = project.e_min_area,
    74                     easting_max = project.e_max_area,
    75                     northing_min = project.n_min_area,
    76                     northing_max = project.n_max_area,       
     78                    #easting_min = project.e_min_area,
     79                    #easting_max = project.e_max_area,
     80                    #northing_min = project.n_min_area,
     81                    #northing_max = project.n_max_area,       
    7782                    reduction = max,
    7883                    verbose = True,
  • anuga_work/production/onslow_2006/project.py

    r4477 r4504  
    133133# region to export
    134134
    135 e_min_area = 300000
    136 e_max_area = 310000
    137 n_min_area = 7600000
    138 n_max_area = 7610000
     135e_min_area = 290500
     136e_max_area = 321500
     137n_min_area = 7601550
     138n_max_area = 7620000
    139139
    140140# region to export to make elevation map: JS 22/9/06 - NOTE, this won't
  • anuga_work/production/onslow_2006/run_building_inundation.py

    r4314 r4504  
    2020
    2121from anuga.damage_modelling.inundation_damage import add_depth_and_momentum2csv, inundation_damage
    22 import project
     22import project_urs
    2323
    2424# Inputs
    25 #timestampdir = '20060704_063005' # HAT
    26 #timestampdir = '20060704_063112' # LAT
    27 #timestampdir = '20060704_063234' # MSL
    28 timestampdir = '20060515_001733' # DTED MSL
    29 file_loc = project.outputdir + timestampdir + sep
    30 swwfile = file_loc + project.basename + '.sww'
    31 buildings_filename = project.buildings_filename
    32 buildings_filename_out = file_loc + project.buildings_filename_out
     25#timestampdir = '20070507_215717_run_final_1.5_nbartzis' # HAT
     26timestampdir = '20070518_021050_run_final_0.0_nbartzis' # MSL
     27file_loc = project_urs.output_dir + timestampdir + sep
     28swwfile = file_loc + project_urs.scenario_name #+ '.sww'
     29buildings_filename = project_urs.buildings_filename
     30buildings_filename_out = file_loc + project_urs.buildings_filename_out
    3331
    3432#add_depth_and_momentum2csv(swwfile, buildings_filename, buildings_filename_out)
  • anuga_work/production/pt_hedland_2006/export_results.py

    r4479 r4504  
    1 import project, os
     1import project_urs, os
    22import sys
    33
     
    55from os import sep
    66
    7 time_dir = '' # HAT 1 in Dampier 10000 yr
    8 #time_dir = '' # MSL 1 in Dampier 10000 yr
     7#time_dir = '20070518_020117_run_final_3.6_nbartzis' # HAT 1 in Dampier 10000 yr
     8time_dir = '20070520_225029_run_final_0.0_nbartzis' # MSL 1 in Dampier 10000 yr
    99#time_dir = '' # HAT 1 in Broome 10000 yr
    1010#time_dir = '' # MSL 1 in Broome 10000 yr
     
    1818cellsize = 25
    1919timestep = None
    20 directory = project.output_dir
     20directory = project_urs.output_dir
    2121
    22 name = directory+time_dir+sep+project.scenario_name
     22name = directory+time_dir+sep+project_urs.scenario_name
    2323
    24 is_parallel = False
     24is_parallel = True
    2525if is_parallel == True: nodes = 4
    2626print 'output dir:', name
    2727
    28 var = [2,3] # depth and speed
     28var = [2,3,4] # depth and speed
    2929
    3030for which_var in var:
     
    5959                        timestep = timestep,
    6060                        cellsize = cellsize,     
    61                         easting_min = project.e_min_area,
    62                         easting_max = project.e_max_area,
    63                         northing_min = project.n_min_area,
    64                         northing_max = project.n_max_area,       
     61                        easting_min = project_urs.e_min_area,
     62                        easting_max = project_urs.e_max_area,
     63                        northing_min = project_urs.n_min_area,
     64                        northing_max = project_urs.n_max_area,       
    6565                        reduction = max,
    6666                        verbose = True,
  • anuga_work/production/pt_hedland_2006/run_building_inundation.py

    r4320 r4504  
    2020
    2121from anuga.damage_modelling.inundation_damage import add_depth_and_momentum2csv, inundation_damage
    22 import project
     22import project_urs
    2323
    2424# Inputs
    25 #timestampdir = '20060704_063005' # HAT
    26 #timestampdir = '20060704_063112' # LAT
    27 #timestampdir = '20060704_063234' # MSL
    28 timestampdir = '20060515_001733' # DTED MSL
    29 file_loc = project.outputdir + timestampdir + sep
    30 swwfile = file_loc + project.basename + '.sww'
    31 buildings_filename = project.buildings_filename
    32 buildings_filename_out = file_loc + project.buildings_filename_out
     25#timestampdir = '20070518_020117_run_final_3.6_nbartzis' # HAT
     26timestampdir = '20070520_225029_run_final_0.0_nbartzis' # MSL
     27file_loc = project_urs.output_dir + timestampdir + sep
     28swwfile = file_loc + project_urs.scenario_name #+ '.sww'
     29buildings_filename = project_urs.buildings_filename
     30buildings_filename_out = file_loc + project_urs.buildings_filename_out
    3331
    3432#add_depth_and_momentum2csv(swwfile, buildings_filename, buildings_filename_out)
    3533inundation_damage(swwfile, buildings_filename, buildings_filename_out)
    36 #inundation_damage(swwfile, buildings_filename, buildings_filename_out)
    3734
    3835print '\n Augmented building file written to %s \n' \
  • anuga_work/production/wollongong_2006/project_slide.py

    r4346 r4504  
    5656polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep
    5757
    58 gauge_filename = gaugedir + 'gong_gauges.csv'
     58#gauge_filename = gaugedir + 'gong_gauges.csv'
     59gauge_filename = gaugedir + 'gauges.csv'
    5960codedir = getcwd()+sep                           
    6061codedirname = codedir + 'project_slide.py'
Note: See TracChangeset for help on using the changeset viewer.