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

Refurbish savefits to fix #16 #17

Merged
merged 1 commit into from
Sep 8, 2023
Merged

Refurbish savefits to fix #16 #17

merged 1 commit into from
Sep 8, 2023

Conversation

DasVinch
Copy link
Member

@DasVinch DasVinch commented Aug 30, 2023

This fixes #16 and preserves the uint16 fix introduced at 50e68a8.

@oguyon please review and merge. @mileslucas for the chuckles.

The FITS standard defines that TBYTE operates on a canonical BZERO=0, but that TSBYTE is offset with BZERO=-128. Which is contrary to the signed/unsigned behavior on other integer lengths.

This creates a quirk where BZERO needs in some case to be negative, in other larger than the largest possible signed integer...
BZERO also can't afford to be float because that sometimes causes a forced cast into float when reading the data with astropy, preventing from accessing the natural data with astropy.

So, BZERO becomes an integer type. Which puts us out of compliance with the Subaru FITS requirement that BZERO if float.

@DasVinch DasVinch requested a review from oguyon August 30, 2023 03:09
@DasVinch DasVinch self-assigned this Aug 30, 2023
@DasVinch DasVinch changed the title Refurbish savefits to fix #15 Refurbish savefits to fix #16 Aug 30, 2023
@DasVinch DasVinch merged commit 3cd42dd into dev Sep 8, 2023
2 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.

saveFITS does fail for uint8_t images
1 participant