29 """Do no distortion. Used for sanity checking"""
31 out = src.table.copyRecord(src)
36 """Increase the x value in a Source object by frac. E.g
37 src.x = 1000 --> 1001 if frac=.001
41 frac How much to change X by
44 A deep copy of src, with the value of x changed
48 out = src.table.copyRecord(src)
49 out.set(out.table.getCentroidKey().getX(), out.getX()*(1+frac) )
54 """Distort image by terms with power <=2
55 i.e y, y^2, x, xy, x^2
58 out = src.table.copyRecord(src)
63 out.set(out.table.getCentroidKey().getX(), x + val*frac)
64 out.set(out.table.getCentroidKey().getY(), y)
69 """Distort image by terms with power <=2
70 i.e y, y^2, x, xy, x^2
73 out = src.table.copyRecord(src)
78 out.set(out.table.getCentroidKey().getX(), x + val*frac)
79 out.set(out.table.getCentroidKey().getY(), y)
84 out = src.table.copyRecord(src)
87 val = x**3 - 2*x**2 + 4*x - 9
89 out.set(out.table.getCentroidKey().getX(), x + val*frac)
90 out.set(out.table.getCentroidKey().getY(), y)
96 """Increase the y value in a Source object by frac. E.g
97 src.x = 1000 --> 1001 if frac=.001
101 frac How much to change Y by
104 A deep copy of src, with the value of y changed
107 out = src.table.copyRecord(src)
108 out.set(out.table.getCentroidKey().getY(), out.getY()*(1+frac) )
113 """Distort image by terms with power <=2
114 i.e y, y^2, x, xy, x^2
117 out = src.table.copyRecord(src)
122 out.set(out.table.getCentroidKey().getX(), x)
123 out.set(out.table.getCentroidKey().getY(), y + val*frac)
128 """Distort image by terms with power <=2
129 i.e y, y^2, x, xy, x^2
132 out = src.table.copyRecord(src)
137 out.set(out.table.getCentroidKey().getX(), x)
138 out.set(out.table.getCentroidKey().getY(), y + val*frac)
143 out = src.table.copyRecord(src)
146 val = y**3 - 2*y**2 + 4*y - 9
148 out.set(out.table.getCentroidKey().getX(), x)
149 out.set(out.table.getCentroidKey().getY(), y + val*frac)
154 out = src.table.copyRecord(src)
159 out.set(out.table.getCentroidKey().getX(), x)
160 out.set(out.table.getCentroidKey().getY(), y + val*frac)
165 out = src.table.copyRecord(src)
168 val = y**3 - 2*y**2 + 4*y - 9
170 out.set(out.table.getCentroidKey().getX(), x+ val*frac)
171 out.set(out.table.getCentroidKey().getY(), y)
176 out = src.table.copyRecord(src)
179 valx = x**3 - 2*x**2 + 4*x - 9
180 valy = y**3 - 2*y**2 + 4*y - 9
182 out.set(out.table.getCentroidKey().getX(), x + valy*frac)
183 out.set(out.table.getCentroidKey().getY(), y + valx*frac)
188 """Distort image by terms with power <=2
189 i.e y, y^2, x, xy, x^2
192 out = src.table.copyRecord(src)
199 out.set(out.table.getCentroidKey().getX(), x + val*frac)
200 out.set(out.table.getCentroidKey().getY(), y)
204 """Distort image by a 2nd order Cheby polynomial"""
206 out = src.table.copyRecord(src)
209 out.set(out.table.getCentroidKey().getX(), x + frac*val)
214 """Create a copy of srcList, and apply function to distort the
218 srcList a SourceSet object
219 function: A function that does a deep copy of a single Source
225 out.append( function(src) )
228 for i
in range(len(srcList)):
232 x1, y1 = s.getX(), s.getY()
233 x2, y2 = o.getX(), o.getY()
235 diff = math.hypot(x1-x2, y1-y2)
236 maxDiff = max(diff, maxDiff)
238 print "Max deviation is %e pixels" %(maxDiff)
Custom catalog class for record/table subclasses that are guaranteed to have an ID, and should generally be sorted by that ID.