LSSTApplications  19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
LSSTDataManagementBasePackage
cmodelContinued.py
Go to the documentation of this file.
1 #
2 # LSST Data Management System
3 # Copyright 2008-2017 LSST/AURA.
4 #
5 # This product includes software developed by the
6 # LSST Project (http://www.lsst.org/).
7 #
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the LSST License Statement and
19 # the GNU General Public License along with this program. If not,
20 # see <http://www.lsstcorp.org/LegalNotices/>.
21 #
22 
23 # The Plugin classes here are accessed via registries, not direct imports.
24 __all__ = ("CModelStageConfig", "CModelConfig")
25 
26 from .cmodel import CModelStageControl, CModelControl, CModelAlgorithm
27 
28 from lsst.pex.config import makeConfigClass
29 import lsst.meas.base
30 
31 
32 CModelStageConfig = makeConfigClass(CModelStageControl)
33 CModelConfig = makeConfigClass(CModelControl)
34 
35 apCorrList = ("modelfit_CModel", "modelfit_CModel_initial", "modelfit_CModel_exp", "modelfit_CModel_dev")
36 
37 
39 
40  def setDefaults(self):
41  lsst.meas.base.SingleFramePluginConfig.setDefaults(self)
42  CModelConfig.setDefaults(self)
43 
44 
45 @lsst.meas.base.register("modelfit_CModel", apCorrList=apCorrList)
47  """Single-frame measurement interface for CModelAlgorithm.
48 
49  This class simply provides __init__ and measure methods that matched the SingleFramePlugin signatures
50  and delegate to the CModelAlgorithm's methods.
51  """
52  ConfigClass = CModelSingleFrameConfig
53 
54  @staticmethod
56  return 3.0
57 
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)
61 
62  def measure(self, measRecord, exposure):
63  self.algorithm.measure(measRecord, exposure)
64 
65  def fail(self, measRecord, error=None):
66  self.algorithm.fail(measRecord, error.cpp if error is not None else None)
67 
68 
70 
71  def setDefaults(self):
72  lsst.meas.base.ForcedPluginConfig.setDefaults(self)
73  CModelConfig.setDefaults(self)
74 
75 
76 @lsst.meas.base.register("modelfit_CModel", apCorrList=apCorrList)
78  """Forced measurement interface for CModelAlgorithm
79 
80  This class simply provides __init__ and measure methods that matched the ForcedPlugin signatures
81  and delegate to CModelAlgorithm implementations.
82 
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.
86 
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
91  """
92  ConfigClass = CModelForcedConfig
93 
94  @staticmethod
96  return 3.0
97 
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)
101 
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)."
107  )
108  self.algorithm.measure(measRecord, exposure, refRecord)
109 
110  def fail(self, measRecord, error=None):
111  self.algorithm.fail(measRecord, error.cpp if error is not None else None)
lsst::meas::modelfit.cmodel.cmodelContinued.CModelForcedPlugin.algorithm
algorithm
Definition: cmodelContinued.py:100
lsst::meas::modelfit.cmodel.cmodelContinued.CModelSingleFramePlugin.algorithm
algorithm
Definition: cmodelContinued.py:60
lsst::meas::base::FatalAlgorithmError
Exception to be thrown when a measurement algorithm experiences a fatal error.
Definition: exceptions.h:76
lsst::meas::base.sfm.SingleFramePlugin
Definition: sfm.py:51
lsst::meas::modelfit.cmodel.cmodelContinued.CModelForcedPlugin
Definition: cmodelContinued.py:77
lsst::meas::base.sfm.SingleFramePluginConfig
Definition: sfm.py:45
lsst::meas::modelfit.cmodel.cmodelContinued.CModelForcedPlugin.getExecutionOrder
def getExecutionOrder()
Definition: cmodelContinued.py:95
lsst::meas::modelfit.cmodel.cmodelContinued.CModelSingleFramePlugin
Definition: cmodelContinued.py:46
lsst::meas::modelfit.cmodel.cmodelContinued.CModelSingleFramePlugin.__init__
def __init__(self, config, name, schema, metadata)
Definition: cmodelContinued.py:58
lsst::meas::modelfit.cmodel.cmodelContinued.CModelForcedConfig
Definition: cmodelContinued.py:69
lsst::meas::modelfit.cmodel.cmodelContinued.CModelForcedPlugin.fail
def fail(self, measRecord, error=None)
Definition: cmodelContinued.py:110
lsst::meas::modelfit.cmodel.cmodelContinued.CModelSingleFramePlugin.getExecutionOrder
def getExecutionOrder()
Definition: cmodelContinued.py:55
lsst::meas::modelfit.cmodel.cmodelContinued.CModelSingleFrameConfig
Definition: cmodelContinued.py:38
lsst::meas::modelfit.cmodel.cmodelContinued.CModelSingleFrameConfig.setDefaults
def setDefaults(self)
Definition: cmodelContinued.py:40
lsst.pex.config
Definition: __init__.py:1
lsst::meas::base
Definition: Algorithm.h:37
lsst::meas::base.forcedMeasurement.ForcedPluginConfig
Definition: forcedMeasurement.py:69
lsst::meas::modelfit.cmodel.cmodelContinued.CModelSingleFramePlugin.measure
def measure(self, measRecord, exposure)
Definition: cmodelContinued.py:62
lsst.pex.config.wrap.makeConfigClass
def makeConfigClass(ctrl, name=None, base=Config, doc=None, module=None, cls=None)
Definition: wrap.py:56
lsst::meas::base.forcedMeasurement.ForcedPlugin
Definition: forcedMeasurement.py:75
lsst::meas::modelfit.cmodel.cmodelContinued.CModelConfig
CModelConfig
Definition: cmodelContinued.py:33
lsst::meas::modelfit.cmodel.cmodelContinued.CModelForcedPlugin.measure
def measure(self, measRecord, exposure, refRecord, refWcs)
Definition: cmodelContinued.py:102
lsst::meas::modelfit.cmodel.cmodelContinued.CModelForcedConfig.setDefaults
def setDefaults(self)
Definition: cmodelContinued.py:71
lsst::meas::modelfit.cmodel.cmodelContinued.CModelSingleFramePlugin.fail
def fail(self, measRecord, error=None)
Definition: cmodelContinued.py:65
lsst::meas::modelfit.cmodel.cmodelContinued.CModelForcedPlugin.__init__
def __init__(self, config, name, schemaMapper, metadata)
Definition: cmodelContinued.py:98