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 7976 #81

Merged
merged 2 commits into from Oct 15, 2016
Merged

Tickets/dm 7976 #81

merged 2 commits into from Oct 15, 2016

Conversation

r-owen
Copy link
Contributor

@r-owen r-owen commented Oct 14, 2016

No description provided.

from lsst.afw.math import ChebyshevBoundedField
from lsst.pipe.tasks.coaddInputRecorder import CoaddInputRecorderTask

SaveCoadd = False # if True then save coadd even if test passes (always saved if a test fails)
Copy link
Member

Choose a reason for hiding this comment

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

Could this lead to problems if the test fails for some new reason, and then confusingly continues to fail because the committed test data file has been overwritten by something incorrect?

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 don't think so, because the coadd is always written before being read.



class CoaddInputsTestCase(lsst.utils.tests.TestCase):
def setUp(self):
Copy link
Member

Choose a reason for hiding this comment

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

Need an empty line before this one, right?

"""Make a simple mock exposure suitable to put in a coadd

The metadata is set, but not the pixels
"""
Copy link
Member

Choose a reason for hiding this comment

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

Reads line a method doc, not a class doc; maybe "Helper class for making simple mock exposures..." I also think you need an empty line after it.

else:
print("SaveCoadd true; saved coadd as: %r" % (coaddPath,))

def xtestReadV1Coadd(self):
Copy link
Member

Choose a reason for hiding this comment

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

Unintentionally disabled?

if version > 1:
self.assertEqual(visit.getVisitInfo(), expInfo.getVisitInfo())
else:
self.assertFalse(visit.getVisitInfo().getDate().isValid())
Copy link
Member

Choose a reason for hiding this comment

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

Just a reminder that if you do change the code in afw to make this an empty pointer, you'll want to change this line too (to check that getVisitInfo() is 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.

Yes, I did realize that. And it improves the test.


def assertCoaddInputsOk(self, coaddInputs, version):
self.assertIsNotNone(coaddInputs)
visitTable = coaddInputs.visits
Copy link
Member

Choose a reason for hiding this comment

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

If you're going to test just one of these, it should be ccds, not visits; most of these quantities in the visits table come from the coaddTempExp, which is probably better than setting them to None but might still be confusing in some cases (e.g. "the visit WCS is the same as the coadd WCS"). The ccds table is what corresponds to what is in a calexp, and that's what most people will want to look at and hence what we want to make sure doesn't regress.

Copy link
Contributor Author

@r-owen r-owen Oct 14, 2016

Choose a reason for hiding this comment

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

Fair enough. It's a delicate point because I'm not actually making these from coaddTempExp, but directly from exposures with their own VisitiInfo. Presumably they will be identical, so I'll apply the same test to both.

It was not saving Psf, Wcs, ValidPolygon and VisitInfo.
Add a unit test for this, including a test for
reading version 1 CoaddInput/ExposureTable.
@r-owen r-owen merged commit eff8975 into master Oct 15, 2016
@ktlim ktlim deleted the tickets/DM-7976 branch August 25, 2018 06:46
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

2 participants