- Timestamp:
- Jan 14, 2009, 11:17:06 AM (16 years ago)
- Location:
- anuga_validation/automated_validation_tests/okushiri_tank_validation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_validation/automated_validation_tests/okushiri_tank_validation/compare_timeseries_with_measures.py
r5826 r6160 6 6 """ 7 7 8 from Numeric import allclose, argmin, argmax 8 import Numeric as num 9 9 from Scientific.IO.NetCDF import NetCDFFile 10 10 … … 113 113 assert reference_time[0] == 0.0 114 114 assert reference_time[-1] == finaltime 115 assert allclose(reference_time, input_time)115 assert num.allclose(reference_time, input_time) 116 116 117 117 for key in gauge_names: … … 152 152 # rtol=rtol, atol=atol) 153 153 if plotting is False: 154 assert allclose(reference_value, computed_value,155 rtol=rtol, atol=atol), msg154 assert num.allclose(reference_value, computed_value, 155 rtol=rtol, atol=atol), msg 156 156 157 157 … … 198 198 # Locations of extrema 199 199 #i0 = argmax(observed_timeseries) 200 i1 = argmax(model)200 i1 = num.argmax(model) 201 201 res = reference_time[i1] 202 202 report_difference('Location of maximum', res, expected_argmax[name], rtol, atol) … … 205 205 if not name in ['ch7', 'ch9']: 206 206 # Minima of ch7 and ch9 are very flat and hard to pinpoint 207 i1 = argmin(model)207 i1 = num.argmin(model) 208 208 res = reference_time[i1] 209 209 report_difference('Location of minimum', res, expected_argmin[name], -
anuga_validation/automated_validation_tests/okushiri_tank_validation/create_okushiri.py
r4783 r6160 3 3 4 4 5 from Numeric import array, zeros, Float, allclose 5 import Numeric as num 6 6 7 7 from anuga.pmesh.mesh import * … … 96 96 97 97 from Scientific.IO.NetCDF import NetCDFFile 98 from Numeric import array99 100 98 101 99 print 'Creating', filename … … 113 111 114 112 N = len(lines) 115 T = zeros(N,Float) #Time116 Q = zeros(N,Float) #Values113 T = num.zeros(N, num.Float) #Time 114 Q = num.zeros(N, num.Float) #Values 117 115 118 116 for i, line in enumerate(lines): … … 130 128 fid.starttime = 0.0 131 129 fid.createDimension('number_of_timesteps', len(T)) 132 fid.createVariable('time', Float, ('number_of_timesteps',))130 fid.createVariable('time', num.Float, ('number_of_timesteps',)) 133 131 fid.variables['time'][:] = T 134 132 135 fid.createVariable('stage', Float, ('number_of_timesteps',))133 fid.createVariable('stage', num.Float, ('number_of_timesteps',)) 136 134 fid.variables['stage'][:] = Q[:] 137 135 138 fid.createVariable('xmomentum', Float, ('number_of_timesteps',))136 fid.createVariable('xmomentum', num.Float, ('number_of_timesteps',)) 139 137 fid.variables['xmomentum'][:] = 0.0 140 138 141 fid.createVariable('ymomentum', Float, ('number_of_timesteps',))139 fid.createVariable('ymomentum', num.Float, ('number_of_timesteps',)) 142 140 fid.variables['ymomentum'][:] = 0.0 143 141
Note: See TracChangeset
for help on using the changeset viewer.