FITS table documentation uses non-standard FITS unit
See original GitHub issueDescription
While reading the documentation about fits table data, I noticed that there is a non-standard unit used: https://github.com/astropy/astropy/blame/main/docs/io/fits/usage/table.rst#L346
>>> col2 = fits.Column(name='counts', format='J', unit='DN', array=counts)
Expected behavior
I’d expect that the documentation sticks to the standard.
Actual behavior
DN
is not a standard FITS unit, and even not directly supported by astropy.units
. For example, the following does not work:
counts = [0., 1.]
col2 = fits.Column(name='counts', format='J', unit='DN', array=counts)
tbl = QTable([col2])
It may sound nitpicking, but we should not encourage people to use phantasy units. The name “counts” would suggest as unit count
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
FITS File Handling (astropy.io.fits)
An HDU (Header Data Unit) is the highest level component of the FITS file structure, consisting of a header and (typically) a data...
Read more >Definition of the Flexible Image Transport System ... - NASA FITS
groups structure, the image extension, the ASCII table extension, and the binary table extension. ... ple, using a non-standard keyword, is.
Read more >astropy.io.fits FAQ
The astropy. io. fits module (originally PyFITS) is a “pure Python” FITS reader in that all the code for parsing the FITS file...
Read more >Getting started with the nom.tam.fits library. - GitHub
FITS, the Flexible Image Transport System, is the format commonly used in the archiving and transport of astronomical data. This document assumes a...
Read more >web.mit.edu/12.410/idl_libs/old/SourceCode/text/fi...
... on a FITS file. and can be used with either binary or ASCII tables. ... convert between FITS tables and IDL structures,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@olebole , are you interested in submitting a PR? 😸
DN
are not fantasy units, though it does seem that they exist in some parallel, mystical place, not of this earth. Most HST, JWST and lots of Spitzer science data useDN
to indicatecounts
. That’s why that unit was added toastropy.units
(currently unreleased), so that the data from these telescopes could be read in easily as aQuantity
.Agree that the example in the docs should use a FITS standard unit. Just because there’s lots of existing (and soon-to-exist) data using DN, doesn’t mean we should encourage its use.
What does it mean? Some say Data Number. Some say Dumb Number. (h.t. @eslavich)
The history is that
astropy.io.fits
came viapyfits
from STScI where DN was and is common usage for counts amongst the scientists and engineers, and all that pre-dated any standard for a count unit from the FITS working group. FITS had no standard for units of counts up through 2005, and only adoptedcount
,ct
oradu
in 2008.So yeah, let’s change the documentation example.