esheldon / fitsio

A python package for FITS input/output wrapping cfitsio
GNU General Public License v2.0
134 stars 58 forks source link

Should BUNIT be cleaned from the header? #75

Closed esheldon closed 8 years ago

esheldon commented 9 years ago

Generally, are there keywords being cleaned that should be kept?

esheldon commented 9 years ago

The motivation of cleaning is to prevent special keywords from getting over-written, such as column defs or compression keywords

esheldon commented 9 years ago

I think the following keywords should not be cleaned for images

bunit, bscale, bzero

but they should be cleaned for tables, since fitsverify doesn't like them

http://heasarc.gsfc.nasa.gov/docs/software/ftools/fitsverify/

esheldon commented 9 years ago

Current master implements this, but I would like to hear from others

jamiefarnes commented 8 years ago

Hi, I'm currently processing some images, and reading/writing using fitsio. The BUNIT is an important header attribute for this (giving units Jy/beam, which other software uses for scaling), but this is currently wiped when writing with fitsio.write. Currently trying to find a workaround, to keep the header intact. Cheers

esheldon commented 8 years ago

I thought these would only be cleaned from tables. What version of fitsio are you using?

You can also turn off cleaning with clean=False

jamiefarnes commented 8 years ago

Hi Erin, Thank you for the fast reply. Update to latest version and adding clean=False fixed everything. Cheers

esheldon commented 8 years ago

Since this required clean=False, I take it you are working with tables since BUNIT is not cleaned from images. Can you give some insight into how BUNIT is being used in a table?

jamiefarnes commented 8 years ago

I think the clean=False was not necessary here, as working with images. Likely the version update alone fixed everything. Thanks very much for your help.