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

meas_base review for DM-1161 #13

Merged
merged 20 commits into from Mar 31, 2015
Merged

meas_base review for DM-1161 #13

merged 20 commits into from Mar 31, 2015

Conversation

TallJimbo
Copy link
Member

No description provided.

@TallJimbo
Copy link
Member Author

Some reminders to myself as I continue to work through the review comments:

  • there's a TODO comment in computeFixedMomentsFlux that was copied along with some other code, but should probably be addressed.
  • should add reference to BJ02, as requested in DM-2304

import unittest
import lsst.utils.tests
import numpy
Copy link
Contributor

Choose a reason for hiding this comment

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

This numpy import isn't used.

@TallJimbo TallJimbo force-pushed the tickets/DM-1161 branch 2 times, most recently from aecccee to 82a221e Compare March 31, 2015 20:17
Underscores should be used as a namespace separator, with
CamelCase used to separate words.
This was the cause of mysteriously large differences between the so-called
truth values and our measurements - we weren't actually drawing the
Gaussians we claimed we were drawing when making the test data.
Classification should still run when the error fields
it might have used aren't present but it isn't configured
to use them anyway.
This is a major refactoring of the test data
generation code in the tests.py module, which in
turn required major changes to most of the algorithm
tests.  The good news is that these are now
more concise, more complete, and in at least some
cases, more strict.

In the process, testSingleFrameMeasurement.py
was replaced with testNoiseReplacer.py (as noise
replacement was the only thing begin tested there
that wasn't already being tested elsewhere).  In
addition, testForced.py was replaced with new tests
for forced measurement in the test files for the
flux algorithms.
While the rest of getFixedMomentsFlux() was updated at some point to work
in parent coordinates, the call to set_amom_bbox (which still uses LOCAL)
was not.
We now correctly fill the flux and uncertainty fields, and no longer
create fields to save uncertainty on xy4 or the centroid.
We can reduce some boilerplate by templating on the image type rather than
the pixel type with explicit overloads for Image and MaskedImage.
This gets SdssShapeImpl out of the interface that GaussianFlux depends on,
bringing us one step closer to getting rid of it.

This also addresses a problem with GaussianFlux overestimating its errors;
instead of relying on the calc_fisher routine in SdssShape for that, we
now estimate it directly from propagation of errors for flux only.  This
is a difference in philosophy as well as implementation, as calc_fisher
attempted to propagate uncertainty in the moments into the uncertainty
in the flux, but from GaussianFlux's perspective the moments are held
fixed.
This change weaks several test thresholds to pass with
typical (rather than "lucky") random number generator seeds,
while tightening others as much as possible to meet the
same criteria.
This was a holdover from SDSS, where this 4th moment
could be used as an input to a higher-level algorithm
to estimate PSF-corrected ellipticities from the
second moments.  It has now been completely superseded
by the HSM shape package.
Prior to this change the "careful" parameter had no effect, which
appeared to be a bug.  After fixing this, the results - as tested on
the stack demo package - were clearly worse, in the sense that objects
that previously had reasonable moments had moments that were smaller
than the PSF.  So, instead, I'm just removing that option entirely,
which preserves the old behavior while removing the faulty logic.
I haven't cleaned this up as much as I could have (by e.g. moving
the code getAdaptiveMoments directly into
SdssShape::computeAdaptiveMoments), because I felt preserving
the connection to past versions of the code was more important.
Ultimately, we'll be replacing SdssShape with a new-from-scratch
adaptive moments algorithm, so I'm not concerned about the
long-term implications of the messy code here.
This changes results slightly in lsst_dm_stack_demo (as the the region of
pixels used in the fit can differ by 1 pixel due to different rounding).
@TallJimbo TallJimbo merged commit b1f4754 into master Mar 31, 2015
@ktlim ktlim deleted the tickets/DM-1161 branch August 25, 2018 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants