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-35496: Update coord columns per reevaluated WCS #698

Merged
merged 2 commits into from Jul 13, 2022
Merged

Conversation

yalsayyad
Copy link
Contributor

No description provided.

Copy link
Contributor

@cmsaunders cmsaunders left a comment

Choose a reason for hiding this comment

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

I have a couple questions, but I'm not sure how valid they are.

@@ -673,6 +673,9 @@ def addCalibColumns(self, catalog, exposure, exposureIdInfo, **kwargs):
newCat = afwTable.SourceCatalog(schema)
newCat.extend(catalog, mapper=mapper)

if self.config.doReevaluateSkyWcs:
Copy link
Contributor

Choose a reason for hiding this comment

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

It took me a little while to track down the difference between doApplyExternalSkyWcs and doReevaluateSkyWcs--would it be worth clarifying in the docs that the former updates the wcs of the exposure while the latter updates the coordinates of the input catalog, if I am interpreting correctly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • doReevaluateSkyWcs tells it whether or not to update the WCS in the source table at all.
  • IFF that's true, doApplyExternalSkyWcs tells it whether to use calexp.wcs or jointcal.
  • IFF that's that's true, useGlobalExternalSkyWcs tells it whether to use jointcal-global or jointcal-tract.

doApplyExternalSkyWcs+useGlobalExternalSkyWcs here means the thing as all the other Tasks that decide whether to get their WCS from the calexp, jointcal tract-mode, or jointcal global-mode (i.e. makeWarp, ForcedPhotCcd and faro). I find the control structure that you find in every __init__ of Configs that have a doApplyExternalSkyWcs super confusing, hate it, and hope that one day when you make gbdes an option that you find a good replacement for doApplyExternalSkyWcs+useGlobalExternalSkyWcs everywhere.

I opted for consistency.

to help, I'll add a line to the docstring of doApplyExternalSkyWcs "Used if and only if doReevaluateSkyWcs"

@@ -673,6 +673,9 @@ def addCalibColumns(self, catalog, exposure, exposureIdInfo, **kwargs):
newCat = afwTable.SourceCatalog(schema)
newCat.extend(catalog, mapper=mapper)

if self.config.doReevaluateSkyWcs:
afwTable.updateSourceCoords(exposure.wcs, newCat)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need to have a corresponding statement for self.config.doReevaluatePhotoCalib?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, and I'll drop an inline comment on why not.

@yalsayyad yalsayyad merged commit d06e05c into main Jul 13, 2022
@yalsayyad yalsayyad deleted the tickets/DM-35496 branch July 13, 2022 23:21
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