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
Public Member Functions | Private Attributes | List of all members
lsst.afw.image.utils.CalibNoThrow Class Reference
Inheritance diagram for lsst.afw.image.utils.CalibNoThrow:

Public Member Functions

def __enter__
 
def __exit__
 

Private Attributes

 _throwOnNegative
 

Detailed Description

A class intended to be used with python's with statement, to return NaNs for negative fluxes
instead of raising exceptions (exceptions may be raised for other purposes).

E.g.
 with CalibNoThrow():
     ax.plot([exposure.getCalib().getMagnitude(a) for a in candAmps], zGood[:,k], 'b+')

Definition at line 116 of file utils.py.

Member Function Documentation

def lsst.afw.image.utils.CalibNoThrow.__enter__ (   self)

Definition at line 124 of file utils.py.

125  def __enter__(self):
126  self._throwOnNegative = afwImage.Calib.getThrowOnNegativeFlux()
127  afwImage.Calib.setThrowOnNegativeFlux(False)
def lsst.afw.image.utils.CalibNoThrow.__exit__ (   self,
  args 
)

Definition at line 128 of file utils.py.

129  def __exit__(self, *args):
130  afwImage.Calib.setThrowOnNegativeFlux(self._throwOnNegative)

Member Data Documentation

lsst.afw.image.utils.CalibNoThrow._throwOnNegative
private

Definition at line 125 of file utils.py.


The documentation for this class was generated from the following file: