Skip to content

DM-54194: Add second moment in sky /AltAz and fgcm phot for PSF single visit table#1263

Open
PFLeget wants to merge 1 commit intomainfrom
tickets/DM-54194
Open

DM-54194: Add second moment in sky /AltAz and fgcm phot for PSF single visit table#1263
PFLeget wants to merge 1 commit intomainfrom
tickets/DM-54194

Conversation

@PFLeget
Copy link
Copy Markdown
Contributor

@PFLeget PFLeget commented Feb 20, 2026

Adding optional information to write in PSF table for analysis.

Copy link
Copy Markdown

@kklaliotis kklaliotis left a comment

Choose a reason for hiding this comment

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

I double-checked the conversions here and they all agreed with what I was doing before.

I think the only change I'd maybe make is making the new column names align a little better with the current versions of the catalog columns. For instance, the "I" has mostly been removed so source moments are called slot_Shape_xx now. So then I would maybe include the sky coords moments as slot_Shape_uu. The alt-az labels are a bit clunky but I think for the sake of clarity I'd leave them essentially as they are, just again omitting the I to be eg. slot_Shape_altalt . Similarly I'd shift the naming convention for psf shape columns to match the others with PsfShape now instead of psfShape .

But I think overall the actual implementation looks good!

Copy link
Copy Markdown

@rmjarvis rmjarvis left a comment

Choose a reason for hiding this comment

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

I don't thnk the formulae are quite right.

@rmjarvis
Copy link
Copy Markdown

Maybe also useful to look at the unit test we have in GalSim that validates that code:
https://github.com/GalSim-developers/GalSim/blob/releases/2.8/tests/test_hsm.py#L204

@arunkannawadi
Copy link
Copy Markdown
Member

@PFLeget - is this something that you're looking to backport to v30?

@rmjarvis
Copy link
Copy Markdown

Another point of concern here -- I suspect the sign of Iuv is wrong. Or at least contrary to the standard WL definition.

We typically define +v to be towards North and +u to be towards West. I.e. normal axis orientation when looking at the galaxy from Earth if North is up. The standard CD matrix in the WCS specs puts +u to the East. I.e. towards increasing RA, rather than decreasing.

It would be convenient if this routine converted the moments into the normal WL convention, rather than requiring an addition sign flip to g2 downstream of this function.

@TallJimbo
Copy link
Copy Markdown
Member

It would be convenient if this routine converted the moments into the normal WL convention, rather than requiring an addition sign flip to g2 downstream of this function.

Would it be just as good from your perspective if we applied that flip between the second moments and (g1, g2)? I'm a little wary of changing our sky axis definition for moments to be something other than the WCS definition, since those have non-lensing consumers.

@rmjarvis
Copy link
Copy Markdown

Would it be just as good from your perspective if we applied that flip between the second moments and (g1, g2)?

Up to you I guess. Personally, I find the WCS convention weird. The u,v coordinates are from the perspective of God looking through the universe down at Earth. But whatever you find appropriate I suppose.

@PFLeget
Copy link
Copy Markdown
Contributor Author

PFLeget commented Feb 26, 2026

@arunkannawadi I would love to, but I am not sure if this is ok. If I can add those column like that this is available for everyone latter on, it would be great for PSF tests. I will make a run anyway at least for me on DP2 to have access and move forward in digging in DP2.

@PFLeget PFLeget force-pushed the tickets/DM-54194 branch 2 times, most recently from e079262 to 94e5a1c Compare February 26, 2026 20:14
if not self.config.psf_determiner['piff'].useColor:
# Keep fgcm_standard_star if using chromatic PSF OR if adding FGCM photometry
needs_fgcm = (self.config.psf_determiner['piff'].useColor
or self.config.doAddFgcmPhotometry)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

From what I can see, super().__init__ is a no-op and doesn't make config an attribute. Replace self.config with config.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But this is working as is now. Shall I change it?

ivv[i] *= deg2_to_arcsec2
iuv[i] *= deg2_to_arcsec2

return iuu, ivv, iuv
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Given the confusion we've had, it would be useful to have this in a unit test, similar to the one that Colin had in #1273 .

doAddFgcmPhotometry = pexConfig.Field(
dtype=bool,
default=True,
doc="Add FGCM photometry for all bands (u,g,r,i,z,y) to the output table.",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove the list of bands from here.

@PFLeget PFLeget force-pushed the tickets/DM-54194 branch 2 times, most recently from 67aa170 to 58171a6 Compare March 25, 2026 14: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.

7 participants