LSST Applications g044012fb7c+6976b5ec80,g04a91732dc+88a5fc122b,g07dc498a13+7e3c5f68a2,g114c6a66ad+09472d7a76,g1409bbee79+7e3c5f68a2,g1a7e361dbc+7e3c5f68a2,g1fd858c14a+3a43eabc0e,g35bb328faa+fcb1d3bbc8,g3bd4b5ce2c+2647bb081c,g4e0f332c67+5d362be553,g53246c7159+fcb1d3bbc8,g5477a8d5ce+b19c77c7ae,g58d0cdf3ff+4a2e102ff8,g60b5630c4e+09472d7a76,g623d845a50+09472d7a76,g6f0c2978f1+fcf1c0bcd6,g71fabbc107+09472d7a76,g75b6c65c88+d0b1dc44cc,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g8852436030+349c7e81d4,g89139ef638+7e3c5f68a2,g9125e01d80+fcb1d3bbc8,g95236ca021+f7a31438ed,g989de1cb63+7e3c5f68a2,g9f33ca652e+f17d666fbc,gaaedd4e678+7e3c5f68a2,gabe3b4be73+1e0a283bba,gb1101e3267+f870f33517,gb58c049af0+f03b321e39,gc99c83e5f0+76d20ab76d,gcf25f946ba+349c7e81d4,gd0fa69b896+f3a65fa83c,gd6cbbdb0b4+c8606af20c,gde0f65d7ad+5bd27d919f,ge278dab8ac+932305ba37,gfba249425e+fcb1d3bbc8,w.2025.07
LSST Data Management Base Package
Loading...
Searching...
No Matches
lsst.meas.base.catalogCalculation.CCContext Class Reference

Public Member Functions

 __init__ (self, plugin, cat, log)
 
 __enter__ (self)
 
 __exit__ (self, exc_type, exc_value, traceback)
 

Public Attributes

 plugin = plugin
 
 cat = cat
 
 log = log
 

Detailed Description

Handle errors that are thrown by catalog calculation plugins.

This is a context manager.

Parameters
----------
plugin : `CatalogCalculationPlugin`
    The plugin that is to be run.
cat : `lsst.afw.table.SourceCatalog` or `lsst.afw.table.SourceRecord`
    May either be a `~lsst.afw.table.SourceCatalog` or a single
    `~lsst.afw.table.SourceRecord`, depending on the plugin type.
log : `lsst.log.Log` or `logging.Logger`
    A logger. Generally, this should be the logger of the object in which
    the context manager is being used.

Definition at line 120 of file catalogCalculation.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.meas.base.catalogCalculation.CCContext.__init__ ( self,
plugin,
cat,
log )

Definition at line 136 of file catalogCalculation.py.

136 def __init__(self, plugin, cat, log):
137 self.plugin = plugin
138 self.cat = cat
139 self.log = log
140

Member Function Documentation

◆ __enter__()

lsst.meas.base.catalogCalculation.CCContext.__enter__ ( self)

Definition at line 141 of file catalogCalculation.py.

141 def __enter__(self):
142 return
143

◆ __exit__()

lsst.meas.base.catalogCalculation.CCContext.__exit__ ( self,
exc_type,
exc_value,
traceback )

Definition at line 144 of file catalogCalculation.py.

144 def __exit__(self, exc_type, exc_value, traceback):
145 if exc_type is None:
146 return True
147 if exc_type in FATAL_EXCEPTIONS:
148 return False
149 elif exc_type is MeasurementError:
150 self.plugin.fail(self.cat, exc_value)
151 elif issubclass(exc_type, Exception):
152 self.log.warning("Error in %s.calculate: %s", self.plugin.name, exc_value)
153 else:
154 # In general, BaseExceptions are unrelated to the code and should not be caught
155 return False
156 return True
157
158

Member Data Documentation

◆ cat

lsst.meas.base.catalogCalculation.CCContext.cat = cat

Definition at line 138 of file catalogCalculation.py.

◆ log

lsst.meas.base.catalogCalculation.CCContext.log = log

Definition at line 139 of file catalogCalculation.py.

◆ plugin

lsst.meas.base.catalogCalculation.CCContext.plugin = plugin

Definition at line 137 of file catalogCalculation.py.


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