Skip to content

DM-54482: Integrate PSF-shapelet subtask into calibrateImage as a donut-detector#471

Merged
laurenam merged 6 commits into
mainfrom
tickets/DM-54482
May 12, 2026
Merged

DM-54482: Integrate PSF-shapelet subtask into calibrateImage as a donut-detector#471
laurenam merged 6 commits into
mainfrom
tickets/DM-54482

Conversation

@laurenam
Copy link
Copy Markdown
Contributor

@laurenam laurenam commented May 5, 2026

No description provided.

@laurenam laurenam requested a review from TallJimbo May 5, 2026 20:40
@laurenam laurenam force-pushed the tickets/DM-54482 branch from f4072e6 to 3020896 Compare May 7, 2026 23:50
shapelet_summary.nShapeletStar = len(shapelet_used_cat)
centroid_diff_shapelet_vs_slot = np.sqrt(
(shapelet_used_cat["slot_Centroid_x"] - shapelet_used_cat[self.shapelet_base_name + "_x"])**2.0
+ (shapelet_used_cat["slot_Centroid_y"] - shapelet_used_cat[self.shapelet_base_name + "_y"])**2.0
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 think this is the only point at which ComputeRoughPsfShapeletsTask requires SingleFrameMeasurementTask to have been run already. What happens right now when we have a failure during measurement (especially an all-centroids-failed error)? I don't really have any great ideas for how to deal with this, but while I like including the centroid offset in the score most of the time, I don't like the idea that this stops us from computing the score when we can't centroid now.

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.

I’ve yet to hit this case, but it’s a good point! The only idea I have at the moment is to define two shapelet scores; one that only includes the non-atmospheric power and one also including the centroid offset whenever possible (and the latter could be set to nan if the centroiding in failed).

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.

Yeah, that's what I was coming around to as well. Sorry to give you another field to add, but I think that's what we ought to do.

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.

No probs. Any thoughts on naming? I was thinking of shapelets_score_non_atm & shapelets_score, with the latter being the “authoritative” one when available (I’m not sure if it’s more or less confusing to try to add more info to the name of the latter…)

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.

How about shapelets_only_iq_score and shapelets_iq_score?

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.

Ok, I've implemented a second method to compute the shapelets_iq_score after the measurement run of the PSF catalog. In doing so, it occurred to me why I never his this failure mode...I don't actually think it's possible. The reason being that the SDSS centroid algorithm has the config:

# If >0; maximum distance in pixels between the footprint peak and centroid allowed before resetToPeak flag is set.
config.star_measurement.undeblended['base_SdssCentroid'].maxDistToPeak=1.0

which, for calibrateImage is set to 1 pixel. So, if the centroider would like to wonder more than one pixel from the original peak, it reverts back to that peak. So, while this is flagged and hence formally a centroiding failure, the slot_Centroid_x & slot_Centroid_y columns always have an entry. I have not been checking for centroid flags in any of this since they are expected to be set for very non-Gaussian shapes (i.e. funky PSFs).

I do think it's a good idea to include both "scores", but I'm curious what your thoughts are on the above...

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.

Good point. I think there might be some very narrow room for NaN centroid columns - i.e. failures before the centroider runs - but I'm not surprised we don't see any of those in practice right now. But I'm also in favor of keeping both scores to hedge against that.

@laurenam laurenam force-pushed the tickets/DM-54482 branch 2 times, most recently from d74ad86 to 3c519a5 Compare May 9, 2026 23:23
@laurenam laurenam force-pushed the tickets/DM-54482 branch from 3c519a5 to a86c70e Compare May 11, 2026 19:33
@laurenam laurenam merged commit 2b1a15d into main May 12, 2026
4 checks passed
@laurenam laurenam deleted the tickets/DM-54482 branch May 12, 2026 18:43
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