Skip to content

Add support for photometry error - #123

Merged
aguinot merged 7 commits into
mainfrom
photerr
Sep 23, 2026
Merged

aguinot merged 7 commits into
mainfrom
photerr

Conversation

@aguinot

@aguinot aguinot commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

We add support to compute Photometry Error using the python package PhotErr. This is principally useful to get catalogue level simulations of the NISP bands for which we are not making images. Several assumptions are mad here so the results are to be taken with a grain of slat.

We add support to compute Photometry Error using the python package PhotErr. This is principally useful to get catalogue level simulations of the NISP bands for which we are not making images. Several assumptions are mad here so the results are to be taken with a grain of slat.
@aguinot

aguinot commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator Author

This PR replace the previous PR #73 and solve the issue #69

@rmandelb
rmandelb self-requested a review July 29, 2026 14:22

@rmandelb rmandelb left a comment

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.

Just a few comments and questions

Comment thread config/was.yaml
J: 24.56
H: 24.42
theta:
VIS: 0.203

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.

I know (or think I know) what these numbers are, but since they are mysteriously named I suggest an inline comment defining theta and saying where the numbers come from.

Comment thread config/was.yaml
VIS:
type: Eval
str: 'euclidlike.gain'
Y: 1.

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.

Is the idea that we can just set gain=1 rather than attempting to use a real value because we're not simulating images, only catalogs? Here too, maybe an inline comment for posterity could be helpful.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not exactly, according to Euclid documentation here:

The imaging and rms data have, depending on the provenience, different units with:
VIS in [ADU/sec]
NIR in [electrons]
EXT in arbitrary units

VIS coadds are in unit of ADU so we use the gain. But NISP are in unit of electron so the gain is already applied.

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.

OK, makes sense, but a pointer to those docs in a comment could be helpful in future

Comment thread config/was.yaml
gal_disk_hlr: { type: SkyCatValue, field: diskHalfLightRadiusArcsec }
gal_disk_e1: { type: SkyCatValue, field: diskEllipticity1 }
gal_disk_e2: { type: SkyCatValue, field: diskEllipticity2 }
gal_disk_g1: { type: SkyCatValue, field: diskEllipticity1 }

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.

Is this part of the PR renaming columns for the output catalog and changing what info is in the output catalog? It seems distinct from the NISP photometry stuff that motivated the PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good point, the column were wrongly named as we are getting g and not e. I changed the name to avoid confusion and also because I defined g1_bulge and g1_disk for the photometry error so I just included here for simplicity. I could make a separate PR if you think it is necessary.

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.

No, I was just checking my understanding. I don't think it's worth breaking out into a separate PR

Comment thread config/was.yaml Outdated
g1_bulge: "@output.truth.columns.gal_bulge_g1"
g2_bulge: "@output.truth.columns.gal_bulge_g2"
hlr_bulge: "@output.truth.columns.gal_bulge_hlr"
BTT: "@output.truth.columns.bulge2total_VIS"

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.

I was wondering why we were using bulge2total_VIS when this part of the code is about the J magnitude -- shouldn't we be using the bulge to total ratio in J? (same issue occurs in some other places)

First component of the ellipticity of the disk component.
g2_disk : float
Second component of the ellipticity of the disk component.
BTT : float

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.

I don't fully understand how we can define the function this way. For the models in DiffSky, the bulge and disk shapes are band-independent, but BTT is band-dependent, right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think this likely not the dominant effect here as I think the formulation is only correct for a mixture of gaussian not an exponential and De Vaucouleur profile. The goal here is only to construst an effecftive ellipse as PhotErr do not handle Bulge+Disk but only ellipses.
But I think it is ok-ish in the sense that even if g1/g2 are band-independent due to variation of BTT per band the "effective" profile will vary per band. So I would say that this is a strong approximation but not completely wrong?

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.

OK. So maybe just a good thing to document in a comment for the sake of posterity.

Comment thread euclidlike_imsim/photometry_error.py Resolved
Comment thread euclidlike_imsim/photometry_error.py Resolved
Comment thread euclidlike_imsim/photometry_error.py Resolved
minor_, major_, g1_, g2_, hlr_, g1_disk_, g2_disk_, hlr_disk_, g1_bulge_, g2_bulge_, hlr_bulge_, BTT_
):
"""
Prepare the inputs for the photometric error calculation.

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.

comment on any requirements on units for inputs, for those that are dimensionful?

aguinot and others added 3 commits July 30, 2026 01:19
Co-authored-by: Rachel Mandelbaum <rmandelb@andrew.cmu.edu>
Co-authored-by: Rachel Mandelbaum <rmandelb@andrew.cmu.edu>
Co-authored-by: Rachel Mandelbaum <rmandelb@andrew.cmu.edu>

@rmandelb rmandelb left a comment

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.

Since my remaining feedback is about documentation/comments, I am hitting "approve". I'm leaving for vacation and do not want to block you from merging this once you think it's ready.

@aguinot
aguinot merged commit 4087607 into main Sep 23, 2026
2 checks passed
@aguinot
aguinot deleted the photerr branch September 23, 2026 14:45
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.

2 participants