LSSTApplications  17.0+11,17.0+34,17.0+56,17.0+57,17.0+59,17.0+7,17.0-1-g377950a+33,17.0.1-1-g114240f+2,17.0.1-1-g4d4fbc4+28,17.0.1-1-g55520dc+49,17.0.1-1-g5f4ed7e+52,17.0.1-1-g6dd7d69+17,17.0.1-1-g8de6c91+11,17.0.1-1-gb9095d2+7,17.0.1-1-ge9fec5e+5,17.0.1-1-gf4e0155+55,17.0.1-1-gfc65f5f+50,17.0.1-1-gfc6fb1f+20,17.0.1-10-g87f9f3f+1,17.0.1-11-ge9de802+16,17.0.1-16-ga14f7d5c+4,17.0.1-17-gc79d625+1,17.0.1-17-gdae4c4a+8,17.0.1-2-g26618f5+29,17.0.1-2-g54f2ebc+9,17.0.1-2-gf403422+1,17.0.1-20-g2ca2f74+6,17.0.1-23-gf3eadeb7+1,17.0.1-3-g7e86b59+39,17.0.1-3-gb5ca14a,17.0.1-3-gd08d533+40,17.0.1-30-g596af8797,17.0.1-4-g59d126d+4,17.0.1-4-gc69c472+5,17.0.1-6-g5afd9b9+4,17.0.1-7-g35889ee+1,17.0.1-7-gc7c8782+18,17.0.1-9-gc4bbfb2+3,w.2019.22
LSSTDataManagementBasePackage
Classes | Functions
astshim.test Namespace Reference

Classes

class  MappingTestCase
 
class  ObjectTestCase
 

Functions

def makePolyMapCoeffs (nIn, nOut)
 
def makeTwoWayPolyMap (nIn, nOut)
 
def makeForwardPolyMap (nIn, nOut)
 

Function Documentation

◆ makeForwardPolyMap()

def astshim.test.makeForwardPolyMap (   nIn,
  nOut 
)
Make an astshim.PolyMap suitable for testing

The forward transform is the same as for `makeTwoWayPolyMap`.
This map does not have a reverse transform.

The equation is chosen for the following reasons:
- It is well defined for any positive value of nIn, nOut
- It stays small for small x, to avoid wraparound of angles for SpherePoint endpoints

Definition at line 307 of file test.py.

307 def makeForwardPolyMap(nIn, nOut):
308  """Make an astshim.PolyMap suitable for testing
309 
310  The forward transform is the same as for `makeTwoWayPolyMap`.
311  This map does not have a reverse transform.
312 
313  The equation is chosen for the following reasons:
314  - It is well defined for any positive value of nIn, nOut
315  - It stays small for small x, to avoid wraparound of angles for SpherePoint endpoints
316  """
317  forwardCoeffs = makePolyMapCoeffs(nIn, nOut)
318  polyMap = PolyMap(forwardCoeffs, nOut, "IterInverse=0")
319  assert polyMap.nIn == nIn
320  assert polyMap.nOut == nOut
321  assert polyMap.hasForward
322  assert not polyMap.hasInverse
323  return polyMap
324 
def makePolyMapCoeffs(nIn, nOut)
Definition: test.py:263
def makeForwardPolyMap(nIn, nOut)
Definition: test.py:307

◆ makePolyMapCoeffs()

def astshim.test.makePolyMapCoeffs (   nIn,
  nOut 
)
Make an array of coefficients for astshim.PolyMap for the following equation:

fj(x) = C0j x0^2 + C1j x1^2 + C2j x2^2 + ... + CNj xN^2
where:
* i ranges from 0 to N=nIn-1
* j ranges from 0 to nOut-1,
* Cij = 0.001 (i+j+1)

Definition at line 263 of file test.py.

263 def makePolyMapCoeffs(nIn, nOut):
264  """Make an array of coefficients for astshim.PolyMap for the following equation:
265 
266  fj(x) = C0j x0^2 + C1j x1^2 + C2j x2^2 + ... + CNj xN^2
267  where:
268  * i ranges from 0 to N=nIn-1
269  * j ranges from 0 to nOut-1,
270  * Cij = 0.001 (i+j+1)
271  """
272  baseCoeff = 0.001
273  forwardCoeffs = []
274  for out_ind in range(nOut):
275  coeffOffset = baseCoeff * out_ind
276  for in_ind in range(nIn):
277  coeff = baseCoeff * (in_ind + 1) + coeffOffset
278  coeffArr = [coeff, out_ind + 1] + [2 if i == in_ind else 0 for i in range(nIn)]
279  forwardCoeffs.append(coeffArr)
280  return np.array(forwardCoeffs, dtype=float)
281 
282 
def makePolyMapCoeffs(nIn, nOut)
Definition: test.py:263

◆ makeTwoWayPolyMap()

def astshim.test.makeTwoWayPolyMap (   nIn,
  nOut 
)
Make an astshim.PolyMap suitable for testing

The forward transform is as follows:
fj(x) = C0j x0^2 + C1j x1^2 + C2j x2^2 + ... + CNj xN^2 where Cij = 0.001 (i+j+1)

The reverse transform is the same equation with i and j reversed
thus it is NOT the inverse of the forward direction,
but is something that can be easily evaluated.

The equation is chosen for the following reasons:
- It is well defined for any positive value of nIn, nOut
- It stays small for small x, to avoid wraparound of angles for SpherePoint endpoints

Definition at line 283 of file test.py.

283 def makeTwoWayPolyMap(nIn, nOut):
284  """Make an astshim.PolyMap suitable for testing
285 
286  The forward transform is as follows:
287  fj(x) = C0j x0^2 + C1j x1^2 + C2j x2^2 + ... + CNj xN^2 where Cij = 0.001 (i+j+1)
288 
289  The reverse transform is the same equation with i and j reversed
290  thus it is NOT the inverse of the forward direction,
291  but is something that can be easily evaluated.
292 
293  The equation is chosen for the following reasons:
294  - It is well defined for any positive value of nIn, nOut
295  - It stays small for small x, to avoid wraparound of angles for SpherePoint endpoints
296  """
297  forwardCoeffs = makePolyMapCoeffs(nIn, nOut)
298  reverseCoeffs = makePolyMapCoeffs(nOut, nIn)
299  polyMap = PolyMap(forwardCoeffs, reverseCoeffs)
300  assert polyMap.nIn == nIn
301  assert polyMap.nOut == nOut
302  assert polyMap.hasForward
303  assert polyMap.hasInverse
304  return polyMap
305 
306 
def makeTwoWayPolyMap(nIn, nOut)
Definition: test.py:283
def makePolyMapCoeffs(nIn, nOut)
Definition: test.py:263