LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
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: