Skip to content

Commit

Permalink
Merge pull request #7 from lsst/tickets/DM-15772
Browse files Browse the repository at this point in the history
tickets/DM-15772 - Rename the task, its configClass, and all mentions of its name
  • Loading branch information
mfisherlevine committed Nov 6, 2018
2 parents 324faa9 + 976477e commit ade8416
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 25 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sudo: false
language: python
matrix:
include:
- python: '3.6'
install:
- pip install flake8
script: flake8
4 changes: 2 additions & 2 deletions python/lsst/cp/pipe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

from .version import * # generated by sconsUtils unless you tell it not to
try:
from .cpTask import *
from .runEotestTask import *
except ImportError:
import lsst.log as log
log.log("cp.pipe __init__", log.WARN, "eotest module not found; cpTask not available")
log.log("cp.pipe __init__", log.WARN, "eotest module not found; runEotestTask not available")
from .makeBrighterFatterKernel import *
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import lsst.eotest.sensor as sensorTest


class CpTaskConfig(pexConfig.Config):
class RunEotestConfig(pexConfig.Config):
"""Config class for the calibration products production (CP) task."""

ccdKey = pexConfig.Field(
Expand Down Expand Up @@ -162,7 +162,7 @@ def validate(self):
override the validate() method here, and use it to set the output directory for each of the tasks
based on the legal pexConfig parameter for the main task.
"""
log = lsstLog.Log.getLogger("cp.pipe.cpTaskConfig")
log = lsstLog.Log.getLogger("cp.pipe.runEotestConfig")
if not self.eotestOutputPath:
raise RuntimeError("Must supply an output path for eotest data. "
"Please set config.eotestOutputPath.")
Expand All @@ -179,35 +179,40 @@ def validate(self):
getattr(self, task).output_dir = self.eotestOutputPath


class CpTask(pipeBase.CmdLineTask):
class RunEotestTask(pipeBase.CmdLineTask):
"""
Calibration (Products) Production (CP) task.
Task to run test stand data through eotest using a butler.
This task is used to produce the calibration products required to calibrate cameras.
Examples of such operations are as follows:
This task is used to produce an eotest report (the project's sensor
acceptance testing package)
Examples of some of its operations are as follows:
* Given a set of flat-field images, find the dark pixels and columns.
* Given a set of darks, find the bright pixels and columns.
* Given a set of Fe55 exposures, calulate the gain of the readout chain, in e-/ADU
* Given a set of Fe55 exposures, calulate the instrinsic PSF of the silicon, and the degradation of
* Given a set of Fe55 exposures, calulate the gain of the readout chain,
in e-/ADU
* Given a set of Fe55 exposures, calulate the instrinsic PSF of the silicon,
and the degradation of
* the PSF due to CTE.
* Given a set of flat-pairs, measure the photon transfer curve (PTC).
* Given a set of bias frames, calculate the read noise of the system in e-.
* Given a set of pocket-pumping exposures, find charge-traps in the silicon.
The CpTask.runEotestDirect() is only applicable to LSST sensors, and only for a specific type of dataset
This method takes a dafPersistance.Butler corresponding to a repository in which a full eotest run has
been taken and ingested, and runs each of the tasks in eotest directly, allowing for bitwise comparison
with results given by the camera team.
The RunEotestTask.runEotestDirect() is only applicable to LSST sensors, and
only for a specific type of dataset. This method takes a
dafPersistance.Butler corresponding to a repository in which a full eotest
run has been taken and ingested, and runs each of the tasks in eotest
directly, allowing for bitwise comparison with results given by the camera
team.
See http://ls.st/ldm-151 Chapter 4, Calibration Products Production for further details
regarding the inputs and outputs.
See http://ls.st/ldm-151 Chapter 4, Calibration Products Production for
further details regarding the inputs and outputs.
"""

ConfigClass = CpTaskConfig
_DefaultName = "cp"
ConfigClass = RunEotestConfig
_DefaultName = "runEotest"

def __init__(self, *args, **kwargs):
"""Constructor for the CpTask."""
"""Constructor for the RunEotestTask."""
if 'lsst.eotest.sensor' not in sys.modules: # check we have eotest before going further
raise RuntimeError('eotest failed to import')

Expand Down
10 changes: 10 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[flake8]
max-line-length = 110
ignore = E133, E226, E228, E251, N802, N803, N806, W504
exclude = __init__.py, config/*.py, bin/*

[tool:pytest]
addopts = --flake8
flake8-ignore = E133 E226 E228 E251 N802 N803 N806 W504
config/*.py ALL
bin/* ALL
14 changes: 8 additions & 6 deletions tests/test_cp_pipe.py → tests/test_runEotestTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,23 @@
noEotest = True


class CpPipeTestCase(lsst.utils.tests.TestCase):
class RunEotestTaskTestCase(lsst.utils.tests.TestCase):
"""A test case for cp_pipe."""

def testExample(self):
pass

@unittest.skipIf(noEotest, noEotestMsg)
def testImport(self):
import lsst.cp.pipe as cpPipe
import lsst.cp.pipe as cpPipe # noqa: F401

@unittest.skipIf(noEotest, noEotestMsg)
def testClassInstantiation(self):
from lsst.cp.pipe import CpTask
cpConfig = CpTask.ConfigClass()
cpConfig.eotestOutputPath='/some/test/path' # must not be empty for validate() to pass
cpTask = CpTask(config=cpConfig)
from lsst.cp.pipe.runEotestTask import RunEotestTask
runEotestConfig = RunEotestTask.ConfigClass()
runEotestConfig.eotestOutputPath = '/some/test/path' # must not be empty for validate() to pass
runEotestTask = RunEotestTask(config=runEotestConfig)
del runEotestTask


class TestMemory(lsst.utils.tests.MemoryTestCase):
Expand All @@ -64,6 +65,7 @@ class TestMemory(lsst.utils.tests.MemoryTestCase):
def setup_module(module):
lsst.utils.tests.init()


if __name__ == "__main__":
lsst.utils.tests.init()
unittest.main()

0 comments on commit ade8416

Please sign in to comment.