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

Add calib_astrometryUsed field to record sources used #67

Merged
merged 1 commit into from May 3, 2017

Conversation

pgee2000
Copy link
Contributor

Also added a doWrite config field to match photoCal and measurePsf

Also added a doWrite config field to match photoCal and measurePsf
@PaulPrice
Copy link
Contributor

But that Task doesn't write anything, so the config field is a bit misleading.

Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some None fixes, and a suggestion for the config name.

@@ -55,6 +57,11 @@ class AstrometryConfig(RefMatchConfig):
default=0.001,
min=0,
)
doWriteOutput = pexConfig.Field(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like a better name for this config parameter would be doOutputUsedFlag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to leave this consistent with the other calib modules.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this should be changed. This Task does not do any writing, so the name is misleading.

@@ -147,6 +154,13 @@ def __init__(self, refObjLoader, schema=None, **kwargs):
@param[in] kwargs additional keyword arguments for pipe_base Task.\_\_init\_\_
"""
RefMatchTask.__init__(self, refObjLoader, schema=schema, **kwargs)

if self.config.doWriteOutput and not schema is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

schema is not None

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of this code standard, but OK.

@@ -269,6 +283,9 @@ def solve(self, exposure, sourceCat):
(iterNum, len(tryRes.matches), tryMatchDist.distMean.asArcseconds(),
tryMatchDist.distStdDev.asArcseconds()))

for m in res.matches:
if self.usedKey:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should be explicit here: if self.usedKey is not None

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK


if self.config.doWriteOutput and not schema is None:
self.usedKey = schema.addField("calib_astrometryUsed", type="Flag",
doc="set if source was used in astrometric calibration")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

funky indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@parejkoj
Copy link
Contributor

And we need a unittest of this functionality here as well.

@pgee2000 pgee2000 merged commit da512c7 into master May 3, 2017
@pgee2000
Copy link
Contributor Author

pgee2000 commented May 3, 2017

I have not bothered to add a unit test here. I don't think it is worth the bother, and writing any kind of intelligent unit test requires an understanding of the Task, which is well beyond the scope of this ticket. I did add one to photoCal, where it makes more sense.

@PaulPrice
Copy link
Contributor

It looks like you've merged prematurely.

@@ -22,6 +22,8 @@
from __future__ import absolute_import, division, print_function
from builtins import range

import random

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like this is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants