Skip to content

Fix HSC zeropoint decoding inverse - #70

Merged
tom-hehir merged 2 commits into
mainfrom
fix/hsc-decoding
Aug 31, 2026
Merged

Fix HSC zeropoint decoding inverse#70
tom-hehir merged 2 commits into
mainfrom
fix/hsc-decoding

Conversation

@tom-hehir

Copy link
Copy Markdown
Member

Summary

  • make HSC decoding multiply by the same 27.0 zeropoint flux scale used during encoding
  • avoid passing a Python float to torch.log10 through reverse_zeropoint
  • add focused HSC scale, forward/backward round-trip, and non-HSC identity regression tests

Forward preprocessing divides flux by convert_zeropoint(27.0). The exact inverse is multiplication by that same scale; reverse_zeropoint instead converts a scale into a zeropoint and is not the inverse flux operation.

Validation

  • .venv/bin/pytest tests/codecs/test_image_codec.py -q (13 passed)
  • pre-commit run on both changed files (all hooks passed)
  • git diff --check

@tom-hehir tom-hehir left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

LGTM

@tom-hehir
tom-hehir merged commit b024b31 into main Aug 31, 2026
1 of 3 checks passed
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.

1 participant