Changeset 6817


Ignore:
Timestamp:
Apr 16, 2009, 8:49:58 AM (16 years ago)
Author:
rwilson
Message:

Changed the 'large file' netCDF test programs to use numpy.

Location:
branches/numpy_misc/tools/write_large_files
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/numpy_misc/tools/write_large_files/rw_big_file.py

    r6739 r6817  
    77import getopt
    88import time
    9 import Numeric
     9import numpy as num
    1010import Scientific.IO.NetCDF as nc
    1111
     
    5959def read_file(filename, variable_size, num_variables):
    6060    # create a data array slice
    61     slice_array_mask = Numeric.ones((XDIM,), 'd')
     61    slice_array_mask = numpy.ones((XDIM,), 'd')
    6262
    6363    # if timing file read, get start time
     
    102102
    103103            var_array = fid.variables[varname][index,:]
    104             if var_array != slice_array:
     104            if num.any(var_array != slice_array):
    105105                result = False
    106106                if Verbose:
     
    148148
    149149    # create a data array slice
    150     slice_array_mask = Numeric.ones((XDIM,), 'd')
     150    slice_array_mask = numpy.ones((XDIM,), 'd')
    151151
    152152    # if timing file write, remember start time
  • branches/numpy_misc/tools/write_large_files/rwi4_big_file.py

    r6739 r6817  
    1717import getopt
    1818import time
    19 import Numeric
     19import numpy as num
    2020import Scientific.IO.NetCDF as nc
    2121
     
    6161def read_file(filename, variable_size, num_variables):
    6262    # create a data array slice
    63     slice_array_mask = Numeric.ones((XDIM,), 'd')
     63    slice_array_mask = num.ones((XDIM,), 'd')
    6464
    6565    # if timing file read, get start time
     
    9898#            var_array = fid.variables[varname][slice_number,:]
    9999            var_array = var[slice_number,:]
    100             if var_array != slice_array:
     100            if num.any(var_array != slice_array):
    101101                print 'Read variable %s, slice %d: got unexpected value' % \
    102102                      (varname, slice_number)
     
    134134
    135135    # create a data array slice
    136     slice_array_mask = Numeric.ones((XDIM,), 'd')
     136    slice_array_mask = num.ones((XDIM,), 'd')
    137137
    138138    # if timing file write, remember start time
  • branches/numpy_misc/tools/write_large_files/rwi_big_file.py

    r6739 r6817  
    1717import getopt
    1818import time
    19 import Numeric
     19import numpy as num
    2020import Scientific.IO.NetCDF as nc
    2121
     
    6161def read_file(filename, variable_size, num_variables):
    6262    # create a data array slice
    63     slice_array_mask = Numeric.ones((XDIM,), 'd')
     63    slice_array_mask = num.ones((XDIM,), 'd')
    6464
    6565    # if timing file read, get start time
     
    9898
    9999            var_array = fid.variables[varname][slice_number,:]
    100             if var_array != slice_array:
     100            if num.any(var_array != slice_array):
    101101                result = False
    102102                if Verbose:
     
    141141
    142142    # create a data array slice
    143     slice_array_mask = Numeric.ones((XDIM,), 'd')
     143    slice_array_mask = num.ones((XDIM,), 'd')
    144144
    145145    # if timing file write, remember start time
  • branches/numpy_misc/tools/write_large_files/rwil_big_file.py

    r6739 r6817  
    1717import getopt
    1818import time
    19 import Numeric
     19import numpy as num
    2020import Scientific.IO.NetCDF as nc
    2121
     
    6161def read_file(filename, variable_size, num_variables):
    6262    # create a data array slice
    63     slice_array_mask = Numeric.ones((XDIM,), 'd')
     63    slice_array_mask = num.ones((XDIM,), 'd')
    6464
    6565    # if timing file read, get start time
     
    9797            var_array = fid.variables[varname][slice_number,:]
    9898
    99             if var_array != slice_array:
     99            if num.any(var_array != slice_array):
    100100                print 'Read variable %s, slice %d: got unexpected value' % \
    101101                      (varname, slice_number)
     
    133133
    134134    # create a data array slice
    135     slice_array_mask = Numeric.ones((XDIM,), 'd')
     135    slice_array_mask = num.ones((XDIM,), 'd')
    136136
    137137    # if timing file write, remember start time
  • branches/numpy_misc/tools/write_large_files/write_big_file.py

    r6739 r6817  
    77import getopt
    88import time
    9 import Numeric
     9import numpy as num
    1010import Scientific.IO.NetCDF as nc
    1111
     
    5454
    5555    # create a data array slice
    56     slice_array = Numeric.ones((XDIM,), 'i')
     56    slice_array = num.ones((XDIM,), 'i')
    5757
    5858    # if timing file write, remember start time
Note: See TracChangeset for help on using the changeset viewer.