当前位置: 首页>>代码示例>>Python>>正文


Python Log.log方法代码示例

本文整理汇总了Python中lsst.pex.logging.Log.log方法的典型用法代码示例。如果您正苦于以下问题:Python Log.log方法的具体用法?Python Log.log怎么用?Python Log.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lsst.pex.logging.Log的用法示例。


在下文中一共展示了Log.log方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _StopThread

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import log [as 别名]
    class _StopThread(threading.Thread):

        def __init__(self, joboffice, stopTopic, runId, brokerHost, 
                     brokerPort=None, waittime=60):

            threading.Thread.__init__(self, name=joboffice.getName()+".stop")
            self.setDaemon(True)
            
            self.jo = joboffice
            self.timeout = waittime

            self.log = Log(self.jo.log, "stop")

            selector = ""
            if runId:  selector = "RUNID='%s'" % runId
                
            if brokerPort:
                self.rcvr = EventReceiver(brokerHost, brokerPort, stopTopic,
                                          selector)
            else:
                self.rcvr = EventReceiver(brokerHost, stopTopic, selector)
                
        def run(self):
            while True:
                event = self.rcvr.receiveEvent(self.timeout)
                if event:
                    self.log.log(Log.INFO-1, "received stop event; " +
                                 "shutting down JobOffice thread")
                    self.jo.stop()
                if self.jo.halt:
                    return
开发者ID:jonathansick-shadow,项目名称:ctrl_sched,代码行数:33,代码来源:jobOffice.py

示例2: IsrBiasStageParallel

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import log [as 别名]
class IsrBiasStageParallel(harnessStage.ParallelProcessing):
    """
    Description:

    Policy Dictionary:

    Clipboard Input:

    ClipboardOutput:
    """
    def setup(self):
        self.log = Log(self.log, "IsrBiasStage - parallel")

        policyFile = pexPolicy.DefaultPolicyFile("ip_pipeline", "IsrBiasStageDictionary.paf", "policy")
        defPolicy = pexPolicy.Policy.createPolicy(policyFile, policyFile.getRepositoryPath())

        if self.policy is None:
            self.policy = pexPolicy.Policy()
        self.policy.mergeDefaults(defPolicy)

    def process(self, clipboard):
        """
        """
        self.log.log(Log.INFO, "Doing bias subtraction.")
        
        #grab exposure and bias from clipboard
        biasexposure = clipboard.get(self.policy.getString("inputKeys.biasexposure"))
        exposure = clipboard.get(self.policy.getString("inputKeys.exposure"))
        ipIsr.biasCorrection(exposure, biasexposure)
        #output products
        clipboard.put(self.policy.get("outputKeys.biasSubtractedExposure"), exposure)
开发者ID:jonathansick-shadow,项目名称:ip_pipeline,代码行数:33,代码来源:isrBiasStage.py

示例3: checkExitByStage

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import log [as 别名]
    def checkExitByStage(self): 
        log = Log(self.log, "checkExitByStage")

        if((self._stop.isSet()) and (self.exitLevel == 3)):
            log.log(Log.INFO, "Pipeline stop is set at exitLevel of 3")
            log.log(Log.INFO, "Exit here at the end of the Stage")
            self.forceShutdown = 1
开发者ID:jonathansick-shadow,项目名称:pex_mpiharness,代码行数:9,代码来源:MpiPipeline.py

示例4: checkExitBySyncPoint

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import log [as 别名]
    def checkExitBySyncPoint(self): 
        log = Log(self.log, "checkExitBySyncPoint")

        if((self._stop.isSet()) and (self.exitLevel == 2)):
            log.log(Log.INFO, "Pipeline stop is set at exitLevel of 2")
            log.log(Log.INFO, "Exit here at a Synchronization point")
            self.forceShutdown = 1
开发者ID:jonathansick-shadow,项目名称:pex_mpiharness,代码行数:9,代码来源:MpiPipeline.py

示例5: checkExitByVisit

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import log [as 别名]
    def checkExitByVisit(self): 
        log = Log(self.log, "checkExitByVisit")

        if((self._stop.isSet()) and (self.exitLevel == 4)):
            log.log(Log.INFO, "Pipeline stop is set at exitLevel of 4")
            log.log(Log.INFO, "Exit here at the end of the Visit")
            self.forceShutdown = 1
开发者ID:jonathansick-shadow,项目名称:pex_mpiharness,代码行数:9,代码来源:MpiPipeline.py

示例6: shutdown

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import log [as 别名]
 def shutdown(self): 
     """
     Shutdown the Slice execution
     """
     shutlog = Log(self.log, "shutdown", Log.INFO);
     shutlog.log(Log.INFO, "Shutting down Slice")
     self.cppSlice.shutdown()
开发者ID:jonathansick-shadow,项目名称:pex_mpiharness,代码行数:9,代码来源:MpiSlice.py

示例7: IsrDarkStageParallel

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import log [as 别名]
class IsrDarkStageParallel(harnessStage.ParallelProcessing):
    """
    Description:

    Policy Dictionary:

    Clipboard Input:

    ClipboardOutput:
    """
    def setup(self):
        self.log = Log(self.log, "IsrDarkStage - parallel")

        policyFile = pexPolicy.DefaultPolicyFile("ip_pipeline", "IsrDarkStageDictionary.paf", "policy")
        defPolicy = pexPolicy.Policy.createPolicy(policyFile, policyFile.getRepositoryPath())

        if self.policy is None:
            self.policy = pexPolicy.Policy()
        self.policy.mergeDefaults(defPolicy)

    def process(self, clipboard):
        """
        """
        self.log.log(Log.INFO, "Doing dark subtraction.")
        
        #grab exposure and dark from clipboard
        darkexposure = clipboard.get(self.policy.getString("inputKeys.darkexposure"))
        exposure = clipboard.get(self.policy.getString("inputKeys.exposure"))
        darkscaling = darkexposure.getCalib().getExptime()
        expscaling = exposure.getCalib().getExptime()
        ipIsr.darkCorrection(exposure, darkexposure, float(expscaling),
                float(darkscaling))

        #output products
        clipboard.put(self.policy.get("outputKeys.darkSubtractedExposure"), exposure)
开发者ID:jonathansick-shadow,项目名称:ip_pipeline,代码行数:37,代码来源:isrDarkStage.py

示例8: IsrVarianceStageParallel

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import log [as 别名]
class IsrVarianceStageParallel(harnessStage.ParallelProcessing):
    """
    Description:

    Policy Dictionary:

    Clipboard Input:

    ClipboardOutput:
    """
    def setup(self):
        self.log = Log(self.log, "IsrVarianceStage - parallel")

        policyFile = pexPolicy.DefaultPolicyFile("ip_pipeline", "IsrVarianceStageDictionary.paf", "policy")
        defPolicy = pexPolicy.Policy.createPolicy(policyFile, policyFile.getRepositoryPath())

        if self.policy is None:
            self.policy = pexPolicy.Policy()
        self.policy.mergeDefaults(defPolicy)

    def process(self, clipboard):
        """
        """
        self.log.log(Log.INFO, "Calculating variance from image counts.")
        
        #grab exposure from clipboard
        exposure = clipboard.get(self.policy.getString("inputKeys.exposure"))
        ipIsr.updateVariance(exposure)
        #output products
        clipboard.put(self.policy.get("outputKeys.varianceAddedExposure"), exposure)
开发者ID:jonathansick-shadow,项目名称:ip_pipeline,代码行数:32,代码来源:isrVarianceStage.py

示例9: IsrCcdSdqaStageParallel

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import log [as 别名]
class IsrCcdSdqaStageParallel(harnessStage.ParallelProcessing):
    """
    Description:

    Policy Dictionary:

    Clipboard Input:

    ClipboardOutput:
    """
    def setup(self):
        self.log = Log(self.log, "CcdSdqaStage -- Parallel")

        policyFile = pexPolicy.DefaultPolicyFile("ip_pipeline",
                "IsrCcdSdqaStageDictionary.paf", "policy")
        defPolicy = pexPolicy.Policy.createPolicy(policyFile, policyFile.getRepositoryPath())

        if self.policy is None:
            self.policy = pexPolicy.Policy()
        self.policy.mergeDefaults(defPolicy)

    def process(self, clipboard):
        """
        """
        self.log.log(Log.INFO, "Calculate SDQA metrics based on the assembled ccd.")
        
        #grab exposure from clipboard
        exposure = clipboard.get(self.policy.getString("inputKeys.ccdExposure"))
        ipIsr.calculateSdqaCcdRatings(exposure)
        #output products
        clipboard.put(self.policy.get("outputKeys.sdqaCcdExposure"),
                exposure)
开发者ID:jonathansick-shadow,项目名称:ip_pipeline,代码行数:34,代码来源:isrCcdSdqaStage.py

示例10: FakeOutput

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import log [as 别名]
class FakeOutput(harnessStage.ParallelProcessing):
    """
    this stage simulates work by sleeping
    """

    def setup(self):
        if not self.log:
            self.log = Log.getDefaultLog()
        self.mylog = Log(self.log, "output")
        self.outputDatasetsKey = \
                    self.policy.getString("inputKeys.outputDatasets")
        self.possibleDatasetsKey = \
                    self.policy.getString("inputKeys.possibleDatasets")

    def process(self, clipboard):
        expected = clipboard.get(self.possibleDatasetsKey)
        outputds = clipboard.get(self.outputDatasetsKey)

        # this implementation will pretend to write out all of the
        # expected datasets.  It will also put each dataset written
        # out into the outputDatasets list.
        if expected:
            for ds in expected:
                self.mylog.log(Log.INFO, "Writing out " + ds.toString())
                outputds.append(ds)
        else:
            self.log.log(Log.WARN, "No expected datasets on clipboard")
            

        clipboard.put(self.outputDatasetsKey, outputds)
开发者ID:jonathansick-shadow,项目名称:ctrl_sched,代码行数:32,代码来源:fillerStages.py

示例11: shutdown

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import log [as 别名]
 def shutdown(self): 
     """
     Shutdown the Slice execution
     """
     shutlog = Log(self.log, "shutdown", Log.INFO);
     pid = os.getpid()
     shutlog.log(Log.INFO, "Shutting down Slice:  pid " + str(pid))
     os.kill(pid, signal.SIGKILL) 
开发者ID:lsst-dm,项目名称:legacy-pex_harness,代码行数:10,代码来源:Slice.py

示例12: __init__

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import log [as 别名]
 def __init__(self, fullPath=None):
     if fullPath is None:
         pDir = os.environ["CAT_DIR"]
         if pDir is None:
             raise RuntimeError('CAT_DIR env var required')
         fullPath = os.path.join(pDir, 'policy/defaultProdCatPolicy.paf')
     self.policyObj = pexPolicy.Policy.createPolicy(fullPath)
     log = Log(Log.getDefaultLog(), "cat")
     log.log(Log.DEBUG, 'Reading policy from %s' % fullPath)
开发者ID:jonathansick-shadow,项目名称:cat,代码行数:11,代码来源:policyReader.py

示例13: DiffImStageParallel

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import log [as 别名]
class DiffImStageParallel(harnessStage.ParallelProcessing):
    """
    Description:
        This stage wraps image subtraction        

    Policy Dictionary:
    lsst/ip/pipeline/policy/DiffImStageDictionary.paf

    Clipboard Input:
    - Template Exposure : to be convolved
    - Science Exposure  : to be matched to

    Clipboard Output:
    - Difference Exposure : resulting difference image
    - Psf Matching Kernel : the spatial model of the Psf matching Kernel
    - Background Function : differential background model
    """
    def setup(self):
        self.log   = Log(self.log, "DiffImStage - parallel")
        policyFile = pexPolicy.DefaultPolicyFile("ip_pipeline",
                                                 "DiffImStageDictionary.paf", "policy")
        defPolicy  = pexPolicy.Policy.createPolicy(policyFile,
                                                   policyFile.getRepositoryPath(), # repos
                                                   True)                           # validate

        if self.policy is None:
            self.policy = pexPolicy.Policy()
        self.policy.mergeDefaults(defPolicy.getDictionary())
        self.diffImPolicy = ipDiffim.makeDefaultPolicy()

    def process(self, clipboard):
        """
        Run image subtraction
        """
        self.log.log(Log.INFO, "Running image subtraction")
        
        # grab exposures from clipboard
        templateExposure = clipboard.get(self.policy.getString("inputKeys.templateExposureKey"))
        scienceExposure  = clipboard.get(self.policy.getString("inputKeys.scienceExposureKey"))

        # run image subtraction
        psfMatch = ipDiffim.ImagePsfMatch(self.diffImPolicy)
        results = psfMatch.subtractExposures(templateExposure, scienceExposure)
        
        # parse results
        differenceExposure, spatialKernel, backgroundModel, kernelCellSet = results

        #output products
        clipboard.put(self.policy.get("outputKeys.differenceExposureKey"), differenceExposure)
        clipboard.put(self.policy.get("outputKeys.psfMatchingKernelKey"), spatialKernel)
        clipboard.put(self.policy.get("outputKeys.backgroundFunctionKey"), backgroundModel)
开发者ID:jonathansick-shadow,项目名称:ip_pipeline,代码行数:53,代码来源:diffImStage.py

示例14: populateClipboard

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import log [as 别名]
    def populateClipboard(self, inputParamPropertySetPtr, iStage, eventTopic):
        """
        Place the event payload onto the Clipboard
        """
        log = Log(self.log, "populateClipboard");
        log.log(Log.DEBUG,'Python Pipeline populateClipboard');

        queue = self.queueList[iStage-1]
        clipboard = queue.element()

        # Slice does not disassemble the payload of the event. 
        # It knows nothing of the contents. 
        # It simply places the payload on the clipboard with key of the eventTopic
        clipboard.put(eventTopic, inputParamPropertySetPtr)
开发者ID:lsst-dm,项目名称:legacy-pex_harness,代码行数:16,代码来源:Slice.py

示例15: BackgroundEstimationStageParallel

# 需要导入模块: from lsst.pex.logging import Log [as 别名]
# 或者: from lsst.pex.logging.Log import log [as 别名]
class BackgroundEstimationStageParallel(harnessStage.ParallelProcessing):
    """
    Description:
        This stage wraps estimating and possibly subtracting the background from an exposure
        on the clipboard.        

    Policy Dictionary:
    lsst/meas/pipeline/policy/BackgroundEstimationStageDictionary.paf

    Clipboard Input:
    - Calibrated science Exposure(s) (including background)

    ClipboardOutput:
    - background subtracted Exposure used in the detection. Key specified
        by policy attribute 'backgroundSubtractedExposure'
    - the measured background object itself. Key specified by policy 
        attribute 'background'        
    """
    def setup(self):
        self.log = Log(self.log, "BackgroundEstimationStage - parallel")

        policyFile = pexPolicy.DefaultPolicyFile("meas_pipeline", 
                                                 "BackgroundEstimationStageDictionary.paf", "policy")
        defPolicy = pexPolicy.Policy.createPolicy(policyFile, policyFile.getRepositoryPath(), True)

        if self.policy is None:
            self.policy = pexPolicy.Policy()
        self.policy.mergeDefaults(defPolicy.getDictionary())

    def process(self, clipboard):
        """
        Detect sources in the worker process
        """
        self.log.log(Log.INFO, "Subtracting background in process")
        
        #grab exposure from clipboard
        exposure = clipboard.get(self.policy.get("inputKeys.exposure"))
            
        #estimate and maybe subtract the background
        background, backgroundSubtractedExposure = sourceDetection.estimateBackground(
            exposure,
            self.policy.get("parameters.backgroundPolicy"),
            self.policy.get("parameters.subtractBackground"))

        #output products
        clipboard.put(self.policy.get("outputKeys.background"), background)
        if backgroundSubtractedExposure:
            clipboard.put(self.policy.get("outputKeys.backgroundSubtractedExposure"),
                          backgroundSubtractedExposure)
开发者ID:lsst-dm,项目名称:legacy-meas_pipeline,代码行数:51,代码来源:backgroundEstimationStage.py


注:本文中的lsst.pex.logging.Log.log方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。