LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Functions | Variables
lsst.afw.coord.utils Namespace Reference

Functions

def assertCoordsNearlyEqual
 Assert that two coords represent nearly the same point on the sky. More...
 

Variables

list __all__ = ["assertCoordsNearlyEqual"]
 

Function Documentation

def lsst.afw.coord.utils.assertCoordsNearlyEqual (   testCase,
  coord0,
  coord1,
  maxDiff = 0.001*afwGeom.arcseconds,
  msg = "Coords differ" 
)

Assert that two coords represent nearly the same point on the sky.

Warning
the coordinate systems are not compared; instead both angles are converted to ICRS and the angular separation measured.
Parameters
[in]testCaseunittest.TestCase instance the test is part of; an object supporting one method: fail(self, msgStr)
[in]coord0coord 0 (an lsst.afw.geom.Coord)
[in]coord1coord 1 (an lsst.afw.geom.Coord)
[in]maxDiffmaximum angular separation between the two coords (an lsst.afw.geom.Angle)
[in]msgexception message prefix; details of the error are appended after ": "
Exceptions
AssertionErrorif the unwrapped difference is greater than maxDiff

Definition at line 33 of file utils.py.

33 
34 def assertCoordsNearlyEqual(testCase, coord0, coord1, maxDiff=0.001*afwGeom.arcseconds, msg="Coords differ"):
35  """!Assert that two coords represent nearly the same point on the sky
36 
37  @warning the coordinate systems are not compared; instead both angles are converted to ICRS
38  and the angular separation measured.
39 
40  @param[in] testCase unittest.TestCase instance the test is part of;
41  an object supporting one method: fail(self, msgStr)
42  @param[in] coord0 coord 0 (an lsst.afw.geom.Coord)
43  @param[in] coord1 coord 1 (an lsst.afw.geom.Coord)
44  @param[in] maxDiff maximum angular separation between the two coords (an lsst.afw.geom.Angle)
45  @param[in] msg exception message prefix; details of the error are appended after ": "
46 
47  @throw AssertionError if the unwrapped difference is greater than maxDiff
48  """
49  measDiff = coord0.toIcrs().angularSeparation(coord1.toIcrs())
50  if measDiff > maxDiff:
51  testCase.fail("%s: measured angular separation %s arcsec > max allowed %s arcsec" %
52  (msg, measDiff.asArcseconds(), maxDiff.asArcseconds()))
def assertCoordsNearlyEqual
Assert that two coords represent nearly the same point on the sky.
Definition: utils.py:33

Variable Documentation

list lsst.afw.coord.utils.__all__ = ["assertCoordsNearlyEqual"]

Definition at line 30 of file utils.py.