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
lsst.afw.cameraGeom.testUtils Namespace Reference

Classes

class  DetectorWrapper
 
class  CameraWrapper
 

Functions

def compare2DFunctions (self, func1, func2, minVal=-10, maxVal=None, nVal=5)
 
def assertTransformMapsEqual (self, map1, map2, **kwds)
 
def assertAmplifiersEqual (self, amp1, amp2)
 
def assertDetectorsEqual (self, detector1, detector2, *compareTransforms=True, **kwds)
 
def assertDetectorCollectionsEqual (self, collection1, collection2, **kwds)
 
def assertCamerasEqual (self, camera1, camera2, **kwds)
 

Function Documentation

◆ assertAmplifiersEqual()

def lsst.afw.cameraGeom.testUtils.assertAmplifiersEqual (   self,
  amp1,
  amp2 
)

Definition at line 452 of file testUtils.py.

452 def assertAmplifiersEqual(self, amp1, amp2):
453  self.assertEqual(amp1.getName(), amp2.getName())
454  self.assertEqual(amp1.getBBox(), amp2.getBBox())
455  self.assertFloatsEqual(amp1.getGain(), amp2.getGain(), ignoreNaNs=True)
456  self.assertFloatsEqual(amp1.getReadNoise(), amp2.getReadNoise(), ignoreNaNs=True)
457  self.assertFloatsEqual(amp1.getSaturation(), amp2.getSaturation(), ignoreNaNs=True)
458  self.assertEqual(amp1.getReadoutCorner(), amp2.getReadoutCorner())
459  self.assertFloatsEqual(amp1.getSuspectLevel(), amp2.getSuspectLevel(), ignoreNaNs=True)
460  self.assertEqual(amp1.getLinearityCoeffs().shape, amp2.getLinearityCoeffs().shape)
461  self.assertFloatsEqual(amp1.getLinearityCoeffs(), amp2.getLinearityCoeffs(), ignoreNaNs=True)
462  self.assertEqual(amp1.getLinearityType(), amp2.getLinearityType())
463  self.assertFloatsEqual(amp1.getLinearityThreshold(), amp2.getLinearityThreshold(), ignoreNaNs=True)
464  self.assertFloatsEqual(amp1.getLinearityMaximum(), amp2.getLinearityMaximum(), ignoreNaNs=True)
465  self.assertEqual(amp1.getLinearityUnits(), amp2.getLinearityUnits())
466  self.assertEqual(amp1.getRawBBox(), amp2.getRawBBox())
467  self.assertEqual(amp1.getRawDataBBox(), amp2.getRawDataBBox())
468  self.assertEqual(amp1.getRawFlipX(), amp2.getRawFlipX())
469  self.assertEqual(amp1.getRawFlipY(), amp2.getRawFlipY())
470  self.assertEqual(amp1.getRawHorizontalOverscanBBox(), amp2.getRawHorizontalOverscanBBox())
471  self.assertEqual(amp1.getRawVerticalOverscanBBox(), amp2.getRawVerticalOverscanBBox())
472  self.assertEqual(amp1.getRawPrescanBBox(), amp2.getRawPrescanBBox())
473 
474 
475 @inTestCase
def assertAmplifiersEqual(self, amp1, amp2)
Definition: testUtils.py:452

◆ assertCamerasEqual()

def lsst.afw.cameraGeom.testUtils.assertCamerasEqual (   self,
  camera1,
  camera2,
**  kwds 
)
Compare two Camers.

Definition at line 510 of file testUtils.py.

510 def assertCamerasEqual(self, camera1, camera2, **kwds):
511  """Compare two Camers.
512  """
513  self.assertDetectorCollectionsEqual(camera1, camera2, **kwds)
514  self.assertTransformMapsEqual(camera1.getTransformMap(), camera2.getTransformMap())
515  self.assertEqual(camera1.getName(), camera2.getName())
516  self.assertEqual(camera1.getPupilFactoryName(), camera2.getPupilFactoryName())
def assertCamerasEqual(self, camera1, camera2, **kwds)
Definition: testUtils.py:510

◆ assertDetectorCollectionsEqual()

def lsst.afw.cameraGeom.testUtils.assertDetectorCollectionsEqual (   self,
  collection1,
  collection2,
**  kwds 
)
Compare two DetectorCollections.

Definition at line 501 of file testUtils.py.

501 def assertDetectorCollectionsEqual(self, collection1, collection2, **kwds):
502  """Compare two DetectorCollections.
503  """
504  self.assertCountEqual(list(collection1.getNameIter()), list(collection2.getNameIter()))
505  for k in collection1.getNameIter():
506  self.assertDetectorsEqual(collection1[k], collection2[k], **kwds)
507 
508 
509 @inTestCase
daf::base::PropertyList * list
Definition: fits.cc:913
def assertDetectorCollectionsEqual(self, collection1, collection2, **kwds)
Definition: testUtils.py:501

◆ assertDetectorsEqual()

def lsst.afw.cameraGeom.testUtils.assertDetectorsEqual (   self,
  detector1,
  detector2,
compareTransforms = True,
**  kwds 
)
Compare two Detectors.

Definition at line 476 of file testUtils.py.

476 def assertDetectorsEqual(self, detector1, detector2, *, compareTransforms=True, **kwds):
477  """Compare two Detectors.
478  """
479  self.assertEqual(detector1.getName(), detector2.getName())
480  self.assertEqual(detector1.getId(), detector2.getId())
481  self.assertEqual(detector1.getSerial(), detector2.getSerial())
482  self.assertEqual(detector1.getPhysicalType(), detector2.getPhysicalType())
483  self.assertEqual(detector1.getBBox(), detector2.getBBox())
484  self.assertEqual(detector1.getPixelSize(), detector2.getPixelSize())
485  orientationIn = detector1.getOrientation()
486  orientationOut = detector2.getOrientation()
487  self.assertEqual(orientationIn.getFpPosition(), orientationOut.getFpPosition())
488  self.assertEqual(orientationIn.getReferencePoint(), orientationOut.getReferencePoint())
489  self.assertEqual(orientationIn.getYaw(), orientationOut.getYaw())
490  self.assertEqual(orientationIn.getPitch(), orientationOut.getPitch())
491  self.assertEqual(orientationIn.getRoll(), orientationOut.getRoll())
492  self.assertFloatsEqual(detector1.getCrosstalk(), detector2.getCrosstalk())
493  if compareTransforms:
494  self.assertTransformMapsEqual(detector1.getTransformMap(), detector2.getTransformMap(), **kwds)
495  self.assertEqual(len(detector1.getAmplifiers()), len(detector2.getAmplifiers()))
496  for amp1, amp2 in zip(detector1.getAmplifiers(), detector2.getAmplifiers()):
497  self.assertAmplifiersEqual(amp1, amp2)
498 
499 
500 @inTestCase
def assertDetectorsEqual(self, detector1, detector2, *compareTransforms=True, **kwds)
Definition: testUtils.py:476

◆ assertTransformMapsEqual()

def lsst.afw.cameraGeom.testUtils.assertTransformMapsEqual (   self,
  map1,
  map2,
**  kwds 
)
Compare two TransformMaps.

Definition at line 438 of file testUtils.py.

438 def assertTransformMapsEqual(self, map1, map2, **kwds):
439  """Compare two TransformMaps.
440  """
441  self.assertEqual(list(map1), list(map2)) # compares the sets of CameraSys
442  for sysFrom in map1:
443  for sysTo in map1:
444  with self.subTest(sysFrom=sysFrom, sysTo=sysTo):
445  transform1 = map1.getTransform(sysFrom, sysTo)
446  transform2 = map2.getTransform(sysFrom, sysTo)
447  self.compare2DFunctions(transform1.applyForward, transform2.applyForward, **kwds)
448  self.compare2DFunctions(transform1.applyInverse, transform2.applyInverse, **kwds)
449 
450 
451 @inTestCase
def assertTransformMapsEqual(self, map1, map2, **kwds)
Definition: testUtils.py:438

◆ compare2DFunctions()

def lsst.afw.cameraGeom.testUtils.compare2DFunctions (   self,
  func1,
  func2,
  minVal = -10,
  maxVal = None,
  nVal = 5 
)
Compare two Point2D(Point2D) functions by evaluating them over a
range of values.

Definition at line 420 of file testUtils.py.

420 def compare2DFunctions(self, func1, func2, minVal=-10, maxVal=None, nVal=5):
421  """Compare two Point2D(Point2D) functions by evaluating them over a
422  range of values.
423  """
424  if maxVal is None:
425  maxVal = -minVal
426  dVal = (maxVal - minVal) / (nVal - 1)
427  for xInd in range(nVal):
428  x = minVal + (xInd * dVal)
429  for yInd in range(nVal):
430  y = minVal + (yInd * dVal)
431  fromPoint = lsst.geom.Point2D(x, y)
432  res1 = func1(fromPoint)
433  res2 = func2(fromPoint)
434  self.assertPairsAlmostEqual(res1, res2)
435 
436 
437 @inTestCase
def compare2DFunctions(self, func1, func2, minVal=-10, maxVal=None, nVal=5)
Definition: testUtils.py:420