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

Read FITS image mode and size #5405

Merged
merged 1 commit into from Jun 28, 2021
Merged

Read FITS image mode and size #5405

merged 1 commit into from Jun 28, 2021

Conversation

radarhere
Copy link
Member

Helps #4054 in a minor way.

There is currently a FIXME in FitsStubImagePlugin

# FIXME: add more sanity checks here; mandatory header items
# include SIMPLE, BITPIX, NAXIS, etc.

Using the following links as references, this PR checks those header items, getting the mode and size.

http://www.astro.sunysb.edu/fwalter/AST443/fits.html

The header is a sequence of 80 character ASCII card images. Each line of the header consists of a keyword and a value; the header ends with the keyword END. A FITS header must contain certain keywords in order for the data to be interpretable. These are:

SIMPLE: =T is a simple FITS file, F otherwise
BITPIX: number of bits per word in the data
NAXIS: number of axes in the array. 0 indicates no data follows. If NAXIS > 0, there must follow a series of keywords NAXISn. where n is between 1 and NAXIS, inclusive, giving the length of each axis of the array.

https://fits.gsfc.nasa.gov/fits_primer.html

The keyword names may be up to 8 characters long... The keyword name is (usually) followed by an equals sign
...
SIMPLE = T / file conforms to FITS standard

@radarhere radarhere mentioned this pull request Apr 14, 2021
@radarhere radarhere changed the title Resolved FIXME by reading mandatory FITS header items Read FITS image mode and size Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants