24 __all__ = (
"CModelStageConfig", 
"CModelConfig")
 
   26 from .cmodel 
import CModelStageControl, CModelControl, CModelAlgorithm
 
   28 from lsst.pex.config 
import makeConfigClass
 
   35 apCorrList = (
"modelfit_CModel", 
"modelfit_CModel_initial", 
"modelfit_CModel_exp", 
"modelfit_CModel_dev")
 
   41         lsst.meas.base.SingleFramePluginConfig.setDefaults(self)
 
   42         CModelConfig.setDefaults(self)
 
   45 @lsst.meas.base.register(
"modelfit_CModel", apCorrList=apCorrList)
 
   47     """Single-frame measurement interface for CModelAlgorithm. 
   49     This class simply provides __init__ and measure methods that matched the SingleFramePlugin signatures 
   50     and delegate to the CModelAlgorithm's methods. 
   52     ConfigClass = CModelSingleFrameConfig
 
   58     def __init__(self, config, name, schema, metadata):
 
   59         lsst.meas.base.SingleFramePlugin.__init__(self, config, name, schema, metadata)
 
   60         self.
algorithm = CModelAlgorithm(name, config.makeControl(), schema)
 
   65     def fail(self, measRecord, error=None):
 
   66         self.
algorithm.
fail(measRecord, error.cpp 
if error 
is not None else None)
 
   72         lsst.meas.base.ForcedPluginConfig.setDefaults(self)
 
   73         CModelConfig.setDefaults(self)
 
   76 @lsst.meas.base.register(
"modelfit_CModel", apCorrList=apCorrList)
 
   78     """Forced measurement interface for CModelAlgorithm 
   80     This class simply provides __init__ and measure methods that matched the ForcedPlugin signatures 
   81     and delegate to CModelAlgorithm implementations. 
   83     The CModel algorithm currently cannot be run in forced mode when the measurement WCS is different 
   84     from the reference WCS (as is the case in CCD forced photometry).  This is a temporary limitation 
   85     that will be addressed on DM-5405. 
   87     CModel forced measurement when the measurement image is the same as the reference image should be 
   88     almost -- but not quite -- identical to unforced measurement.  The primary difference is that 
   89     the final fit region from the reference measurement will be used for the initial fit in forced mode 
   90     as well as the exp, dev, and combined exp+dev fits 
   92     ConfigClass = CModelForcedConfig
 
   98     def __init__(self, config, name, schemaMapper, metadata):
 
   99         lsst.meas.base.ForcedPlugin.__init__(self, config, name, schemaMapper, metadata)
 
  100         self.
algorithm = CModelAlgorithm(name, config.makeControl(), schemaMapper)
 
  102     def measure(self, measRecord, exposure, refRecord, refWcs):
 
  103         if refWcs != exposure.getWcs():
 
  105                 "CModel forced measurement currently requires the measurement image to have the same" 
  106                 " Wcs as the reference catalog (this is a temporary limitation)." 
  110     def fail(self, measRecord, error=None):
 
  111         self.
algorithm.
fail(measRecord, error.cpp 
if error 
is not None else None)