Skip to content

Update Binospec overscan handling#2101

Open
tepickering wants to merge 8 commits intopypeit:developfrom
tepickering:binospec_overscan
Open

Update Binospec overscan handling#2101
tepickering wants to merge 8 commits intopypeit:developfrom
tepickering:binospec_overscan

Conversation

@tepickering
Copy link
Copy Markdown
Collaborator

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.

tepickering and others added 5 commits April 5, 2026 23:05
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 profxj requested review from kbwestfall and profxj April 6, 2026 21:16
Copy link
Copy Markdown
Collaborator

@profxj profxj left a comment

Choose a reason for hiding this comment

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

nice nice; not much to say other than that

Comment thread pypeit/spectrographs/mmt_binospec.py Outdated
ax.legend()


def clean_overscan_vector(overscan, w=9, nsig=1.0, rdnoise=4.0):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should this go into a module in core/?

e.g. procimg.py ?

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.

yeah, it's standalone and generally applicable. do that here or in a future PR?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This PR, please

Thanks!

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.

ok, done.

tepickering and others added 3 commits April 7, 2026 16:21
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>
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