- Timestamp:
- Feb 13, 2009, 10:39:47 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/busselton/standardised_version/build_urs_boundary.py
r6326 r6329 22 22 #------------------------------------------------------------------------------- 23 23 def get_sts_gauge_data(filename, verbose=False): 24 print 'get_sts_gauge_data: filename=%s' % filename 24 25 fid = NetCDFFile(filename+'.sts', 'r') #Open existing file for read 25 26 permutation = fid.variables['permutation'][:] … … 87 88 ## 88 89 # @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. 91 91 # @param output_dir Directory to write STS data to. 92 92 # @note 'event_file' is produced by EventSelection. 93 def build_urs_boundary( mux_dir,event_file, output_dir):93 def build_urs_boundary(event_file, output_dir): 94 94 '''Build a boundary STS file from a set of MUX files.''' 95 95 96 print 'build_urs_boundary: mux_dir=%s' % mux_dir97 96 print 'build_urs_boundary: event_file=%s' % event_file 98 97 print 'build_urs_boundary: output_dir=%s' % output_dir 99 98 100 99 # 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) 104 104 try: 105 105 fd = open(mux_event_file, 'r') … … 130 130 split_index = muxname.index('.grd') 131 131 muxname = muxname[:split_index+len('.grd')] 132 muxname = os.path.join( mux_dir, muxname)132 muxname = os.path.join(project/mux_data_folder, muxname) 133 133 mux_filenames.append(muxname) 134 134 … … 144 144 verbose=True) 145 145 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)] 147 148 148 149 weight_factor = 1.0 149 150 mux_weights = weight_factor*num.ones(len(mux_filenames), num.Float) 150 151 151 order_filename = project. order_filename_dir152 order_filename = project.urs_order 152 153 153 154 print 'reading', order_filename 154 155 # Create ordered sts file 155 156 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) 156 161 urs2sts(mux_filenames, 157 162 basename_out=output_dir,
Note: See TracChangeset
for help on using the changeset viewer.