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

Fix bug in fiber aperture correction that affects cframe IVAR #2452

Merged
merged 1 commit into from
Mar 11, 2025

Conversation

rongpu
Copy link
Contributor

@rongpu rongpu commented Mar 11, 2025

The calibration vector ccalibration is normalized by the fiber aperture correction factor FLAT_TO_PSF_FLUX (point_source_correction in the code), but its inverse variance was not normalized accordingly. This PR fixes that.

I tested the new code on a B camera for a dark tile. For most fibers with good fiber positioning (FIBERSTATUS==0), the effect should be negligible (less than 1% change in the average cframe IVAR). However, for very bright sources (standard stars and particularly bright galaxies), the new IVAR can be on average ~40% lower.

The largest effect is on the stuck positioners used as sky fibers. They have particularly large FLAT_TO_PSF_FLUX due to their large DELTA_X/Y, and combined with this bug their IVARs are much underestimated. For example, below is the signal-to-noise (flux * np.sqrt(ivar)) of a sky spectrum from such a stuck positioner (fiber 179 of exposure 235175; it is 140 micron "off target" and it has FLAT_TO_PSF_FLUX of ~28 compared to the typical value of ~0.7). As expected, the distribution becomes a standard Gaussian with the fix.

image

image

The calibration vector (ccalibration) is normalized by the fiber aperture correction factor (point_source_correction), but its inverse variance was normalized. This PR fixes that.
@rongpu rongpu requested a review from julienguy March 11, 2025 22:58
@coveralls
Copy link

Coverage Status

coverage: 38.995% (+0.001%) from 38.994%
when pulling 7102957 on ccalibivar-fix
into e033a8c on main.

Copy link
Contributor

@julienguy julienguy left a comment

Choose a reason for hiding this comment

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

Good catch. I note that this correction affects the uncertainty on the calibration vectors that is a small contribution to the total uncertainty for most targets. It's only affecting the brightest sources where the calibration error starts to matter, and peculiar fibers where we make a huge fiber aperture loss correction.

@julienguy julienguy merged commit 0d7d1f2 into main Mar 11, 2025
26 checks passed
@julienguy julienguy deleted the ccalibivar-fix branch March 11, 2025 23:20
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.

3 participants