Ignore:
Timestamp:
Nov 12, 2008, 11:50:44 AM (16 years ago)
Author:
rwilson
Message:

More NumPy? changes.

Location:
anuga_core/source_numpy_conversion/anuga/geospatial_data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source_numpy_conversion/anuga/geospatial_data/geospatial_data.py

    r5915 r5945  
    1414
    1515
    16 from Scientific.IO.NetCDF import NetCDFFile   
     16from Scientific.IO.NetCDF import NetCDFFile
     17from anuga.config import Float
    1718from anuga.coordinate_transforms.lat_long_UTM_conversion import UTMtoLL   
    1819from anuga.utilities.numerical_tools import ensure_numeric
     
    632633#        print 'hello from get_sample'
    633634        points = self.get_data_points()
    634         sampled_points = take(points, indices)
     635        sampled_points = numpy.take(points, indices)        ##FIX?
    635636
    636637        attributes = self.get_all_attributes()
     
    639640        if attributes is not None:
    640641            for key, att in attributes.items():
    641                 sampled_attributes[key] = numpy.take(att, indices)
     642                sampled_attributes[key] = numpy.take(att, indices)      ##FIX?
    642643
    643644#        print 'goodbye from get_sample'
     
    689690        # plus recalcule seed when no seed provided.
    690691        if seed_num != None:
    691             numpy.random.seed(seed_num,seed_num)
     692            numpy.random.seed(seed_num)
    692693        else:
    693694            numpy.random.seed()
     
    695696       
    696697        #print 'size',self_size, new_size
    697         random_num = numpy.randint(0,self_size-1,(int(new_size),))
     698        random_num = numpy.random.randint(0,self_size-1,(int(new_size),))
    698699        #print 'random num',random_num
    699700        random_num = random_num.tolist()
     
    11821183   
    11831184    # Variable definition
    1184     outfile.createVariable('points', numpy.float, ('number_of_points',
     1185    outfile.createVariable('points', Float, ('number_of_points',
    11851186                                             'number_of_dimensions'))
    11861187
     
    11901191    if write_attributes is not None:
    11911192        for key in write_attributes.keys():
    1192             outfile.createVariable(key, numpy.float, ('number_of_points',))
     1193            outfile.createVariable(key, Float, ('number_of_points',))
    11931194            outfile.variables[key][:] = write_attributes[key] #.astype(Float32)
    11941195       
     
    14721473   
    14731474    from anuga.utilities.numerical_tools import cov
    1474 ##    from numpy.oldnumeric import array, resize,shape,Float,zeros,take,argsort,argmin
    14751475    from anuga.utilities.polygon import is_inside_polygon
    14761476    from anuga.fit_interpolate.benchmark_least_squares import mem_usage
     
    15851585
    15861586    normal_cov0=normal_cov[:,0]
    1587     normal_cov_new=numpy.take(normal_cov,numpy.argsort(normal_cov0))
     1587    normal_cov_new=numpy.take(normal_cov,numpy.argsort(normal_cov0))        ##FIX?
    15881588
    15891589    if plot_name is not None:
     
    16641664   
    16651665    from anuga.utilities.numerical_tools import cov
    1666 ##    from numpy.oldnumeric import array, resize,shape,Float,zeros,take,argsort,argmin
    16671666    from anuga.utilities.polygon import is_inside_polygon
    16681667    from anuga.fit_interpolate.benchmark_least_squares import mem_usage
     
    17921791
    17931792    normal_cov0=normal_cov[:,0]
    1794     normal_cov_new=numpy.take(normal_cov,numpy.argsort(normal_cov0))
     1793    normal_cov_new=numpy.take(normal_cov,numpy.argsort(normal_cov0))        ##FIX?
    17951794
    17961795    if plot_name is not None:
  • anuga_core/source_numpy_conversion/anuga/geospatial_data/test_geospatial_data.py

    r5915 r5945  
    1010from sets import ImmutableSet
    1111
     12from anuga.config import Float
    1213from anuga.geospatial_data.geospatial_data import *
    1314from anuga.coordinate_transforms.geo_reference import Geo_reference, TitleError
     
    14501451        mesh_origin = (56, 290000, 618000) #zone, easting, northing
    14511452
    1452         data_points = numpy.zeros((ab_points.shape), Float)
     1453        data_points = numpy.zeros((ab_points.shape), numpy.float)
    14531454        #Shift datapoints according to new origins
    14541455        for k in range(len(ab_points)):
     
    15111512        mesh_origin = (56, 290000, 618000) #zone, easting, northing
    15121513
    1513         data_points = numpy.zeros((ab_points.shape), Float)
     1514        data_points = numpy.zeros((ab_points.shape), numpy.float)
    15141515        #Shift datapoints according to new origins
    15151516        for k in range(len(ab_points)):
     
    18441845
    18451846##            from numpy.oldnumeric.random_array import randint,seed
    1846             numpy.random.seed(100,100)
     1847            numpy.random.seed(100)
    18471848            a_points = numpy.random.randint(0,999999,(10,2))
    18481849            points = a_points.tolist()
Note: See TracChangeset for help on using the changeset viewer.