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

DM-15045: Activate convolved measurements on undeblended sources #10

Merged
merged 5 commits into from Jul 11, 2018

Conversation

PaulPrice
Copy link
Collaborator

No description provided.

Copy link
Member

@TallJimbo TallJimbo left a comment

Choose a reason for hiding this comment

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

A few minor comments.

flag = schema.addField(name + "_kron_flag", type="Flag",
doc="convolved Kron flux failed: seeing %f" % (seeing,)),
flag=schema.addField(name + "_kron_flag", type="Flag",
doc="convolved Kron flux failed: seeing %f" % (seeing,)),
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps for next time, schema.join(name, 'kron', 'flag') would be the preferred way to concatenate schema name components these days. We haven't made a push to use it across the board, though, so I won't insist on doing it on a high-priority fix ticket like this one.

@@ -478,7 +486,7 @@ def measureAperture(self, measRecord, exposure, aperturePhot):
"""
try:
aperturePhot.measure(measRecord, exposure)
except:
except: # noqa E722: want to catch any and all errors
Copy link
Member

Choose a reason for hiding this comment

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

Still better to do except Exception, so you don't block e.g. KeyboardInterrupt, I think.

"because the column names are derived from the configuration rather than\n"
"being static. Sometimes you want to turn this off, e.g., when you will\n"
"use aperture corrections derived from somewhere else through the 'proxy'\n"
"mechanism.")
Copy link
Member

Choose a reason for hiding this comment

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

I didn't know what "instantiation time" meant, exactly, when first reading this. Maybe better to say "when the Plugin is instantiated".

self.assertGreater(source.get(prefix + kronName + "_fluxSigma"), 0)
self.assertFalse(source.get(prefix + kronName + "_flag"))

# Aperture measurements suceeded and match expectation
Copy link
Member

Choose a reason for hiding this comment

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

suceeded -> succeeded

Would get the following exception when activating convolved measurements
of undeblended sources:

lsst::pex::exceptions::InvalidParameterError: 'Field with name 'ext_convolved_ConvolvedFlux_0_deconv' already present in schema.'

This was due to assuming the algorithm name was set in stone.

Extended tests to catch this and test the undeblended measurements as well.
from the build system.
@PaulPrice PaulPrice force-pushed the tickets/DM-15045 branch 2 times, most recently from d5fb27c to 0f5f9f9 Compare July 11, 2018 14:59
setup.cfg Outdated
exclude =
__init__.py,
doc/conf.py,
python/lsst/afw/cameraGeom/cameraGeomLib.py,
Copy link
Member

Choose a reason for hiding this comment

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

You probably want to clean up these exclusions.

@@ -243,7 +255,7 @@ def setup_module(module, backend="virtualDevice"):
lsst.utils.tests.init()
try:
afwDisplay.setDefaultBackend(backend)
except:
except: # noqa E722: want to catch any and all errors
Copy link
Member

@timj timj Jul 11, 2018

Choose a reason for hiding this comment

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

Please catch BaseException. It is no longer standard practice in python3 to have a bare except. The point is that the idiom now is for you to have to think whether Exception or BaseException should be caught and make that decision explicit. BaseException should only be used if you want to ignore typos in your code, sys.exit, and ctrl-C and the like.

Extraneous spaces, bare 'except'.
The aperture correction registration has been done when the plugin is
instantiated because the column names are derived from the configuration
rather than being static. Sometimes you want to turn this off, e.g., when
you will use aperture corrections derived from somewhere else through the
'proxy' mechanism.
@PaulPrice PaulPrice merged commit 5ce7b43 into master Jul 11, 2018
@ktlim ktlim deleted the tickets/DM-15045 branch August 25, 2018 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants