Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tickets/dm 6627 #16

Merged
merged 1 commit into from
Aug 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/lsst/jointcal/Jointcal.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ namespace jointcal {
struct JointcalControl {
LSST_CONTROL_FIELD(sourceFluxField, std::string, "name of flux field in source catalog");

JointcalControl(std::string const sourceFluxType) :
JointcalControl(std::string const & sourceFluxField="slot_CalibFlux") :
// Set sourceFluxType to the value used in the source selector.
sourceFluxField("slot_"+sourceFluxType+"Flux")
sourceFluxField(sourceFluxField)
{
validate();
}
Expand Down
16 changes: 11 additions & 5 deletions python/lsst/jointcal/jointcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class JointcalRunner(pipeBase.TaskRunner):
@staticmethod
def getTargetList(parsedCmd, **kwargs):
"""
Return a list tuples per tract: (dataRefs, kwargs).
Return a list of tuples per tract, each containing (dataRefs, kwargs).

Jointcal operates on lists of dataRefs simultaneously.
"""
Expand Down Expand Up @@ -75,7 +75,7 @@ class JointcalConfig(pexConfig.Config):
"""Config for jointcalTask"""

coaddName = pexConfig.Field(
doc = "Type of coadd",
doc = "Type of coadd, typically deep or goodSeeing",
dtype = str,
default = "deep"
)
Expand Down Expand Up @@ -110,8 +110,13 @@ class JointcalTask(pipeBase.CmdLineTask):
RunnerClass = JointcalRunner
_DefaultName = "jointcal"

def __init__(self, profile_jointcal=False, *args, **kwargs):
pipeBase.CmdLineTask.__init__(self, *args, **kwargs)
def __init__(self, profile_jointcal=False, **kwargs):
"""Instantiate a JointcalTask.

@param profile_jointcal (bool) set to True to profile different stages
of this jointcal run.
"""
pipeBase.CmdLineTask.__init__(self, **kwargs)
self.profile_jointcal = profile_jointcal
self.makeSubtask("sourceSelector")

Expand Down Expand Up @@ -208,7 +213,8 @@ def run(self, dataRefs, profile_jointcal=False):
if len(dataRefs) == 0:
raise ValueError('Need a list of data references!')

jointcalControl = jointcalLib.JointcalControl(self.sourceSelector.config.sourceFluxType)
sourceFluxField = "slot_%sFlux" % (self.sourceSelector.config.sourceFluxType,)
jointcalControl = jointcalLib.JointcalControl(sourceFluxField)
associations = jointcalLib.Associations()

load_cat_prof_file = 'jointcal_load_catalog.prof' if profile_jointcal else ''
Expand Down
8 changes: 4 additions & 4 deletions tests/testJointcal_lsstSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,24 +118,24 @@ def testJointCalTask_2_catalog(self):
# NOTE: The relative RMS limits were empirically determined from the
# first run of jointcal on this data. We should always do better than
# this in the future!
relative_error = 8.4e-3*u.arcsecond,
relative_error = 8.4e-3*u.arcsecond
self._testJointCalTask_run(2, relative_error, absolute_error)

@unittest.skipIf(data_dir is None, "validation_data_jointcal not setup")
@unittest.skip('Keeping this around for diagnostics on the behavior with n catalogs.')
def testJointCalTask_4_catalog(self):
relative_error = 7.8e-3*u.arcsecond,
relative_error = 7.8e-3*u.arcsecond
self._testJointCalTask_run(4, relative_error, absolute_error)

@unittest.skipIf(data_dir is None, "validation_data_jointcal not setup")
@unittest.skip('Keeping this around for diagnostics on the behavior with n catalogs.')
def testJointCalTask_7_catalog(self):
relative_error = 7.5e-3*u.arcsecond,
relative_error = 7.5e-3*u.arcsecond
self._testJointCalTask_run(7, relative_error, absolute_error)

@unittest.skipIf(data_dir is None, "validation_data_jointcal not setup")
def testJointCalTask_10_catalog(self):
relative_error = 7.4e-3*u.arcsecond,
relative_error = 7.4e-3*u.arcsecond
self._testJointCalTask_run(10, relative_error, absolute_error)


Expand Down