Changeset 1058
- Timestamp:
- Mar 10, 2005, 3:41:07 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution/coordinate_transforms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/coordinate_transforms/geo_reference.py
r1057 r1058 74 74 #false_northing = infile.false_northing[0] 75 75 76 def change_point _geo_ref(self, points,77 point _geo_ref=None):76 def change_points_geo_ref(self, points, 77 points_geo_ref=None): 78 78 """ 79 79 Change the reference of a list or Numeric array of points. … … 95 95 points = array(points).astype(Float) 96 96 #add point geo ref to points 97 if not point _geo_ref is None:98 points[:,0] += point _geo_ref.xllcorner99 points[:,1] += point _geo_ref.yllcorner97 if not points_geo_ref is None: 98 points[:,0] += points_geo_ref.xllcorner 99 points[:,1] += points_geo_ref.yllcorner 100 100 101 101 #subtract primary geo ref from points -
inundation/ga/storm_surge/pyvolution/coordinate_transforms/test_geo_reference.py
r1057 r1058 48 48 self.failUnless(g == new_g, 'test_read_write_ASCII failed') 49 49 50 def test_change_point _geo_ref(self):50 def test_change_points_geo_ref(self): 51 51 x = 3.0 52 52 y = 3.0 53 53 g = Geo_reference(56,x,y) 54 54 lofl = [[3.0,3.0], [6.0,6.0]] 55 new_lofl = g.change_point _geo_ref(lofl)55 new_lofl = g.change_points_geo_ref(lofl) 56 56 #print "lofl",lofl 57 57 #print "new_lofl",new_lofl … … 63 63 self.failUnless(point[1]-y==new_point[1], ' failed') 64 64 65 def test_change_point _geo_ref2(self):65 def test_change_points_geo_ref2(self): 66 66 x = 3.0 67 67 y = 3.0 68 68 g = Geo_reference(56,x,y) 69 69 lofl = [[3.0,3.0]] 70 new_lofl = g.change_point _geo_ref(lofl)70 new_lofl = g.change_points_geo_ref(lofl) 71 71 #print "lofl",lofl 72 72 #print "new_lofl",new_lofl … … 78 78 self.failUnless(point[1]-y==new_point[1], ' failed') 79 79 80 def test_change_point _geo_ref3(self):80 def test_change_points_geo_ref3(self): 81 81 x = 3.0 82 82 y = 3.0 83 83 g = Geo_reference(56,x,y) 84 84 lofl = [3.0,3.0] 85 new_lofl = g.change_point _geo_ref(lofl)85 new_lofl = g.change_points_geo_ref(lofl) 86 86 #print "lofl",lofl 87 87 #print "new_lofl",new_lofl … … 94 94 95 95 96 def test_change_point _geo_ref4(self):96 def test_change_points_geo_ref4(self): 97 97 x = 3.0 98 98 y = 3.0 99 99 g = Geo_reference(56,x,y) 100 100 lofl = array([[3.0,3.0], [6.0,6.0]]) 101 new_lofl = g.change_point _geo_ref(lofl)101 new_lofl = g.change_points_geo_ref(lofl) 102 102 #print "4 lofl",lofl 103 103 #print "4 new_lofl",new_lofl … … 109 109 assert allclose(lofl,new_lofl) 110 110 111 def test_change_point _geo_ref5(self):111 def test_change_points_geo_ref5(self): 112 112 x = 3.0 113 113 y = 3.0 114 114 g = Geo_reference(56,x,y) 115 115 lofl = array([[3.0,3.0]]) 116 new_lofl = g.change_point _geo_ref(lofl)116 new_lofl = g.change_points_geo_ref(lofl) 117 117 #print "5 lofl",lofl 118 118 #print "5 new_lofl",new_lofl … … 124 124 self.failUnless(point[1]-y==new_point[1], ' failed') 125 125 126 def test_change_point _geo_ref6(self):126 def test_change_points_geo_ref6(self): 127 127 x = 3.0 128 128 y = 3.0 129 129 g = Geo_reference(56,x,y) 130 130 lofl = array([3.0,3.0]) 131 new_lofl = g.change_point _geo_ref(lofl)131 new_lofl = g.change_points_geo_ref(lofl) 132 132 #print "lofl",lofl 133 133 #print "new_lofl",new_lofl … … 139 139 self.failUnless(point[1]-y==new_point[1], ' failed') 140 140 141 def test_change_point _geo_ref7(self):141 def test_change_points_geo_ref7(self): 142 142 x = 3.0 143 143 y = 3.0 … … 145 145 point_y = -60.0 146 146 g = Geo_reference(56,x,y) 147 point _geo_ref = Geo_reference(56,point_x,point_y)147 points_geo_ref = Geo_reference(56,point_x,point_y) 148 148 lofl = [[3.0,3.0], [6.0,6.0]] 149 new_lofl = g.change_point _geo_ref(lofl,point_geo_ref=point_geo_ref)149 new_lofl = g.change_points_geo_ref(lofl,points_geo_ref=points_geo_ref) 150 150 #print "lofl",lofl 151 151 #print "new_lofl",new_lofl
Note: See TracChangeset
for help on using the changeset viewer.