LSSTApplications  16.0-10-g0ee56ad+5,16.0-11-ga33d1f2+5,16.0-12-g3ef5c14+3,16.0-12-g71e5ef5+18,16.0-12-gbdf3636+3,16.0-13-g118c103+3,16.0-13-g8f68b0a+3,16.0-15-gbf5c1cb+4,16.0-16-gfd17674+3,16.0-17-g7c01f5c+3,16.0-18-g0a50484+1,16.0-20-ga20f992+8,16.0-21-g0e05fd4+6,16.0-21-g15e2d33+4,16.0-22-g62d8060+4,16.0-22-g847a80f+4,16.0-25-gf00d9b8+1,16.0-28-g3990c221+4,16.0-3-gf928089+3,16.0-32-g88a4f23+5,16.0-34-gd7987ad+3,16.0-37-gc7333cb+2,16.0-4-g10fc685+2,16.0-4-g18f3627+26,16.0-4-g5f3a788+26,16.0-5-gaf5c3d7+4,16.0-5-gcc1f4bb+1,16.0-6-g3b92700+4,16.0-6-g4412fcd+3,16.0-6-g7235603+4,16.0-69-g2562ce1b+2,16.0-8-g14ebd58+4,16.0-8-g2df868b+1,16.0-8-g4cec79c+6,16.0-8-gadf6c7a+1,16.0-8-gfc7ad86,16.0-82-g59ec2a54a+1,16.0-9-g5400cdc+2,16.0-9-ge6233d7+5,master-g2880f2d8cf+3,v17.0.rc1
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