Changeset 6368


Ignore:
Timestamp:
Feb 19, 2009, 12:06:56 PM (16 years ago)
Author:
kristy
Message:

took out build_urs_boundary.py from the top of the run script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/busselton/standardised_version/run_model.py

    r6343 r6368  
    3737from anuga.interface import create_sts_boundary
    3838from anuga.interface import csv2building_polygons
    39 <<<<<<< .mine
    40 =======
    4139from file_length import file_length
    4240
    43 >>>>>>> .r6341
    4441from anuga.shallow_water.data_manager import start_screen_catcher
    4542from anuga.shallow_water.data_manager import copy_code_files
     
    5047from setup_model import project
    5148
    52 
    53 #-------------------------------------------------------------------------------
    54 # Get gauges (timeseries of index points)
    55 #-------------------------------------------------------------------------------
    56 def get_sts_gauge_data(filename, verbose=False):
    57     fid = NetCDFFile(filename+'.sts', 'r')      #Open existing file for read
    58     permutation = fid.variables['permutation'][:]
    59     x = fid.variables['x'][:] + fid.xllcorner   #x-coordinates of vertices
    60     y = fid.variables['y'][:] + fid.yllcorner   #y-coordinates of vertices
    61     points = num.transpose(num.asarray([x.tolist(), y.tolist()]))
    62     time = fid.variables['time'][:] + fid.starttime
    63     elevation = fid.variables['elevation'][:]
    64        
    65     basename = 'sts_gauge'
    66     quantity_names = ['stage', 'xmomentum', 'ymomentum']
    67     quantities = {}
    68     for i, name in enumerate(quantity_names):
    69         quantities[name] = fid.variables[name][:]
    70 
    71     #---------------------------------------------------------------------------
    72     # Get maximum wave height throughout timeseries at each index point
    73     #---------------------------------------------------------------------------
    74 
    75     maxname = 'max_sts_stage.csv'
    76     fid_max = open(os.path.join(project.event_sts, maxname), 'w')
    77     fid_max.write('index, x, y, max_stage \n')   
    78     for j in range(len(x)):
    79         index = permutation[j]
    80         stage = quantities['stage'][:,j]
    81         xmomentum = quantities['xmomentum'][:,j]
    82         ymomentum = quantities['ymomentum'][:,j]
    83 
    84         fid_max.write('%d, %.6f, %.6f, %.6f\n' % (index, x[j], y[j], max(stage)))
    85      
    86     #---------------------------------------------------------------------------
    87     # Get minimum wave height throughout timeseries at each index point
    88     #---------------------------------------------------------------------------
    89 
    90     minname = 'min_sts_stage.csv'
    91     fid_min = open(os.path.join(project.event_sts, minname), 'w')
    92     fid_min.write('index, x, y, max_stage \n')   
    93     for j in range(len(x)):
    94         index = permutation[j]
    95         stage = quantities['stage'][:,j]
    96         xmomentum = quantities['xmomentum'][:,j]
    97         ymomentum = quantities['ymomentum'][:,j]
    98 
    99         fid_min.write('%d, %.6f, %.6f, %.6f\n' %(index, x[j], y[j], min(stage)))
    100 
    101         out_file = os.path.join(project.event_sts,
    102                                 basename+'_'+str(index)+'.csv')
    103         fid_sts = open(out_file, 'w')
    104         fid_sts.write('time, stage, xmomentum, ymomentum \n')
    105 
    106         #-----------------------------------------------------------------------
    107         # End of the get gauges
    108         #-----------------------------------------------------------------------
    109         for k in range(len(time)-1):
    110             fid_sts.write('%.6f, %.6f, %.6f, %.6f\n'
    111                           % (time[k], stage[k], xmomentum[k], ymomentum[k]))
    112 
    113         fid_sts.close()     
    114 
    115     fid.close()
    116 
    117     return quantities,elevation,time
    11849
    11950
     
    226157
    227158# Create the STS file
    228 <<<<<<< .mine
    229 build_urs_boundary(project.mux_data_folder,
    230                    project.mux_input,
    231                    os.path.join(project.event_folder,
    232                                 project.scenario_name))
    233 =======
    234159print 'project.mux_data_folder=%s' % project.mux_data_folder
    235160bub.build_urs_boundary(project.mux_input_filename,
    236161                       os.path.join(project.event_folder,
    237162                                    project.scenario_name))
    238 >>>>>>> .r6341
    239163
    240164# Read in boundary from ordered sts file
Note: See TracChangeset for help on using the changeset viewer.