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
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
home
lsstsw
stack
Linux64
pipe_tasks
11.0.rc2+1
python
lsst
pipe
tasks
processCcd.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
#
3
# LSST Data Management System
4
# Copyright 2008, 2009, 2010 LSST Corporation.
5
#
6
# This product includes software developed by the
7
# LSST Project (http://www.lsst.org/).
8
#
9
# This program is free software: you can redistribute it and/or modify
10
# it under the terms of the GNU General Public License as published by
11
# the Free Software Foundation, either version 3 of the License, or
12
# (at your option) any later version.
13
#
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
18
#
19
# You should have received a copy of the LSST License Statement and
20
# the GNU General Public License along with this program. If not,
21
# see <http://www.lsstcorp.org/LegalNotices/>.
22
#
23
from
.processImage
import
ProcessImageTask
24
from
lsst.ip.isr
import
IsrTask
25
import
lsst.afw.table
as
afwTable
26
import
lsst.pex.config
as
pexConfig
27
import
lsst.pipe.base
as
pipeBase
28
29
class
ProcessCcdConfig
(ProcessImageTask.ConfigClass):
30
"""Config for ProcessCcd"""
31
doIsr = pexConfig.Field(dtype=bool, default=
True
, doc =
"Perform ISR?"
)
32
isr = pexConfig.ConfigurableField(
33
target = IsrTask,
34
doc =
"Instrumental Signature Removal"
,
35
)
36
37
class
ProcessCcdTask
(ProcessImageTask):
38
"""Process a CCD
39
40
Available steps include:
41
- instrument signature removal (ISR)
42
- calibrate
43
- detect sources
44
- measure sources
45
"""
46
ConfigClass = ProcessCcdConfig
47
_DefaultName =
"processCcd"
48
dataPrefix =
""
49
50
def
__init__
(self, **kwargs):
51
ProcessImageTask.__init__(self, **kwargs)
52
self.makeSubtask(
"isr"
)
53
54
def
makeIdFactory
(self, sensorRef):
55
expBits = sensorRef.get(
"ccdExposureId_bits"
)
56
expId = long(sensorRef.get(
"ccdExposureId"
))
57
return
afwTable.IdFactory.makeSource(expId, 64 - expBits)
58
59
def
getExposureId
(self, sensorRef):
60
return
long(sensorRef.get(
"ccdExposureId"
))
61
62
@pipeBase.timeMethod
63
def
run
(self, sensorRef):
64
"""Process one CCD
65
66
@param sensorRef: sensor-level butler data reference
67
@return pipe_base Struct containing these fields:
68
- postIsrExposure: exposure after ISR performed if calib.doIsr or config.doCalibrate, else None
69
- exposure: calibrated exposure (calexp): as computed if config.doCalibrate,
70
else as upersisted and updated if config.doDetection, else None
71
- calib: object returned by calibration process if config.doCalibrate, else None
72
- sources: detected source if config.doPhotometry, else None
73
"""
74
self.log.info(
"Processing %s"
% (sensorRef.dataId))
75
76
# initialize outputs
77
postIsrExposure =
None
78
79
if
self.config.doIsr:
80
postIsrExposure = self.isr.runDataRef(sensorRef).exposure
81
elif
self.config.doCalibrate:
82
postIsrExposure = sensorRef.get(self.
dataPrefix
+
"postISRCCD"
)
83
84
# delegate most of the work to ProcessImageTask
85
result = self.process(sensorRef, postIsrExposure)
86
result.postIsrExposure = postIsrExposure
87
return
result
lsst::pipe.tasks.processCcd.ProcessCcdTask
Definition:
processCcd.py:37
lsst::pipe.tasks.processCcd.ProcessCcdTask.getExposureId
def getExposureId
Definition:
processCcd.py:59
lsst::pipe.tasks.processCcd.ProcessCcdTask.makeIdFactory
def makeIdFactory
Definition:
processCcd.py:54
lsst::pipe.tasks.processCcd.ProcessCcdTask.run
def run
Definition:
processCcd.py:63
lsst::pipe.tasks.processCcd.ProcessCcdConfig
Definition:
processCcd.py:29
lsst.afw.table
Definition:
__init__.py:1
lsst::pipe::base
Definition:
bce1dc8f41db4023a2f35e8bd2e39158d8054398.dox:1
lsst::pex.config
Definition:
__init__.py:1
lsst::pipe.tasks.processCcd.ProcessCcdTask.dataPrefix
string dataPrefix
Definition:
processCcd.py:48
lsst::ip::isr
Definition:
isr.h:62
lsst::pipe.tasks.processCcd.ProcessCcdTask.__init__
def __init__
Definition:
processCcd.py:50
Generated on Wed Sep 16 2015 13:35:34 for LSSTApplications by
1.8.5