LSST Applications g0b6bd0c080+a72a5dd7e6,g1182afd7b4+2a019aa3bb,g17e5ecfddb+2b8207f7de,g1d67935e3f+06cf436103,g38293774b4+ac198e9f13,g396055baef+6a2097e274,g3b44f30a73+6611e0205b,g480783c3b1+98f8679e14,g48ccf36440+89c08d0516,g4b93dc025c+98f8679e14,g5c4744a4d9+a302e8c7f0,g613e996a0d+e1c447f2e0,g6c8d09e9e7+25247a063c,g7271f0639c+98f8679e14,g7a9cd813b8+124095ede6,g9d27549199+a302e8c7f0,ga1cf026fa3+ac198e9f13,ga32aa97882+7403ac30ac,ga786bb30fb+7a139211af,gaa63f70f4e+9994eb9896,gabf319e997+ade567573c,gba47b54d5d+94dc90c3ea,gbec6a3398f+06cf436103,gc6308e37c7+07dd123edb,gc655b1545f+ade567573c,gcc9029db3c+ab229f5caf,gd01420fc67+06cf436103,gd877ba84e5+06cf436103,gdb4cecd868+6f279b5b48,ge2d134c3d5+cc4dbb2e3f,ge448b5faa6+86d1ceac1d,gecc7e12556+98f8679e14,gf3ee170dca+25247a063c,gf4ac96e456+ade567573c,gf9f5ea5b4d+ac198e9f13,gff490e6085+8c2580be5c,w.2022.27
LSST Data Management Base Package
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 313 of file test.py.

313def 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.

266def 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.

287def 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