Ignore:
Timestamp:
Feb 13, 2009, 10:39:47 AM (15 years ago)
Author:
rwilson
Message:

Further changes from testing.

File:
1 edited

Legend:

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

    r6326 r6329  
    2222#-------------------------------------------------------------------------------
    2323def get_sts_gauge_data(filename, verbose=False):
     24    print 'get_sts_gauge_data: filename=%s' % filename
    2425    fid = NetCDFFile(filename+'.sts', 'r')      #Open existing file for read
    2526    permutation = fid.variables['permutation'][:]
     
    8788##
    8889# @brief Build boundary STS files from one or more MUX files.
    89 # @param mux_dir Directory containing the MUX files.
    90 # @param event_file Path to meta-file containing mux files+weight data.
     90# @param event_file Name of mux meta-file or single mux stem.
    9191# @param output_dir Directory to write STS data to.
    9292# @note 'event_file' is produced by EventSelection.
    93 def build_urs_boundary(mux_dir, event_file, output_dir):
     93def build_urs_boundary(event_file, output_dir):
    9494    '''Build a boundary STS file from a set of MUX files.'''
    9595
    96     print 'build_urs_boundary: mux_dir=%s' % mux_dir
    9796    print 'build_urs_boundary: event_file=%s' % event_file
    9897    print 'build_urs_boundary: output_dir=%s' % output_dir
    9998
    10099    # if we are using an EventSelection multi-mux file
    101     if project.multi_mux:   
    102         # get the mux+weight data from the event file
    103         mux_event_file = os.path.join(mux_dir, event_file)
     100    if project.multi_mux:
     101        print 'using multi-mux file'
     102        # get the mux+weight data from the meta-file (in <boundaries>)
     103        mux_event_file = os.path.join(project.boundaries_folder, event_file)
    104104        try:
    105105            fd = open(mux_event_file, 'r')
     
    130130            split_index = muxname.index('.grd')
    131131            muxname = muxname[:split_index+len('.grd')]
    132             muxname = os.path.join(mux_dir, muxname)
     132            muxname = os.path.join(project/mux_data_folder, muxname)
    133133            mux_filenames.append(muxname)
    134134       
     
    144144                verbose=True)
    145145    else:                           # a single mux stem file, assume 1.0 weight
    146         mux_filenames = [os.path.join(mux_dir, event_file)]
     146        print 'using single-mux file'
     147        mux_filenames = [os.path.join(project.mux_data_folder, event_file)]
    147148
    148149        weight_factor = 1.0
    149150        mux_weights = weight_factor*num.ones(len(mux_filenames), num.Float)
    150151           
    151         order_filename = project.order_filename_dir
     152        order_filename = project.urs_order
    152153
    153154        print 'reading', order_filename
    154155        # Create ordered sts file
    155156        print 'creating sts file'
     157        print 'mux_filenames=%s' % str(mux_filenames)
     158        print 'output_dir=%s' % str(output_dir)
     159        print 'mux_weights=%s' % str(mux_weights)
     160        print 'project.tide=%s' % str(project.tide)
    156161        urs2sts(mux_filenames,
    157162                basename_out=output_dir,
Note: See TracChangeset for help on using the changeset viewer.