[AstroPy] Fwd: A question about reading fits table.

Eric L. N. Jensen ejensen1 at swarthmore.edu
Wed Mar 20 13:35:04 EDT 2019


Hello, 

That error is saying that one of your columns (in this case it must be UVW2) says in the column header that it contains floating-point (numerical) data, but that one of the entries in that column doesn’t contain a number, but instead contains the string ‘  ---‘ and the code doesn’t know how to convert that string into a number. 

It might be the case that whatever software wrote that FITS table used that string to denote missing values in the table.  You should look at the FITS-reading routine you’re using and see if there is a way to tell it how to handle missing values in the data. 

Hope this helps,

Eric


> On Jan 20, 2019, at 7:55 AM, 赵赫 <astronomyhz at gmail.com> wrote:
> 
> Dear members,
> 
> I'm a PhD student on Diffuse Interstellar Bands (DIBs).
> I experienced a problem when I tried to get data from a fits table.
> 
> The read in code:
> `hdu1 = fits.open()`
> `data = hdu1[1].data`
> A warning occurred,
> "WARNING: VerifyWarning: It is strongly recommended that column names contain only upper and lower-case ASCII letters, digits, or underscores for maximum compatibility with other software (got '---'). [astropy.io.fits.column]"
> 
> The columns of the data is like:
> <err1.PNG>
> 
> When I accessed the data with `data[0]`, I met an error:
> <Capture.PNG>
> <Capture.PNG>
> This also occurred when I got the column `data['UVW2'], but I successfully accessed to the columns like 'Name' and 'RAdeg' in the data.
> 
> I don't what causes this error and can't solve it.
> If you have some comments, please contact me.
> 
> Best regards,
> He Zhao
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org
> https://mail.python.org/mailman/listinfo/astropy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3932 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/astropy/attachments/20190320/c4d528c9/attachment.bin>


More information about the AstroPy mailing list