LSSTApplications
18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
|
Functions | |
def | makeGaussianNoiseMaskedImage (dimensions, sigma, variance=1.0) |
def | makeRampImage (bbox, start=0, stop=None, imageClass=ImageF) |
Make an image whose values are a linear ramp. More... | |
def | assertImagesAlmostEqual (testCase, image0, image1, skipMask=None, rtol=1.0e-05, atol=1e-08, msg="Images differ") |
Assert that two images are almost equal, including non-finite values. More... | |
def | assertImagesEqual (args, kwds) |
Assert that two images are exactly equal, including non-finite values. More... | |
def | assertMasksEqual (testCase, mask0, mask1, skipMask=None, msg="Masks differ") |
Assert that two masks are equal. More... | |
def | assertMaskedImagesAlmostEqual (testCase, maskedImage0, maskedImage1, doImage=True, doMask=True, doVariance=True, skipMask=None, rtol=1.0e-05, atol=1e-08, msg="Masked images differ") |
Assert that two masked images are nearly equal, including non-finite values. More... | |
def | assertMaskedImagesEqual (args, kwds) |
Assert that two masked images are exactly equal, including non-finite values. More... | |
def | imagesDiffer (image0, image1, skipMask=None, rtol=1.0e-05, atol=1e-08) |
Compare the pixels of two image or mask arrays; return True if close, False otherwise. More... | |
def lsst.afw.image.testUtils.assertImagesAlmostEqual | ( | testCase, | |
image0, | |||
image1, | |||
skipMask = None , |
|||
rtol = 1.0e-05 , |
|||
atol = 1e-08 , |
|||
msg = "Images differ" |
|||
) |
Assert that two images are almost equal, including non-finite values.
[in] | testCase | unittest.TestCase instance the test is part of; an object supporting one method: fail(self, msgStr) |
[in] | image0 | image 0, an lsst.afw.image.Image, lsst.afw.image.Mask, or transposed numpy array (see warning) |
[in] | image1 | image 1, an lsst.afw.image.Image, lsst.afw.image.Mask, or transposed numpy array (see warning) |
[in] | skipMask | mask of pixels to skip, or None to compare all pixels; an lsst.afw.image.Mask, lsst.afw.image.Image, or transposed numpy array (see warning); all non-zero pixels are skipped |
[in] | rtol | maximum allowed relative tolerance; more info below |
[in] | atol | maximum allowed absolute tolerance; more info below |
[in] | msg | exception message prefix; details of the error are appended after ": " |
The images are nearly equal if all pixels obey: |val1 - val0| <= rtol*|val1| + atol or, for float types, if nan/inf/-inf pixels match.
self.failureException | (usually AssertionError) if any of the following are true for un-skipped pixels:
|
TypeError | if the dimensions of image0, image1 and skipMask do not match, or any are not of a numeric data type. |
Definition at line 76 of file testUtils.py.
def lsst.afw.image.testUtils.assertImagesEqual | ( | args, | |
kwds | |||
) |
Assert that two images are exactly equal, including non-finite values.
All arguments are forwarded to assertAnglesAlmostEqual aside from atol and rtol, which are set to zero.
Definition at line 118 of file testUtils.py.
def lsst.afw.image.testUtils.assertMaskedImagesAlmostEqual | ( | testCase, | |
maskedImage0, | |||
maskedImage1, | |||
doImage = True , |
|||
doMask = True , |
|||
doVariance = True , |
|||
skipMask = None , |
|||
rtol = 1.0e-05 , |
|||
atol = 1e-08 , |
|||
msg = "Masked images differ" |
|||
) |
Assert that two masked images are nearly equal, including non-finite values.
[in] | testCase | unittest.TestCase instance the test is part of; an object supporting one method: fail(self, msgStr) |
[in] | maskedImage0 | masked image 0 (an lsst.afw.image.MaskedImage or collection of three transposed numpy arrays: image, mask, variance) |
[in] | maskedImage1 | masked image 1 (an lsst.afw.image.MaskedImage or collection of three transposed numpy arrays: image, mask, variance) |
[in] | doImage | compare image planes if True |
[in] | doMask | compare mask planes if True |
[in] | doVariance | compare variance planes if True |
[in] | skipMask | mask of pixels to skip, or None to compare all pixels; an lsst.afw.image.Mask, lsst.afw.image.Image, or transposed numpy array; all non-zero pixels are skipped |
[in] | rtol | maximum allowed relative tolerance; more info below |
[in] | atol | maximum allowed absolute tolerance; more info below |
[in] | msg | exception message prefix; details of the error are appended after ": " |
The mask planes must match exactly. The image and variance planes are nearly equal if all pixels obey: |val1 - val0| <= rtol*|val1| + atol or, for float types, if nan/inf/-inf pixels match.
self.failureException | (usually AssertionError) if any of the following are true for un-skipped pixels:
|
TypeError | if the dimensions of maskedImage0, maskedImage1 and skipMask do not match, either image or variance plane is not of a numeric data type, either mask plane is not of an integer type (unsigned or signed), or skipMask is not of a numeric data type. |
Definition at line 161 of file testUtils.py.
def lsst.afw.image.testUtils.assertMaskedImagesEqual | ( | args, | |
kwds | |||
) |
Assert that two masked images are exactly equal, including non-finite values.
All arguments are forwarded to assertMaskedImagesAlmostEqual aside from atol and rtol, which are set to zero.
Definition at line 246 of file testUtils.py.
def lsst.afw.image.testUtils.assertMasksEqual | ( | testCase, | |
mask0, | |||
mask1, | |||
skipMask = None , |
|||
msg = "Masks differ" |
|||
) |
Assert that two masks are equal.
[in] | testCase | unittest.TestCase instance the test is part of; an object supporting one method: fail(self, msgStr) |
[in] | mask0 | mask 0, an lsst.afw.image.Mask, lsst.afw.image.Image, or transposed numpy array (see warning) |
[in] | mask1 | mask 1, an lsst.afw.image.Mask, lsst.afw.image.Image, or transposed numpy array (see warning) |
[in] | skipMask | mask of pixels to skip, or None to compare all pixels; an lsst.afw.image.Mask, lsst.afw.image.Image, or transposed numpy array (see warning); all non-zero pixels are skipped |
[in] | msg | exception message prefix; details of the error are appended after ": " |
self.failureException | (usually AssertionError) if any any un-skipped pixels differ |
TypeError | if the dimensions of mask0, mask1 and skipMask do not match, or any are not of a numeric data type. |
Definition at line 128 of file testUtils.py.
def lsst.afw.image.testUtils.imagesDiffer | ( | image0, | |
image1, | |||
skipMask = None , |
|||
rtol = 1.0e-05 , |
|||
atol = 1e-08 |
|||
) |
Compare the pixels of two image or mask arrays; return True if close, False otherwise.
[in] | image0 | image 0, an lsst.afw.image.Image, lsst.afw.image.Mask, or transposed numpy array (see warning) |
[in] | image1 | image 1, an lsst.afw.image.Image, lsst.afw.image.Mask, or transposed numpy array (see warning) |
[in] | skipMask | mask of pixels to skip, or None to compare all pixels; an lsst.afw.image.Mask, lsst.afw.image.Image, or transposed numpy array (see warning); all non-zero pixels are skipped |
[in] | rtol | maximum allowed relative tolerance; more info below |
[in] | atol | maximum allowed absolute tolerance; more info below |
The images are nearly equal if all pixels obey: |val1 - val0| <= rtol*|val1| + atol or, for float types, if nan/inf/-inf pixels match.
TypeError | if the dimensions of image0, image1 and skipMask do not match, or any are not of a numeric data type. |
Definition at line 255 of file testUtils.py.
def lsst.afw.image.testUtils.makeGaussianNoiseMaskedImage | ( | dimensions, | |
sigma, | |||
variance = 1.0 |
|||
) |
Make a gaussian noise MaskedImageF Inputs: - dimensions: dimensions of output array (cols, rows) - sigma; sigma of image plane's noise distribution - variance: constant value for variance plane
Definition at line 35 of file testUtils.py.
def lsst.afw.image.testUtils.makeRampImage | ( | bbox, | |
start = 0 , |
|||
stop = None , |
|||
imageClass = ImageF |
|||
) |
Make an image whose values are a linear ramp.
[in] | bbox | bounding box of image (an lsst.geom.Box2I) |
[in] | start | starting ramp value, inclusive |
[in] | stop | ending ramp value, inclusive; if None, increase by integer values |
[in] | imageClass | type of image (e.g. lsst.afw.image.ImageF) |
Definition at line 52 of file testUtils.py.