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-19768: Fix jointcal handling of coordinate errors #143

Merged
merged 5 commits into from May 29, 2019

Conversation

parejkoj
Copy link
Collaborator

No description provided.

The astrometry/photometry name passed to _do_load_refcat_and_fit() used to be
capitalized, but that changed long ago. Either way, I should have made the
comparisons against the name use .lower() to catch both cases. This should
fix a few bugs that are not properly exercised by the jointcal tests.
The reference selectors were being set by the caller; these lines were just
wrong (it should have been self.X, not self.config.X)!
referenceSelector = self.config.astrometryReferenceSelector
elif name == "Photometry":
referenceSelector = self.config.photometryReferenceSelector
applyColorterms = False if name.lower() == "astrometry" else self.config.applyColorTerms
Copy link
Contributor

Choose a reason for hiding this comment

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

Should you do a validate on the astrometryReferenceSelector such that its colorLimits is an empty dict (the default) since you are not applying color terms? (also, the magLimit, if used, would be in the native reference catalog filter bandpass, which may either be desired or cause confusion?! ) I think you are relying on the defaults all being set to False in ReferenceSourceSelectorConfig, but these could change from underneath you.

Also, in your validate function at line 324, should you add a and self.doPhotometry clause since you don't need colorTerms if you're not doing photometric calibration. Also, you might want to warn if you're only fitting for astrometry but applyColorTerms is set to True (to let the user know that the fluxes are not being translated into the camera's filter bandpasses...they could conceivably be used within the ReferenceSourceSelectorTask). The default being False for applyColorTerms makes it a mismatch an unlikely scenario at present -- but, again, defaults can get changed.

Copy link
Contributor

Choose a reason for hiding this comment

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

So this was just not bombing because of the capitalization in name?! Also, should refObjLoader and referenceSelector both be required parameters to _do_load_refcat_and_fit since having them as None is not really an option. Oh, and I don't see referenceSelector in the docstring's Parameters list.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I'm going to leave mucking around with validate until after some progress has been made on planning the new refcat flux system. I added the self.doPhotometry/self.doAstrometry checks since those didn't require any assumptions about the selector.

Yeah, the mis-capitalization was causing that clause to not trigger, and thus not explode. The person who wrote it (me) was dumb.

Good call on making those required parameters. I've made them required named parameters, using the new python3 syntax for that, and cleaned up the docstrings.

Copy link
Contributor

Choose a reason for hiding this comment

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

While I must take serious issue with the 2nd sentence of the 2nd paragraph above, I accept you position on validation... 😉

Review comments suggested clarifications in config validation, since
colorterms are only applied for photometry.
@parejkoj parejkoj merged commit dae4c4a into master May 29, 2019
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