Changeset 5669


Ignore:
Timestamp:
Aug 20, 2008, 7:44:49 AM (16 years ago)
Author:
kristy
Message:

Updated

Location:
anuga_work/production
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/busselton/export_results.py

    r5655 r5669  
    66
    77
    8 time_dir = '20080812_165858_run_final_0.0_polyline_newExtent_kvanputt'
     8time_dir = '20080815_103708_run_final_0.6_polyline_newExtent_kvanputt'
    99
    1010
    1111cellsize = 25
    1212#cellsize = 150
    13 timestep = 0
     13#timestep = 0
    1414directory = project.output_dir
    1515name = directory+sep+time_dir+sep+project.scenario_name
     
    2424print 'output dir:', name
    2525
    26 var = [0,4]
     26#var = [0,4]
    2727#var = [2,3] # depth and Speed
    28 #var = [2,3,4] # elevation, depth and Speed
     28var = [2,3] # elevation, depth and Speed
    2929
    3030
     
    7171        sww2dem(name, basename_out = outname,
    7272                    quantity = quantityname,
    73                     timestep = timestep,
     73                    #timestep = timestep,
    7474                    cellsize = cellsize,
    7575                    number_of_decimal_places = 4,
  • anuga_work/production/busselton/export_results_all.py

    r5647 r5669  
    22import sys
    33
     4from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
    45from anuga.shallow_water.data_manager import sww2dem
    56from os import sep
    67
    78
    8 time_dir = '20080807_102253_run_final_0.0_polyline_newExtent_kvanputt'
    9 
    10 
    11 
    12 cellsize = 5
    13 #timestep = 0
    14 directory = project.output_dir
    15 name = directory+time_dir+sep+project.scenario_name # test folder take out!!
    16 
    17 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
    18 
     9#time_dir = '20080815_103708_run_final_0.6_polyline_newExtent_kvanputt'
     10time_dir = '20080815_103818_run_final_0_polyline_newExtent_kvanputt'
    1911
    2012is_parallel = False
    2113#is_parallel = True
     14if is_parallel == True: nodes = 4
    2215
    23 if is_parallel == True: nodes = 4
    24 print 'output dir:', name
    2516
    26 area = ['Busselton', 'Bunbury', 'Dunsborough']
     17cellsize = 15
     18#timestep = 0
     19directory = project.output_dir
     20name1 = directory+time_dir+sep+project.scenario_name
     21name2 = directory+time_dir+sep+'busselton_time_38340'+sep+project.scenario_name+'_time_38340_0'
    2722
    28 for which_area in area:
    29     if which_area == 'Busselton':
    30         easting_min = project.xminBusselton
    31         easting_max = project.xmaxBusselton
    32         northing_min = project.yminBusselton
    33         northing_max = project.ymaxBusselton
     23names= [name1, name2]
     24for name in names:
    3425
    35     if which_area == 'Bunbury':
    36         easting_min = project.xminBunbury
    37         easting_max = project.xmaxBunbury
    38         northing_min = project.yminBunbury
    39         northing_max = project.ymaxBunbury
     26    area = ['Busselton', 'Bunbury', 'Dunsborough']
    4027
    41     if which_area == 'Dunsborough':
    42         easting_min = project.xminDunsborough
    43         easting_max = project.xmaxDunsborough
    44         northing_min = project.yminDunsborough
    45         northing_max = project.ymaxDunsborough
     28    for which_area in area:
     29        if which_area == 'Busselton':
     30            easting_min = project.xminBusselton
     31            easting_max = project.xmaxBusselton
     32            northing_min = project.yminBusselton
     33            northing_max = project.ymaxBusselton
    4634
    47     var = [2,3] # depth and speed
    48     #var = [2] # depth
    49     #var = [0,4]
     35        if which_area == 'Bunbury':
     36            easting_min = project.xminBunbury
     37            easting_max = project.xmaxBunbury
     38            northing_min = project.yminBunbury
     39            northing_max = project.ymaxBunbury
    5040
    51     for which_var in var:
    52         if which_var == 0:  # Stage
    53             outname = name + which_area + '_stage'
    54             quantityname = 'stage'
     41        var = [2] # momentum and depth
     42        #var = [2] # depth
     43        #var = [0,4]
    5544
    56         if which_var == 1:  # Absolute Momentum
    57             outname = name + which_area + '_momentum'
    58             quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
     45        for which_var in var:
     46            if which_var == 0:  # Stage
     47                outname = name + which_area + '_stage'
     48                quantityname = 'stage'
    5949
    60         if which_var == 2:  # Depth
    61             outname = name + which_area + '_depth'
    62             quantityname = 'stage-elevation
     50            if which_var == 1:  # Absolute Momentum
     51                outname = name + which_area + '_momentum'
     52                quantityname = '(xmomentum**2 + ymomentum**2)**0.5
    6353
    64         if which_var == 3:  # Speed
    65             outname = name + which_area + '_speed'
    66             quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
     54            if which_var == 2:  # Depth
     55                outname = name + which_area + '_depth'
     56                quantityname = 'stage-elevation' 
    6757
    68         if which_var == 4:  # Elevation
    69             outname = name + which_area + '_elevation'
    70             quantityname = 'elevation'  #Elevation
     58            if which_var == 3:  # Speed
     59                outname = name + which_area + '_speed'
     60                quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
    7161
    72         if is_parallel == True:
    73         #    print 'is_parallel',is_parallel
    74             for i in range(0,nodes):
    75                 namei = name + '_P%d_%d' %(i,nodes)
    76                 outnamei = outname + '_P%d_%d' %(i,nodes)
    77                 print 'start sww2dem for sww file %d' %(i)
    78                 sww2dem(namei, basename_out = outnamei,
     62            if which_var == 4:  # Elevation
     63                outname = name + which_area + '_elevation'
     64                quantityname = 'elevation'  #Elevation
     65
     66            if is_parallel == True:
     67            #    print 'is_parallel',is_parallel
     68                for i in range(0,nodes):
     69                    namei = name + '_P%d_%d' %(i,nodes)
     70                    outnamei = outname + '_P%d_%d' %(i,nodes)
     71                    print 'start sww2dem for sww file %d' %(i)
     72                    sww2dem(namei, basename_out = outnamei,
     73                                quantity = quantityname,
     74                                #timestep = timestep,
     75                                cellsize = cellsize,     
     76                                easting_min = project_grad.e_min_area,
     77                                easting_max = project_grad.e_max_area,
     78                                northing_min = project_grad.n_min_area,
     79                                northing_max = project_grad.n_max_area,       
     80                                reduction = max,
     81                                verbose = True,
     82                                format = 'asc')
     83            else:
     84                print 'start sww2dem',which_area, easting_min,name,outname
     85                sww2dem(name, basename_out = outname,
    7986                            quantity = quantityname,
    8087                            #timestep = timestep,
    8188                            cellsize = cellsize,     
    82                             easting_min = project_grad.e_min_area,
    83                             easting_max = project_grad.e_max_area,
    84                             northing_min = project_grad.n_min_area,
    85                             northing_max = project_grad.n_max_area,       
     89                            easting_min = easting_min,
     90                            easting_max = easting_max,
     91                            northing_min = northing_min,
     92                            northing_max = northing_max,       
    8693                            reduction = max,
    8794                            verbose = True,
    8895                            format = 'asc')
    89         else:
    90             print 'start sww2dem',which_area, easting_min,name,outname
    91             sww2dem(name, basename_out = outname,
    92                         quantity = quantityname,
    93                         #timestep = timestep,
    94                         cellsize = cellsize,     
    95                         easting_min = easting_min,
    96                         easting_max = easting_max,
    97                         northing_min = northing_min,
    98                         northing_max = northing_max,       
    99                         reduction = max,
    100                         verbose = True,
    101                         format = 'asc')
    10296
  • anuga_work/production/busselton/get_timeseries.py

    r5647 r5669  
    2020timestamp='20080807_102253_run_final_0.0_polyline_newExtent_kvanputt'
    2121
     22
    2223filename=project.output_dir+timestamp+sep+project.scenario_name+'.sww'
    2324print 'Hello', filename
  • anuga_work/production/busselton/project.py

    r5647 r5669  
    3535scenario = 'busselton_tsunami_scenario'
    3636
    37 tide = 0.6
     37tide = 0 #0.6
    3838
    3939alpha = 0.1
  • anuga_work/production/busselton/run_busselton.py

    r5645 r5669  
    4242from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
    4343from anuga.geospatial_data.geospatial_data import find_optimal_smoothing_parameter
    44 from Scientific.IO.NetCDF import NetCDFFile
     44
    4545# Application specific imports
    4646import project                 # Definition of file names and polygons
     
    187187   
    188188    boundary_urs_out=project.boundaries_dir_name
     189
     190    Br = Reflective_boundary(domain)
     191    Bd = Dirichlet_boundary([kwargs['tide'],0,0])
    189192   
    190193    print 'Available boundary tags', domain.get_boundary_tags()
     
    192195                   domain, mean_stage=project.tide,
    193196                   time_thinning=1,
     197                   default_boundary=Bd,
    194198                   use_cache=True,
    195199                   verbose = True,
    196200                   boundary_polygon=bounding_polygon)
    197201   
    198     Br = Reflective_boundary(domain)
    199     Bd = Dirichlet_boundary([kwargs['tide'],0,0])
    200 
    201     fid = NetCDFFile(boundary_urs_out+'.sts', 'r')    #Open existing file for read
    202     sts_time=fid.variables['time'][:]+fid.starttime
    203     tmin=min(sts_time)
    204     tmax=max(sts_time)
    205     fid.close()
    206    
    207     print 'Boundary end time ', tmax-tmin
    208 
    209202    domain.set_boundary({'back': Bd,
    210203                         'side': Bd,
     
    224217        domain.write_time()
    225218        domain.write_boundary_statistics(tags = 'ocean')
    226 
    227         if t >= tmax-tmin:
    228             print 'changed to tide boundary condition at ocean'
    229             domain.set_boundary({'ocean': Bd})
    230219
    231220    x, y = domain.get_maximum_inundation_location()
     
    274263    run_model(**kwargs)
    275264     
    276     if myid==0:
    277         export_model(**kwargs)
    278265    #barrier
    279266   
  • anuga_work/production/geraldton/project.py

    r5652 r5669  
    3636
    3737
    38 tide = 0.75 #??? must check!!!
     38tide = 0 #0.75 #??? must check!!!
    3939
    4040alpha = 0.1
    4141friction=0.01
    4242starttime=0
    43 finaltime=80000
     43finaltime=1000
    4444export_cellsize=25
    4545setup='final'
    46 source='polyline'
     46source='elevation'
    4747
    4848
     
    178178print 'min number triangles', trigs_min
    179179
     180#For no input boundary file
     181
     182boundary_tags={'back': [2,3,4,5], 'side': [0,1,6], 'ocean': [7,8,9]}
    180183poly_mainland=read_polygon(topographies_in_dir +'initial_condition.csv')
     184
     185
    181186
    182187###################################################################
  • anuga_work/production/geraldton/run_geraldton.py

    r5652 r5669  
    7878    # Domain definitions
    7979    #-----------------------------------------------------------------------
    80 
    81     # Read in boundary from ordered sts file
    82     urs_bounding_polygon=create_sts_boundary(os.path.join(project.boundaries_dir,project.scenario_name))
    83 
    84     # Reading the landward defined points, this incorporates the original clipping
    85     # polygon minus the 100m contour
    86     landward_bounding_polygon = read_polygon(project.polygons_dir+'landward_boundary.txt')
    87 
    88     # Combine sts polyline with landward points
    89     bounding_polygon = urs_bounding_polygon + landward_bounding_polygon
    90    
    91     # counting segments
    92     N = len(urs_bounding_polygon)-1
    93     boundary_tags={'back': [N+2,N+3], 'side': [N,N+1,N+4],'ocean': range(N)}
     80##
     81##    # Read in boundary from ordered sts file
     82##    urs_bounding_polygon=create_sts_boundary(os.path.join(project.boundaries_dir,project.scenario_name))
     83##
     84##    # Reading the landward defined points, this incorporates the original clipping
     85##    # polygon minus the 100m contour
     86##    landward_bounding_polygon = read_polygon(project.boundaries_dir+'landward_boundary.txt')
     87##
     88##    # Combine sts polyline with landward points
     89##    bounding_polygon = urs_bounding_polygon + landward_bounding_polygon
     90##   
     91##    # counting segments
     92##    N = len(urs_bounding_polygon)-1
     93##    boundary_tags={'back': [N+2,N+3], 'side': [N,N+1,N+4],'ocean': range(N)}
     94
     95    bounding_polygon = project.poly_all
     96   
    9497
    9598   
     
    108111
    109112        create_mesh_from_regions(bounding_polygon,
    110                              boundary_tags=boundary_tags,
     113                             boundary_tags=project.boundary_tags,
    111114                             maximum_triangle_area=project.res_poly_all,
    112115                             interior_regions=project.interior_regions,
     
    218221    Bd = Dirichlet_boundary([kwargs['tide'],0,0])
    219222
    220     fid = NetCDFFile(boundary_urs_out+'.sts', 'r')    #Open existing file for read
    221     sts_time=fid.variables['time'][:]+fid.starttime
    222     tmin=min(sts_time)
    223     tmax=max(sts_time)
    224     fid.close()
    225 
    226     print 'Boundary end time ', tmax-tmin
    227    
    228223##    Bf = Field_boundary(kwargs['boundary_file'],
    229224##                domain, time_thinning=kwargs['time_thinning'], mean_stage=kwargs['tide'],
     
    232227    domain.set_boundary({'back': Br,
    233228                         'side': Bd,
    234                          'ocean': Bf})
     229                         'ocean': Bd}) # change baxk to Bf when running properly
    235230
    236231    kwargs['input_start_time']=domain.starttime
     
    248243        domain.write_boundary_statistics(tags = 'ocean')
    249244
    250         if t >= tmax-tmin:
    251             print 'changed to tide boundary condition at ocean'
    252             domain.set_boundary({'ocean': Bd})
    253245           
    254246    x, y = domain.get_maximum_inundation_location()
     
    283275    kwargs['output_dir']=project.output_run_time_dir
    284276    kwargs['elevation_file']=project.combined_dir_name+'.pts'
    285     kwargs['boundary_file']=project.boundaries_in_dir_name + '.sww'
    286277    kwargs['file_name']=project.home+'detail.csv'
    287278    kwargs['aa_scenario_name']=project.scenario_name
  • anuga_work/production/onslow_2008/export_results.py

    r5655 r5669  
    55from os import sep
    66
    7 #time_dir = '20080526_104946_run_final_0.6_test_kvanputt'
    8 #time_dir = '20080530_170833_run_final_0.6_exmouth_kvanputt'
    9 #time_dir = '20080619_115643_run_trial_0.6_exmouth_kvanputt'
    10 #time_dir = '20080714_095738_run_final_0.6_exmouth_kvanputt'
    11 #time_dir = '20080714_134935_run_final_0_exmouth_kvanputt'
    12 #time_dir = '20080718_112228_run_final_0_exmouth_kvanputt'
    13 #time_dir = '20080725_173911_run_final_0.6_polyline_alpha0.1_kvanputt'
    14 #time_dir = '20080728_112519_run_final_0.6_polyline_alpha0.2_kvanputt'
    15 time_dir = '20080812_165726_run_final_0.0_polyline_alpha0.1_kvanputt'
     7time_dir = '20080818_183807_run_trial_1.5_polyline_alpha0.1_kvanputt'
    168
    179cellsize = 25
  • anuga_work/production/onslow_2008/project.py

    r5635 r5669  
    4040
    4141
    42 tide = 0.0 #1.5
     42tide = 1.5
    4343
    4444alpha = 0.1
    4545friction=0.01
    46 starttime=0
     46starttime=5000
    4747finaltime=80000
    4848export_cellsize=25
    49 setup='final'
     49setup='trial'
    5050source='polyline'
    5151
  • anuga_work/production/onslow_2008/run_onslow.py

    r5645 r5669  
    4242from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
    4343from anuga.geospatial_data.geospatial_data import find_optimal_smoothing_parameter
    44 from Scientific.IO.NetCDF import NetCDFFile
     44
    4545# Application specific imports
    4646import project                 # Definition of file names and polygons
     
    204204   
    205205    boundary_urs_out=project.boundaries_dir_name
     206
     207    Br = Reflective_boundary(domain)
     208    Bd = Dirichlet_boundary([kwargs['tide'],0,0])
    206209   
    207210    print 'Available boundary tags', domain.get_boundary_tags()
     
    209212                   domain, mean_stage= project.tide,
    210213                   time_thinning=1,
     214                   default_boundary=Bd,
    211215                   use_cache=True,
    212216                   verbose = True,
    213217                   boundary_polygon=bounding_polygon)
    214 
    215     Br = Reflective_boundary(domain)
    216     Bd = Dirichlet_boundary([kwargs['tide'],0,0])
    217 
    218     fid = NetCDFFile(boundary_urs_out+'.sts', 'r')    #Open existing file for read
    219     sts_time=fid.variables['time'][:]+fid.starttime
    220     tmin=min(sts_time)
    221     tmax=max(sts_time)
    222     fid.close()
    223 
    224     print 'Boundary end time ', tmax-tmin
    225      
    226 ##    Bf = Field_boundary(kwargs['boundary_file'],
    227 ##                domain, time_thinning=kwargs['time_thinning'], mean_stage=kwargs['tide'],
    228 ##                use_cache=False, verbose=True)
    229218
    230219    domain.set_boundary({'back': Br,
     
    246235        domain.write_boundary_statistics(tags = 'ocean')
    247236
    248         if t >= tmax-tmin:
    249             print 'changed to tide boundary condition at ocean'
    250             domain.set_boundary({'ocean': Bd})
    251            
    252237    x, y = domain.get_maximum_inundation_location()
    253238    q = domain.get_maximum_inundation_elevation()
     
    297282    run_model(**kwargs)
    298283     
    299     if myid==0:
    300         export_model(**kwargs)
    301284    #barrier
  • anuga_work/production/perth/export_results.py

    r5626 r5669  
    1313#time_dir = '20080725_173911_run_final_0.6_polyline_alpha0.1_kvanputt'
    1414#time_dir = '20080728_112519_run_final_0.6_polyline_alpha0.2_kvanputt'
    15 time_dir = '20080807_134943_run_final_0.0_polyline_alpha0.1_kvanputt'
     15time_dir = '20080815_103336_run_final_0.6_polyline_alpha0.1_kvanputt'
    1616
    1717cellsize = 25
    1818#cellsize = 150
    19 timestep = 0
     19#timestep = 0
    2020directory = project.output_dir
    2121name = directory+time_dir+sep+project.scenario_name
     
    3030print 'output dir:', name
    3131
    32 #var = [2,3,4] # depth and speed
     32var = [2,3] # depth and speed
    3333#var = [2] # depth
    34 var = [0,4] # stage and elevation
     34#var = [0,4] # stage and elevation
    3535
    3636
     
    7777        sww2dem(name, basename_out = outname,
    7878                    quantity = quantityname,
    79                     timestep = timestep,
     79                   # timestep = timestep,
    8080                    cellsize = cellsize,     
    8181                    #easting_min = project_grad.e_min_area,
  • anuga_work/production/perth/export_results_all.py

    r5655 r5669  
    11import project, os
    22import sys
     3from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
    34
    45from anuga.shallow_water.data_manager import sww2dem
     
    78#time_dir = '20080526_104946_run_final_0.6_test_kvanputt'
    89#time_dir = '20080530_170833_run_final_0.6_exmouth_kvanputt'
    9 time_dir = '20080807_134943_run_final_0.0_polyline_alpha0.1_kvanputt'
     10#time_dir = '20080815_103442_run_final_0.0_polyline_alpha0.1_kvanputt'
     11time_dir = '20080815_103336_run_final_0.6_polyline_alpha0.1_kvanputt'
     12
     13is_parallel = False
     14#is_parallel = True
     15if is_parallel == True: nodes = 4
    1016
    1117
    12 
    13 cellsize = 25
     18cellsize = 15
    1419#cellsize = 150
    1520#timestep = 0
    1621directory = project.output_dir
    17 name = directory+time_dir+sep+project.scenario_name
     22name1 = directory+time_dir+sep+project.scenario_name
     23name2 = directory+time_dir+sep+'perth_time_39900'+sep+project.scenario_name+'_time_39900_0'
     24#name2 = directory+time_dir+sep+project.scenario_name+'_time_39900_0'
     25names = [name1, name2]
     26for name in names:
    1827
    19 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
     28    area = ['Geordie', 'Sorrento', 'Fremantle', 'Rockingham']
    2029
     30    for which_area in area:
     31        if which_area == 'Geordie':
     32            easting_min = project.xminGeordie
     33            easting_max = project.xmaxGeordie
     34            northing_min = project.yminGeordie
     35            northing_max = project.ymaxGeordie
    2136
    22 is_parallel = False
    23 #is_parallel = True
     37        if which_area == 'Sorrento':
     38            easting_min = project.xminSorrento
     39            easting_max = project.xmaxSorrento
     40            northing_min = project.yminSorrento
     41            northing_max = project.ymaxSorrento
    2442
    25 if is_parallel == True: nodes = 4
    26 print 'output dir:', name
     43        if which_area == 'Fremantle':
     44            easting_min = project.xminFremantle
     45            easting_max = project.xmaxFremantle
     46            northing_min = project.yminFremantle
     47            northing_max = project.ymaxFremantle
    2748
    28 area = ['Geordie', 'Sorrento', 'Fremantle', 'Rockingham']
     49        if which_area == 'Rockingham':
     50            easting_min = project.xminRockingham
     51            easting_max = project.xmaxRockingham
     52            northing_min = project.yminRockingham
     53            northing_max = project.ymaxRockingham
    2954
    30 for which_area in area:
    31     if which_area == 'Geordie':
    32         easting_min = project.xminGeordie
    33         easting_max = project.xmaxGeordie
    34         northing_min = project.yminGeordie
    35         northing_max = project.ymaxGeordie
     55        var = [2] # momentum and depth
     56        #var = [2] # depth
     57        #var = [0,4]
    3658
    37     if which_area == 'Sorrento':
    38         easting_min = project.xminSorrento
    39         easting_max = project.xmaxSorrento
    40         northing_min = project.yminSorrento
    41         northing_max = project.ymaxSorrento
     59        for which_var in var:
     60            if which_var == 0:  # Stage
     61                outname = name + which_area + '_stage'
     62                quantityname = 'stage'
    4263
    43     if which_area == 'Fremantle':
    44         easting_min = project.xminFremantle
    45         easting_max = project.xmaxFremantle
    46         northing_min = project.yminFremantle
    47         northing_max = project.ymaxFremantle
     64            if which_var == 1:  # Absolute Momentum
     65                outname = name + which_area + '_momentum'
     66                quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
    4867
    49     if which_area == 'Rockingham':
    50         easting_min = project.xminRockingham
    51         easting_max = project.xmaxRockingham
    52         northing_min = project.yminRockingham
    53         northing_max = project.ymaxRockingham
     68            if which_var == 2:  # Depth
     69                outname = name + which_area + '_depth'
     70                quantityname = 'stage-elevation' 
    5471
    55     var = [2,3] # depth and speed
    56     #var = [2] # depth
    57     #var = [0,4]
     72            if which_var == 3:  # Speed
     73                outname = name + which_area + '_speed'
     74                #quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
     75                quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6)'  #Speed
     76               
     77            if which_var == 4:  # Elevation
     78                outname = name + which_area + '_elevation'
     79                quantityname = 'elevation'  #Elevation
    5880
    59     for which_var in var:
    60         if which_var == 0:  # Stage
    61             outname = name + which_area + '_stage'
    62             quantityname = 'stage'
    63 
    64         if which_var == 1:  # Absolute Momentum
    65             outname = name + which_area + '_momentum'
    66             quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
    67 
    68         if which_var == 2:  # Depth
    69             outname = name + which_area + '_depth'
    70             quantityname = 'stage-elevation' 
    71 
    72         if which_var == 3:  # Speed
    73             outname = name + which_area + '_speed'
    74             quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
    75 
    76         if which_var == 4:  # Elevation
    77             outname = name + which_area + '_elevation'
    78             quantityname = 'elevation'  #Elevation
    79 
    80         if is_parallel == True:
    81         #    print 'is_parallel',is_parallel
    82             for i in range(0,nodes):
    83                 namei = name + '_P%d_%d' %(i,nodes)
    84                 outnamei = outname + '_P%d_%d' %(i,nodes)
    85                 print 'start sww2dem for sww file %d' %(i)
    86                 sww2dem(namei, basename_out = outnamei,
     81            if is_parallel == True:
     82            #    print 'is_parallel',is_parallel
     83                for i in range(0,nodes):
     84                    namei = name + '_P%d_%d' %(i,nodes)
     85                    outnamei = outname + '_P%d_%d' %(i,nodes)
     86                    print 'start sww2dem for sww file %d' %(i)
     87                    sww2dem(namei, basename_out = outnamei,
     88                                quantity = quantityname,
     89                                timestep = timestep,
     90                                cellsize = cellsize,     
     91                                easting_min = project_grad.e_min_area,
     92                                easting_max = project_grad.e_max_area,
     93                                northing_min = project_grad.n_min_area,
     94                                northing_max = project_grad.n_max_area,       
     95                                reduction = max,
     96                                verbose = True,
     97                                format = 'asc')
     98            else:
     99                print 'start sww2dem',which_area, easting_min
     100                sww2dem(name, basename_out = outname,
    87101                            quantity = quantityname,
    88                             timestep = timestep,
     102                            #timestep = timestep,
    89103                            cellsize = cellsize,     
    90                             easting_min = project_grad.e_min_area,
    91                             easting_max = project_grad.e_max_area,
    92                             northing_min = project_grad.n_min_area,
    93                             northing_max = project_grad.n_max_area,       
     104                            easting_min = easting_min,
     105                            easting_max = easting_max,
     106                            northing_min = northing_min,
     107                            northing_max = northing_max,       
    94108                            reduction = max,
    95109                            verbose = True,
    96110                            format = 'asc')
    97         else:
    98             print 'start sww2dem',which_area, easting_min
    99             sww2dem(name, basename_out = outname,
    100                         quantity = quantityname,
    101                         #timestep = timestep,
    102                         cellsize = cellsize,     
    103                         easting_min = easting_min,
    104                         easting_max = easting_max,
    105                         northing_min = northing_min,
    106                         northing_max = northing_max,       
    107                         reduction = max,
    108                         verbose = True,
    109                         format = 'asc')
    110111
  • anuga_work/production/perth/get_timeseries.py

    r5655 r5669  
    1818#timestamp='20080724_121200_run_trial_0.6_polyline_alpha0.1_kvanputt'
    1919#timestamp='20080724_161830_run_final_0.6_polyline_alpha0.1_kvanputt'
    20 timestamp='20080811_142505_run_final_0.0_polyline_alpha0.1_kvanputt'
     20timestamp='20080815_103442_run_final_0.0_polyline_alpha0.1_kvanputt'
     21#timestamp='20080815_103336_run_final_0.6_polyline_alpha0.1_kvanputt'
    2122
    22 filename=project.output_dir+timestamp+sep+project.scenario_name+'.sww'
    23 print 'Hello', filename
     23filename1=project.output_dir+timestamp+sep+project.scenario_name+'.sww'
     24#filename2=project.output_dir+timestamp+sep+'perth_time_39900'+sep+project.scenario_name+'_time_39900_0.sww'
    2425
    25 sww2csv_gauges(filename,
    26                 project.gauges_dir_name,
    27                 #project.gauges_dir_name2,
    28                 quantities = ['stage','speed','depth','elevation'],
    29                 verbose=True)
     26
     27
     28filenames = [filename1]
     29for filename in filenames:
     30
     31    sww2csv_gauges(filename,
     32                    project.gauges_dir_name,
     33                    #project.gauges_dir_name2,
     34                    quantities = ['stage','speed','depth','elevation'],
     35                    verbose=True)
    3036               
    3137
    3238   
    3339
     40
  • anuga_work/production/perth/project.py

    r5655 r5669  
    3838
    3939
    40 tide = 0.6
     40tide = 0.0 #0.6
    4141
    4242alpha = 0.1
  • anuga_work/production/perth/run_perth.py

    r5645 r5669  
    4242from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
    4343from anuga.geospatial_data.geospatial_data import find_optimal_smoothing_parameter
    44 from Scientific.IO.NetCDF import NetCDFFile
    4544
    4645# Application specific imports
     
    205204   
    206205    boundary_urs_out=project.boundaries_dir_name
     206
     207    Br = Reflective_boundary(domain)
     208    Bd = Dirichlet_boundary([kwargs['tide'],0,0])
    207209   
    208210    print 'Available boundary tags', domain.get_boundary_tags()
     
    210212                   domain, mean_stage= project.tide,
    211213                   time_thinning=1,
     214                   default_boundary=Bd,
    212215                   use_cache=True,
    213216                   verbose = True,
    214217                   boundary_polygon=bounding_polygon)
    215 
    216    
    217     Br = Reflective_boundary(domain)
    218     Bd = Dirichlet_boundary([kwargs['tide'],0,0])
    219 
    220     fid = NetCDFFile(boundary_urs_out+'.sts', 'r')    #Open existing file for read
    221     sts_time=fid.variables['time'][:]+fid.starttime
    222     tmin=min(sts_time)
    223     tmax=max(sts_time)
    224     fid.close()
    225 
    226     print 'Boundary end time ', tmax-tmin
    227    
    228 ##    Bf = Field_boundary(kwargs['boundary_file'],
    229 ##                domain, time_thinning=kwargs['time_thinning'], mean_stage=kwargs['tide'],
    230 ##                use_cache=False, verbose=True)
    231218
    232219    domain.set_boundary({'back': Br,
     
    248235        domain.write_boundary_statistics(tags = 'ocean')
    249236
    250         if t >= tmax-tmin:
    251             print 'changed to tide boundary condition at ocean'
    252             domain.set_boundary({'ocean': Bd})
    253            
    254237    x, y = domain.get_maximum_inundation_location()
    255238    q = domain.get_maximum_inundation_elevation()
     
    299282    run_model(**kwargs)
    300283     
    301     if myid==0:
    302         export_model(**kwargs)
    303284    #barrier
Note: See TracChangeset for help on using the changeset viewer.