Skip to content

Fix wforms reporting binned instead of unbinned pixel dimensions#164

Merged
StuartLittlefair merged 2 commits into
masterfrom
copilot/fix-wforms-output-binned-data
Mar 10, 2026
Merged

Fix wforms reporting binned instead of unbinned pixel dimensions#164
StuartLittlefair merged 2 commits into
masterfrom
copilot/fix-wforms-output-binned-data

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 19, 2026

ucam.Rhead.wforms was emitting window nx/ny in binned pixels, but udriver/usdriver GUIs expect unbinned pixel coordinates.

Changes

  • hipercam/ucam.py: In the wforms construction for both ULTRACAM and ULTRASPEC modes, multiply the binned window dimensions by their respective binning factors to recover unbinned values:
# Before (binned)
nx = wl.nx
ny = wl.ny

# After (unbinned)
nx = wl.nx * wl.xbin
ny = wl.ny * wl.ybin

hcam.Rhead.wforms is unaffected — it reads NX/NY directly from raw FITS header keywords, which are already in unbinned pixels.

Original prompt

This section details on the original issue you should resolve

<issue_title>WFORMS not showing the correct output for binned data</issue_title>
<issue_description>The wforms property of ucam.Rhead and hcam.Rhead are supposed to match the input expected in the instrument GUIs hdriver and udriver.

However, as pointed out by @pkerry in HiPERCAM/hcam_obsutils#1, the GUIs take values in unbinned pixels whereas wforms prints out nx and ny in binned pixels.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: StuartLittlefair <4570807+StuartLittlefair@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix wforms output for binned data in instrument GUIs Fix wforms reporting binned instead of unbinned pixel dimensions Feb 19, 2026
@StuartLittlefair StuartLittlefair marked this pull request as ready for review March 10, 2026 10:21
@StuartLittlefair StuartLittlefair merged commit 69a7c9c into master Mar 10, 2026
2 checks passed
@StuartLittlefair StuartLittlefair deleted the copilot/fix-wforms-output-binned-data branch March 10, 2026 10:22
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.

WFORMS not showing the correct output for binned data

2 participants