lsst.afw g9c22b2923f+53520f316c
Loading...
Searching...
No Matches
Functions
lsst.afw.geom.utils Namespace Reference

Functions

 _compareWcsOverBBox (wcs0, wcs1, bbox, maxDiffSky=0.01 *lsst.geom.arcseconds, maxDiffPix=0.01, nx=5, ny=5, doShortCircuit=True)
 
 wcsAlmostEqualOverBBox (wcs0, wcs1, bbox, maxDiffSky=0.01 *lsst.geom.arcseconds, maxDiffPix=0.01, nx=5, ny=5)
 
 assertWcsAlmostEqualOverBBox (testCase, wcs0, wcs1, bbox, maxDiffSky=0.01 *lsst.geom.arcseconds, maxDiffPix=0.01, nx=5, ny=5, msg="WCSs differ")
 
 makeEndpoints (testCase)
 

Detailed Description

Utilities that should be imported into the lsst.afw.geom namespace when lsst.afw.geom is used

In the case of the assert functions, importing them makes them available in lsst.utils.tests.TestCase

Function Documentation

◆ _compareWcsOverBBox()

lsst.afw.geom.utils._compareWcsOverBBox ( wcs0,
wcs1,
bbox,
maxDiffSky = 0.01*lsst.geom.arcseconds,
maxDiffPix = 0.01,
nx = 5,
ny = 5,
doShortCircuit = True )
protected
Compare two :py:class:`WCS <lsst.afw.geom.SkyWcs>` over a rectangular grid of pixel positions

Parameters
----------
wcs0 : `lsst.afw.geom.SkyWcs`
    WCS 0
wcs1 : `lsst.afw.geom.SkyWcs`
    WCS 1
bbox : `lsst.geom.Box2I` or `lsst.geom.Box2D`
    boundaries of pixel grid over which to compare the WCSs
maxDiffSky : `lsst.geom.Angle`
    maximum separation between sky positions computed using Wcs.pixelToSky
maxDiffPix : `float`
    maximum separation between pixel positions computed using Wcs.skyToPixel
nx : `int`
    number of points in x for the grid of pixel positions
ny : `int`
    number of points in y for the grid of pixel positions
doShortCircuit : `bool`
    if True then stop at the first error, else test all values in the grid
    and return information about the worst violations found

Returns
-------
msg : `str`
    an empty string if the WCS are sufficiently close; else return a string describing
    the largest error measured in pixel coordinates (if sky to pixel error was excessive)
    and sky coordinates (if pixel to sky error was excessive). If doShortCircuit is true
    then the reported error is likely to be much less than the maximum error across the
    whole pixel grid.

Definition at line 38 of file utils.py.

◆ assertWcsAlmostEqualOverBBox()

lsst.afw.geom.utils.assertWcsAlmostEqualOverBBox ( testCase,
wcs0,
wcs1,
bbox,
maxDiffSky = 0.01*lsst.geom.arcseconds,
maxDiffPix = 0.01,
nx = 5,
ny = 5,
msg = "WCSs differ" )
Assert that two :py:class:`WCS <lsst.afw.geom.SkyWcs>` are almost equal over a grid of pixel positions

Compare pixelToSky and skyToPixel for two WCS over a rectangular grid of pixel positions.
If the WCS are too divergent at any point, call testCase.fail; the message describes
the largest error measured in pixel coordinates (if sky to pixel error was excessive)
and sky coordinates (if pixel to sky error was excessive) across the entire pixel grid.

Parameters
----------
testCase : `unittest.TestCase`
    test case the test is part of; an object supporting one method: fail(self, msgStr)
wcs0 : `lsst.afw.geom.SkyWcs`
    WCS 0
wcs1 : `lsst.afw.geom.SkyWcs`
    WCS 1
bbox : `lsst.geom.Box2I` or `lsst.geom.Box2D`
    boundaries of pixel grid over which to compare the WCSs
maxDiffSky : `lsst.geom.Angle`
    maximum separation between sky positions computed using Wcs.pixelToSky
maxDiffPix : `float`
    maximum separation between pixel positions computed using Wcs.skyToPixel
nx : `int`
    number of points in x for the grid of pixel positions
ny : `int`
    number of points in y for the grid of pixel positions
msg : `str`
    exception message prefix; details of the error are appended after ": "

Definition at line 155 of file utils.py.

◆ makeEndpoints()

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

Parameters
----------
testCase : `unittest.TestCase`
    test case the test is part of; an object supporting one method: fail(self, msgStr)

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

Definition at line 200 of file utils.py.

◆ wcsAlmostEqualOverBBox()

lsst.afw.geom.utils.wcsAlmostEqualOverBBox ( wcs0,
wcs1,
bbox,
maxDiffSky = 0.01*lsst.geom.arcseconds,
maxDiffPix = 0.01,
nx = 5,
ny = 5 )
Test if two :py:class:`WCS <lsst.afw.geom.SkyWcs>` are almost equal over a grid of pixel positions.

Parameters
----------
wcs0 : `lsst.afw.geom.SkyWcs`
    WCS 0
wcs1 : `lsst.afw.geom.SkyWcs`
    WCS 1
bbox : `lsst.geom.Box2I` or `lsst.geom.Box2D`
    boundaries of pixel grid over which to compare the WCSs
maxDiffSky : `lsst.geom.Angle`
    maximum separation between sky positions computed using Wcs.pixelToSky
maxDiffPix : `float`
    maximum separation between pixel positions computed using Wcs.skyToPixel
nx : `int`
    number of points in x for the grid of pixel positions
ny : `int`
    number of points in y for the grid of pixel positions

Returns
-------
almostEqual: `bool`
    `True` if two WCS are almost equal over a grid of pixel positions, else `False`

Definition at line 116 of file utils.py.