Ignore:
Timestamp:
Sep 25, 2008, 3:14:42 PM (16 years ago)
Author:
kristy
Message:

Updated all scripts to coincide with Perth format

File:
1 edited

Legend:

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

    r5752 r5789  
    77
    88
    9 time_dir = '20080908_173226_run_final_0_elevation_alpha0.1_kvanputt'
     9time_dir = '20080911_094915_run_final_0.6_27255_alpha0.1_kvanputt'
     10#time_dir = '20080911_100609_run_final_0.6_27283_alpha0.1_kvanputt'
    1011
    1112
    1213cellsize = 25
    1314#cellsize = 150
    14 timestep = 0
     15#timestep = 0
    1516directory = project.output_dir
    1617name = directory+sep+time_dir+sep+project.scenario_name
    17 
    18 
    19 
     18#var = [0,4]
     19var = [2] # depth and Speed
     20#var = [2,3] # elevation, depth and Speed
    2021
    2122is_parallel = False
     
    2627
    2728
    28 var = [0,4]
    29 #var = [2,3] # depth and Speed
    30 #var = [2,3] # elevation, depth and Speed
     29name1 = directory+time_dir+sep+project.scenario_name
     30name2 = directory+time_dir+sep+'sww2'+sep+project.scenario_name+'_time_41700_0' #need to get assistance on how to make this into anything
    3131
     32names = [name1, name2]
    3233
    33 for which_var in var:
    34     if which_var == 0:  # Stage
    35         outname = name + '_stage'
    36         quantityname = 'stage'
     34for name in names:
    3735
    38     if which_var == 1:  # Absolute Momentum
    39         outname = name + '_momentum'
    40         quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
     36    for which_var in var:
     37        if which_var == 0:  # Stage
     38            outname = name + '_stage'
     39            quantityname = 'stage'
    4140
    42     if which_var == 2:  # Depth
    43         outname = name + '_depth'
    44         quantityname = 'stage-elevation
     41        if which_var == 1:  # Absolute Momentum
     42            outname = name + '_momentum'
     43            quantityname = '(xmomentum**2 + ymomentum**2)**0.5
    4544
    46     if which_var == 3:  # Speed
    47         outname = name + '_speed'
    48         quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
     45        if which_var == 2:  # Depth
     46            outname = name + '_depth'
     47            quantityname = 'stage-elevation' 
    4948
    50     if which_var == 4:  # Elevation
    51         outname = name + '_elevation'
    52         quantityname = 'elevation'  #Elevation
     49        if which_var == 3:  # Speed
     50            outname = name + '_speed'
     51            quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
    5352
    54     if is_parallel == True:
    55     #    print 'is_parallel',is_parallel
    56         for i in range(0,nodes):
    57             namei = name + '_P%d_%d' %(i,nodes)
    58             outnamei = outname + '_P%d_%d' %(i,nodes)
    59             print 'start sww2dem for sww file %d' %(i)
    60             sww2dem(namei, basename_out = outnamei,
     53        if which_var == 4:  # Elevation
     54            outname = name + '_elevation'
     55            quantityname = 'elevation'  #Elevation
     56
     57        if is_parallel == True:
     58        #    print 'is_parallel',is_parallel
     59            for i in range(0,nodes):
     60                namei = name + '_P%d_%d' %(i,nodes)
     61                outnamei = outname + '_P%d_%d' %(i,nodes)
     62                print 'start sww2dem for sww file %d' %(i)
     63                sww2dem(namei, basename_out = outnamei,
     64                            quantity = quantityname,
     65                            #timestep = timestep,
     66                            cellsize = cellsize,     
     67                            easting_min = project_grad.e_min_area,
     68                            easting_max = project_grad.e_max_area,
     69                            northing_min = project_grad.n_min_area,
     70                            northing_max = project_grad.n_max_area,       
     71                            reduction = max,
     72                            verbose = True,
     73                            format = 'asc')
     74        else:
     75            print 'start sww2dem'
     76            sww2dem(name, basename_out = outname,
    6177                        quantity = quantityname,
    6278                        #timestep = timestep,
    63                         cellsize = cellsize,     
    64                         easting_min = project_grad.e_min_area,
    65                         easting_max = project_grad.e_max_area,
    66                         northing_min = project_grad.n_min_area,
    67                         northing_max = project_grad.n_max_area,       
     79                        cellsize = cellsize,
     80                        number_of_decimal_places = 4,
    6881                        reduction = max,
    6982                        verbose = True,
    7083                        format = 'asc')
    71     else:
    72         print 'start sww2dem'
    73         sww2dem(name, basename_out = outname,
    74                     quantity = quantityname,
    75                     timestep = timestep,
    76                     cellsize = cellsize,
    77                     number_of_decimal_places = 4,
    78                     reduction = max,
    79                     verbose = True,
    80                     format = 'asc')
    8184
Note: See TracChangeset for help on using the changeset viewer.