LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Classes | Functions
astshim.test Namespace Reference

Classes

class  ObjectTestCase
 
class  MappingTestCase
 

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 313 of file test.py.

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

◆ 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 266 of file test.py.

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

◆ 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 287 of file test.py.

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