LSST Applications  21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
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