Changeset 6584
- Timestamp:
- Mar 23, 2009, 3:55:37 PM (16 years ago)
- Location:
- anuga_core/source/anuga/shallow_water
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r6556 r6584 5542 5542 output: 5543 5543 basename_out: name of sts file in which mux2 data is stored. 5544 5545 5546 5547 NOTE: South is positive in mux files so sign of y-component of velocity is reverted 5544 5548 """ 5545 5549 … … 5772 5776 5773 5777 xmomentum[j,i] = ua * h 5774 ymomentum[j,i] = va * h 5778 ymomentum[j,i] = -va * h # South is positive in mux files 5779 5775 5780 5776 5781 outfile.close() -
anuga_core/source/anuga/shallow_water/test_data_manager.py
r6556 r6584 5520 5520 na and va quantities will be the Easting values. 5521 5521 Depth and ua will be the Northing value. 5522 5523 The mux file format has south as positive so 5524 this function will swap the sign for va. 5522 5525 """ 5523 5526 … … 5559 5562 quantities_init[0].append(this_ha) # HA 5560 5563 quantities_init[1].append(this_ua) # UA 5561 quantities_init[2].append(this_va) # VA 5564 quantities_init[2].append(this_va) # VA 5562 5565 5563 5566 file_handle, base_name = tempfile.mkstemp("") … … 6037 6040 quantities_init[2].append(num.ones(time_step_count,num.Float)*this_va) # 6038 6041 else: 6039 quantities_init[2].append( va[i])6042 quantities_init[2].append(-va[i]) # South is negative in MUX 6040 6043 6041 6044 file_handle, base_name = tempfile.mkstemp("") … … 6159 6162 assert num.allclose(xvelocity,ua) 6160 6163 msg='incorrect gauge va time series returned' 6161 assert num.allclose(yvelocity, va)6164 assert num.allclose(yvelocity, -va) 6162 6165 6163 6166 def test_urs2sts_read_mux2_pyII(self): … … 6211 6214 6212 6215 msg='Incorrect gauge depths returned' 6213 assert num.allclose(elevation, -depth),msg6216 assert num.allclose(elevation, -depth),msg 6214 6217 msg='incorrect gauge height time series returned' 6215 assert num.allclose(stage, ha)6218 assert num.allclose(stage, ha) 6216 6219 msg='incorrect gauge ua time series returned' 6217 assert num.allclose(xvelocity, ua)6220 assert num.allclose(xvelocity, ua) 6218 6221 msg='incorrect gauge va time series returned' 6219 assert num.allclose(yvelocity, va)6222 assert num.allclose(yvelocity, -va) # South is positive in MUX 6220 6223 6221 6224 def test_urs2sts_read_mux2_pyIII(self): … … 6289 6292 assert num.allclose(xvelocity,ua) 6290 6293 msg='incorrect gauge va time series returned' 6291 assert num.allclose(yvelocity, va)6294 assert num.allclose(yvelocity, -va) # South is positive in mux 6292 6295 6293 6296 … … 6391 6394 if j == 0: assert num.allclose(data[i][:parameters_index], ha0[permutation[i], :]) 6392 6395 if j == 1: assert num.allclose(data[i][:parameters_index], ua0[permutation[i], :]) 6393 if j == 2: assert num.allclose(data[i][:parameters_index], va0[permutation[i], :])6396 if j == 2: assert num.allclose(data[i][:parameters_index], -va0[permutation[i], :]) 6394 6397 6395 6398 … … 6597 6600 x = unpack('f',f.read(4))[0] 6598 6601 #print time, x, q_time[time, point_i] 6602 if q == 'VA': x = -x # South is positive in MUX 6599 6603 assert abs(q_time[time, point_i]-x)<epsilon 6600 6604 … … 6670 6674 #print 'v ', data[i][:parameters_index][8] 6671 6675 6672 assert num.allclose(data[i][:parameters_index], va1[permutation[i], :]) 6676 # South is positive in MUX 6677 assert num.allclose(data[i][:parameters_index], -va1[permutation[i], :]) 6673 6678 6674 6679 … … 7192 7197 msg = 'urs stage is not equal to sts stage for for source %i and station %i' %(source_number,j) 7193 7198 assert num.allclose(urs_stage[index_start_urs_z:index_end_urs_z], 7194 sts_stage[index_start_stage:index_end_stage],7195 rtol=1.0e-6, atol=1.0e-5 ), msg7199 sts_stage[index_start_stage:index_end_stage], 7200 rtol=1.0e-6, atol=1.0e-5 ), msg 7196 7201 7197 7202 # check that urs e velocity and sts xmomentum are the same … … 7206 7211 msg = 'urs n velocity is not equivalent to sts y momentum for source %i and station %i' %(source_number,j) 7207 7212 assert num.allclose(urs_n[index_start_urs_n:index_end_urs_n]*(urs_stage[index_start_urs_n:index_end_urs_n]-elevation[j]), 7208 sts_ymom[index_start_y:index_end_y],7213 -sts_ymom[index_start_y:index_end_y], 7209 7214 rtol=1.0e-5, atol=1.0e-4 ), msg 7210 7215
Note: See TracChangeset
for help on using the changeset viewer.