Changeset 5945
 Timestamp:
 Nov 12, 2008, 11:50:44 AM (15 years ago)
 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 14 14 15 15 16 from Scientific.IO.NetCDF import NetCDFFile 16 from Scientific.IO.NetCDF import NetCDFFile 17 from anuga.config import Float 17 18 from anuga.coordinate_transforms.lat_long_UTM_conversion import UTMtoLL 18 19 from anuga.utilities.numerical_tools import ensure_numeric … … 632 633 # print 'hello from get_sample' 633 634 points = self.get_data_points() 634 sampled_points = take(points, indices)635 sampled_points = numpy.take(points, indices) ##FIX? 635 636 636 637 attributes = self.get_all_attributes() … … 639 640 if attributes is not None: 640 641 for key, att in attributes.items(): 641 sampled_attributes[key] = numpy.take(att, indices) 642 sampled_attributes[key] = numpy.take(att, indices) ##FIX? 642 643 643 644 # print 'goodbye from get_sample' … … 689 690 # plus recalcule seed when no seed provided. 690 691 if seed_num != None: 691 numpy.random.seed(seed_num ,seed_num)692 numpy.random.seed(seed_num) 692 693 else: 693 694 numpy.random.seed() … … 695 696 696 697 #print 'size',self_size, new_size 697 random_num = numpy.rand int(0,self_size1,(int(new_size),))698 random_num = numpy.random.randint(0,self_size1,(int(new_size),)) 698 699 #print 'random num',random_num 699 700 random_num = random_num.tolist() … … 1182 1183 1183 1184 # Variable definition 1184 outfile.createVariable('points', numpy.float, ('number_of_points',1185 outfile.createVariable('points', Float, ('number_of_points', 1185 1186 'number_of_dimensions')) 1186 1187 … … 1190 1191 if write_attributes is not None: 1191 1192 for key in write_attributes.keys(): 1192 outfile.createVariable(key, numpy.float, ('number_of_points',))1193 outfile.createVariable(key, Float, ('number_of_points',)) 1193 1194 outfile.variables[key][:] = write_attributes[key] #.astype(Float32) 1194 1195 … … 1472 1473 1473 1474 from anuga.utilities.numerical_tools import cov 1474 ## from numpy.oldnumeric import array, resize,shape,Float,zeros,take,argsort,argmin1475 1475 from anuga.utilities.polygon import is_inside_polygon 1476 1476 from anuga.fit_interpolate.benchmark_least_squares import mem_usage … … 1585 1585 1586 1586 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? 1588 1588 1589 1589 if plot_name is not None: … … 1664 1664 1665 1665 from anuga.utilities.numerical_tools import cov 1666 ## from numpy.oldnumeric import array, resize,shape,Float,zeros,take,argsort,argmin1667 1666 from anuga.utilities.polygon import is_inside_polygon 1668 1667 from anuga.fit_interpolate.benchmark_least_squares import mem_usage … … 1792 1791 1793 1792 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? 1795 1794 1796 1795 if plot_name is not None: 
anuga_core/source_numpy_conversion/anuga/geospatial_data/test_geospatial_data.py
r5915 r5945 10 10 from sets import ImmutableSet 11 11 12 from anuga.config import Float 12 13 from anuga.geospatial_data.geospatial_data import * 13 14 from anuga.coordinate_transforms.geo_reference import Geo_reference, TitleError … … 1450 1451 mesh_origin = (56, 290000, 618000) #zone, easting, northing 1451 1452 1452 data_points = numpy.zeros((ab_points.shape), Float)1453 data_points = numpy.zeros((ab_points.shape), numpy.float) 1453 1454 #Shift datapoints according to new origins 1454 1455 for k in range(len(ab_points)): … … 1511 1512 mesh_origin = (56, 290000, 618000) #zone, easting, northing 1512 1513 1513 data_points = numpy.zeros((ab_points.shape), Float)1514 data_points = numpy.zeros((ab_points.shape), numpy.float) 1514 1515 #Shift datapoints according to new origins 1515 1516 for k in range(len(ab_points)): … … 1844 1845 1845 1846 ## from numpy.oldnumeric.random_array import randint,seed 1846 numpy.random.seed(100 ,100)1847 numpy.random.seed(100) 1847 1848 a_points = numpy.random.randint(0,999999,(10,2)) 1848 1849 points = a_points.tolist()
Note: See TracChangeset
for help on using the changeset viewer.