lsst.afw  13.0-98-g5a654715e+2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
lsst.afw.geom.utils Namespace Reference

Functions

def extraMsg
 
def assertAnglesAlmostEqual
 Assert that two angles are almost equal, ignoring wrap differences by default. More...
 
def assertPairsAlmostEqual
 Assert that two Cartesian points are almost equal. More...
 
def assertPairListsAlmostEqual
 Assert that two lists of Cartesian points are almost equal. More...
 
def assertSpherePointsAlmostEqual
 Assert that two SpherePoints are almost equal. More...
 
def assertSpherePointListsAlmostEqual
 Assert that two lists of SpherePoints are almost equal. More...
 
def assertBoxesAlmostEqual
 Assert that two boxes (Box2D or Box2I) are almost equal. More...
 
def makeEndpoints
 
def assertAnglesNearlyEqual
 
def assertPairsNearlyEqual
 
def assertBoxesNearlyEqual
 

Variables

list __all__
 

Function Documentation

def lsst.afw.geom.utils.assertAnglesAlmostEqual (   testCase,
  ang0,
  ang1,
  maxDiff = 0.001*arcseconds,
  ignoreWrap = True,
  msg = "Angles differ" 
)

Assert that two angles are almost equal, ignoring wrap differences by default.

Parameters
[in]testCaseunittest.TestCase instance the test is part of; an object supporting one method: fail(self, msgStr)
[in]ang0angle 0 (an lsst.afw.geom.Angle)
[in]ang1angle 1 (an lsst.afw.geom.Angle)
[in]maxDiffmaximum difference between the two angles (an lsst.afw.geom.Angle)
[in]ignoreWrapignore wrap when comparing the angles?
  • if True then wrap is ignored, e.g. 0 and 360 degrees are considered equal
  • if False then wrap matters, e.g. 0 and 360 degrees are considered different
[in]msgexception message prefix; details of the error are appended after ": "
Exceptions
AssertionErrorif the difference is greater than maxDiff

Definition at line 54 of file utils.py.

def lsst.afw.geom.utils.assertAnglesNearlyEqual (   args,
  kwargs 
)

Definition at line 215 of file utils.py.

def lsst.afw.geom.utils.assertBoxesAlmostEqual (   testCase,
  box0,
  box1,
  maxDiff = 1e-7,
  msg = "Boxes differ" 
)

Assert that two boxes (Box2D or Box2I) are almost equal.

Warning
Does not compare types, just compares values.
Parameters
[in]testCaseunittest.TestCase instance the test is part of; an object supporting one method: fail(self, msgStr)
[in]box0box 0
[in]box1box 1
[in]maxDiffmaximum radial separation between the min points and max points
[in]msgexception message prefix; details of the error are appended after ": "
Exceptions
AssertionErrorif the radial difference of the min points or max points is greater than maxDiff

Definition at line 180 of file utils.py.

def lsst.afw.geom.utils.assertBoxesNearlyEqual (   args,
  kwargs 
)

Definition at line 228 of file utils.py.

def lsst.afw.geom.utils.assertPairListsAlmostEqual (   testCase,
  list0,
  list1,
  maxDiff = 1e-7,
  msg = None 
)

Assert that two lists of Cartesian points are almost equal.

Each point can be any indexable pair of two floats, including Point2D or Extent2D, a list or a tuple.

Warning
Does not compare types, just values.
Parameters
[in]testCaseunittest.TestCase instance the test is part of; an object supporting one method: fail(self, msgStr)
[in]list0list of pairs 0 (each element a pair of floats)
[in]list1list of pairs 1
[in]maxDiffmaximum radial separation between the two points
[in]msgadditional information for the error message; appended after ": "
Exceptions
AssertionErrorif the radial difference is greater than maxDiff

Definition at line 108 of file utils.py.

def lsst.afw.geom.utils.assertPairsAlmostEqual (   testCase,
  pair0,
  pair1,
  maxDiff = 1e-7,
  msg = "Pairs differ" 
)

Assert that two Cartesian points are almost equal.

Each point can be any indexable pair of two floats, including Point2D or Extent2D, a list or a tuple.

Warning
Does not compare types, just compares values.
Parameters
[in]testCaseunittest.TestCase instance the test is part of; an object supporting one method: fail(self, msgStr)
[in]pair0pair 0 (a pair of floats)
[in]pair1pair 1 (a pair of floats)
[in]maxDiffmaximum radial separation between the two points
[in]msgexception message prefix; details of the error are appended after ": "
Exceptions
AssertionErrorif the radial difference is greater than maxDiff

Definition at line 78 of file utils.py.

def lsst.afw.geom.utils.assertPairsNearlyEqual (   args,
  kwargs 
)

Definition at line 222 of file utils.py.

def lsst.afw.geom.utils.assertSpherePointListsAlmostEqual (   testCase,
  splist0,
  splist1,
  maxSep = 0.001*arcseconds,
  msg = None 
)

Assert that two lists of SpherePoints are almost equal.

Parameters
[in]testCaseunittest.TestCase instance the test is part of; an object supporting one method: fail(self, msgStr)
[in]splist0list of SpherePoints 0
[in]splist1list of SpherePoints 1
[in]maxSepmaximum separation, an lsst.afw.geom.Angle
[in]msgexception message prefix; details of the error are appended after ": "

Definition at line 158 of file utils.py.

def lsst.afw.geom.utils.assertSpherePointsAlmostEqual (   testCase,
  sp0,
  sp1,
  maxSep = 0.001*arcseconds,
  msg = "" 
)

Assert that two SpherePoints are almost equal.

Parameters
[in]testCaseunittest.TestCase instance the test is part of; an object supporting one method: fail(self, msgStr)
[in]sp0SpherePoint 0
[in]sp1SpherePoint 1
[in]maxSepmaximum separation, an lsst.afw.geom.Angle
[in]msgextra information to be printed with any error message

Definition at line 142 of file utils.py.

def lsst.afw.geom.utils.extraMsg (   msg)
Format extra error message, if any

Definition at line 44 of file utils.py.

def lsst.afw.geom.utils.makeEndpoints (   testCase)
Generate a representative sample of Endpoints.

Returns
-------
x : `list`
    List of endpoints with enough diversity to exercise Endpoint-related
    code. Each invocation of this method shall return independent objects.

Definition at line 201 of file utils.py.

Variable Documentation

list lsst.afw.geom.utils.__all__
Initial value:
1 = ["assertAnglesAlmostEqual", "assertPairsAlmostEqual",
2  "assertPairListsAlmostEqual", "assertSpherePointsAlmostEqual",
3  "assertSpherePointListsAlmostEqual", "assertBoxesAlmostEqual",
4  "makeEndpoints", "assertAnglesNearlyEqual", "assertPairsNearlyEqual",
5  "assertBoxesNearlyEqual"]

Definition at line 27 of file utils.py.