lsst.afw  14.0-25-g0e8fc950e+6
Functions
lsst.afw.geom.utils Namespace Reference

Functions

def extraMsg (msg)
 
def 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. More...
 
def assertPairsAlmostEqual (testCase, pair0, pair1, maxDiff=1e-7, msg="Pairs differ")
 Assert that two Cartesian points are almost equal. More...
 
def assertPairListsAlmostEqual (testCase, list0, list1, maxDiff=1e-7, msg=None)
 Assert that two lists of Cartesian points are almost equal. More...
 
def assertSpherePointsAlmostEqual (testCase, sp0, sp1, maxSep=0.001 *arcseconds, msg="")
 Assert that two SpherePoints are almost equal. More...
 
def assertSpherePointListsAlmostEqual (testCase, splist0, splist1, maxSep=0.001 *arcseconds, msg=None)
 Assert that two lists of SpherePoints are almost equal. More...
 
def assertBoxesAlmostEqual (testCase, box0, box1, maxDiff=1e-7, msg="Boxes differ")
 Assert that two boxes (Box2D or Box2I) are almost equal. More...
 
def makeEndpoints (testCase)
 
def assertAnglesNearlyEqual (args, kwargs)
 
def assertPairsNearlyEqual (args, kwargs)
 
def assertBoxesNearlyEqual (args, kwargs)
 

Function Documentation

◆ assertAnglesAlmostEqual()

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.

◆ assertAnglesNearlyEqual()

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

Definition at line 215 of file utils.py.

◆ assertBoxesAlmostEqual()

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.

◆ assertBoxesNearlyEqual()

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

Definition at line 228 of file utils.py.

◆ assertPairListsAlmostEqual()

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.

◆ assertPairsAlmostEqual()

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.

◆ assertPairsNearlyEqual()

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

Definition at line 222 of file utils.py.

◆ assertSpherePointListsAlmostEqual()

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.

◆ assertSpherePointsAlmostEqual()

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.

◆ extraMsg()

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

Definition at line 44 of file utils.py.

◆ makeEndpoints()

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.