Changeset 6376


Ignore:
Timestamp:
Feb 23, 2009, 2:17:06 PM (15 years ago)
Author:
myall
Message:

Ready for use, fixed known problems

Location:
anuga_work/production/busselton/standardised_version
Files:
4 edited

Legend:

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

    r6367 r6376  
    5050# Create Geospatial data from ASCII files
    5151geospatial_data = {}
    52 for filename in project.ascii_grid_filenames:
    53     absolute_filename = join(project.topographies_folder, filename)
    54     convert_dem_from_ascii2netcdf(absolute_filename,
    55                                   basename_out=absolute_filename,
    56                                   use_cache=True,
    57                                   verbose=True)
    58     dem2pts(absolute_filename, use_cache=True, verbose=True)
     52if not project.ascii_grid_filenames == []:
     53    for filename in project.ascii_grid_filenames:
     54        absolute_filename = join(project.topographies_folder, filename)
     55        convert_dem_from_ascii2netcdf(absolute_filename,
     56                                      basename_out=absolute_filename,
     57                                      use_cache=True,
     58                                      verbose=True)
     59        dem2pts(absolute_filename, use_cache=True, verbose=True)
    5960
    60     geospatial_data[filename] = Geospatial_data(file_name=absolute_filename+'.pts',
    61                                                 verbose=True)
     61        geospatial_data[filename] = Geospatial_data(file_name=absolute_filename+'.pts',
     62                                                    verbose=True)
    6263
    6364# Create Geospatial data from TXT files
    64 for filename in project.point_filenames:
    65     absolute_filename = join(project.topographies_folder, filename)
    66     geospatial_data[filename] = Geospatial_data(file_name=absolute_filename,
    67                                                 verbose=True)
    68 
     65if not project.point_filenames == []:
     66    for filename in project.point_filenames:
     67        absolute_filename = join(project.topographies_folder, filename)
     68        geospatial_data[filename] = Geospatial_data(file_name=absolute_filename,
     69                                                    verbose=True)
    6970
    7071#-------------------------------------------------------------------------------
  • anuga_work/production/busselton/standardised_version/build_urs_boundary.py

    r6335 r6376  
    4040    # Get maximum wave height throughout timeseries at each index point
    4141    #---------------------------------------------------------------------------
    42 
    43     # create directory for generate STS file, if necessary
    44     if not os.path.exists(project.event_sts):
    45         os.mkdir(project.event_sts)
    46        
     42     
    4743    maxname = 'max_sts_stage.csv'
    4844    print 'get_sts_gauge_data: maxname=%s' % maxname
    49     fid_max = open(os.path.join(project.event_sts, maxname), 'w')
     45    fid_max = open(os.path.join(project.event_folder, maxname), 'w')
    5046    fid_max.write('index, x, y, max_stage \n')   
    5147    for j in range(len(x)):
     
    6258
    6359    minname = 'min_sts_stage.csv'
    64     fid_min = open(os.path.join(project.event_sts, minname), 'w')
     60    fid_min = open(os.path.join(project.event_folder, minname), 'w')
    6561    fid_min.write('index, x, y, max_stage \n')   
    6662    for j in range(len(x)):
     
    7268        fid_min.write('%d, %.6f, %.6f, %.6f\n' %(index, x[j], y[j], min(stage)))
    7369
    74         out_file = os.path.join(project.event_sts,
     70        out_file = os.path.join(project.event_folder,
    7571                                basename+'_'+str(index)+'.csv')
    7672        fid_sts = open(out_file, 'w')
     
    10298    if project.multi_mux:
    10399        # get the mux+weight data from the meta-file (in <boundaries>)
    104         mux_event_file = os.path.join(project.boundaries_folder, event_file)
     100        mux_event_file = os.path.join(project.event_folder, event_file)
    105101        print 'using multi-mux file', mux_event_file
    106102        try:
     
    146142                verbose=True)
    147143    else:                           # a single mux stem file, assume 1.0 weight
    148         mux_file = os.path.join(project.mux_data_folder, event_file)
     144        mux_file = os.path.join(project.event_folder, event_file)
    149145        mux_filenames = [mux_file]
    150146        print 'using single-mux file', mux_file
  • anuga_work/production/busselton/standardised_version/project.py

    r6375 r6376  
    2727# One or all can be changed each time the run_model script is executed
    2828tide = 0                # difference between MSL and HAT
    29 event_number = 27197    # the event number
     29event_number = 27197    # the event number or the mux file name
    3030alpha = 0.1             # smoothing parameter for mesh
    3131friction=0.01           # manning's friction coefficient
     
    125125# If a meta-file from EventSelection is used, set 'multi-mux' to True.
    126126# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
    127 mux_input_filename = 'Java-0016-z.grd'
    128 multi_mux = False
    129 ##mux_input_filename = join(event_folder, 'event.list')
    130 ##multi_mux = True
     127##mux_input_filename = event_number # to be found in event_folder
     128                                    # (ie boundaries/event_number/)
     129##multi_mux = False
     130mux_input_filename = 'event.list'
     131multi_mux = True
    131132
    132133#-------------------------------------------------------------------------------
     
    243244
    244245# full path to where MUX files (or meta-files) live
    245 mux_input = join(boundaries_folder, mux_input_filename)
    246 
     246mux_input = join(event_folder, mux_input_filename)
     247
  • anuga_work/production/busselton/standardised_version/run_model.py

    r6369 r6376  
    121121else:
    122122    IC = 0
    123 omain.set_quantity('stage', IC, use_cache=True, verbose=True)
     123domain.set_quantity('stage', IC, use_cache=True, verbose=True)
    124124domain.set_quantity('friction', project.friction)
    125125domain.set_quantity('elevation',
Note: See TracChangeset for help on using the changeset viewer.