Skip to content

Commit

Permalink
Move default configs from ProcessCcd to subtasks
Browse files Browse the repository at this point in the history
so that commandline task and pipeline behave the same
  • Loading branch information
arunkannawadi committed Nov 25, 2019
1 parent f271f1f commit 3e6a396
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions python/lsst/pipe/tasks/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@ class CalibrateConfig(pipeBase.PipelineTaskConfig, pipelineConnections=Calibrate
"normal calexp but as a fakes_calexp."
)

def setDefaults(self):
super().setDefaults()
self.detection.doTempLocalBackground = False
self.deblend.maxFootprintSize = 2000

def validate(self):
super().validate()
astromRefCatGen2 = getattr(self.astromRefObjLoader, "ref_dataset_name", None)
Expand Down
3 changes: 2 additions & 1 deletion python/lsst/pipe/tasks/characterizeImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class CharacterizeImageConfig(pipeBase.PipelineTaskConfig,
)
doWriteExposure = pexConfig.Field(
dtype=bool,
default=True,
default=False,
doc="Write icExp and icExpBackground in addition to icSrc? Ignored if doWrite False.",
)
psfIterations = pexConfig.RangeField(
Expand Down Expand Up @@ -185,6 +185,7 @@ def setDefaults(self):
# but these are the values we have been using
self.detection.thresholdValue = 5.0
self.detection.includeThresholdMultiplier = 10.0
self.detection.doTempLocalBackground = False
# do not deblend, as it makes a mess
self.doDeblend = False
# measure and apply aperture correction; note: measuring and applying aperture
Expand Down
13 changes: 8 additions & 5 deletions python/lsst/pipe/tasks/processCcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.
#
import yaml
from lsst.ip.isr import IsrTask
import lsst.pex.config as pexConfig
import lsst.pipe.base as pipeBase
Expand Down Expand Up @@ -63,11 +64,13 @@ class ProcessCcdConfig(pexConfig.Config):
)

def setDefaults(self):
self.isr.doWrite = False
self.charImage.doWriteExposure = False
self.charImage.detection.doTempLocalBackground = False
self.calibrate.detection.doTempLocalBackground = False
self.calibrate.deblend.maxFootprintSize = 2000
with open('pipelines/ProcessCcd.yaml', 'r') as fp:
configs = yaml.safe_load(fp)

for task in configs.keys():
if isinstance(configs[task], dict) and 'config' in configs[task].keys():
for attr, val in configs[task]['config'].items():
self.task.attr = val

## \addtogroup LSST_task_documentation
## \{
Expand Down

0 comments on commit 3e6a396

Please sign in to comment.