LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
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.