Update Binospec overscan handling#2101
Open
tepickering wants to merge 8 commits intopypeit:developfrom
Open
Conversation
Replicates the IDL clean_overscan_vector function from bino_mosaic.pro: median-filter the 1D overscan vector, sigma-clip outliers, and interpolate over rejected pixels. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace simple median overscan with IDL bino_mosaic.pro approach: - Y-axis first, then X-axis (was X-first) - Sigma-clipped mean (resistant_mean) instead of simple median - Uses both prescan and postscan regions for X-axis (was prescan only) - Outlier cleaning via clean_overscan_vector on each 1D vector Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Store degree-4 polynomial coefficients from IDL calibration file (scicam_bino_sep2017.fits) as a class attribute on MMTBINOSPECSpectrograph and apply correction in binospec_read_amp() after overscan subtraction, matching the IDL pipeline order (overscan -> nonlinearity -> gain). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…arity Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
profxj
approved these changes
Apr 6, 2026
Collaborator
profxj
left a comment
There was a problem hiding this comment.
nice nice; not much to say other than that
| ax.legend() | ||
|
|
||
|
|
||
| def clean_overscan_vector(overscan, w=9, nsig=1.0, rdnoise=4.0): |
Collaborator
There was a problem hiding this comment.
should this go into a module in core/?
e.g. procimg.py ?
Collaborator
Author
There was a problem hiding this comment.
yeah, it's standalone and generally applicable. do that here or in a future PR?
Relocate the overscan cleaning helper from the Binospec spectrograph module to core/procimg.py so it can be reused by other spectrographs, as suggested in pypeit#2101 (review comment r3042223628). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…into binospec_overscan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR brings the overscan handling for Binospec into alignment with what the official IDL pipeline does. It also ports over the non-linearity correction that the IDL pipeline does.