固定符合FITS标准的卡意味着什么? [英] What does it mean that a card is fixed to meet FITS standard?

查看:86
本文介绍了固定符合FITS标准的卡意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用FITS文件.我有以下代码:

I am trying to use a FITS file. I have the following code:

from astropy.io import fits
from astropy.wcs import WCS

hdul = fits.open(fitsfilename)[0]

wcs = WCS(hdul.header)

它给了我这些警告:

警告:Verify警告:验证报告的错误: [astropy.io.fits.verify]警告:VerifyWarning:卡"A_2_0"不是 FITS标准(无效值字符串:'3.29341755408e-05').固定的 符合FITS标准的"A_2_0"卡. [astropy.io.fits.verify] 警告:Verify警告:注意:astropy.io.fits使用从零开始 索引. [astropy.io.fits.verify]警告:Verify警告:卡 "A_1_1"不是FITS标准(无效值字符串: '1.51709339878e-05').修复了"A_1_1"卡符合FITS标准的问题. [astropy.io.fits.verify]警告:VerifyWarning:卡"A_0_2"不是 FITS标准(无效值字符串:"5.17973753556e-06").固定的 符合FITS标准的"A_0_2"卡. [astropy.io.fits.verify] 警告:验证警告:卡"B_2_0"不是FITS标准(无效 值字符串:"2.97627426087e-06").修复了'B_2_0'卡可以满足 FITS标准. [astropy.io.fits.verify]警告:Verify警告:卡 "B_1_1"不是FITS标准(无效值字符串: '2.71948126373e-05').修复了"B_1_1"卡符合FITS标准的问题. [astropy.io.fits.verify]警告:VerifyWarning:卡"B_0_2"不是 FITS标准(无效值字符串:"1.66848449653e-05").固定的 符合FITS标准的"B_0_2"卡. [astropy.io.fits.verify] 警告:验证警告:卡"AP_1_0"不是FITS标准(无效 值字符串:"1.79541533196e-06").固定了"AP_1_0"卡以满足 FITS标准. [astropy.io.fits.verify]警告:Verify警告:卡 "AP_0_1"不是FITS标准(无效值字符串: '9.20624843151e-07').修复了"AP_0_1"卡符合FITS标准的问题. [astropy.io.fits.verify]警告:VerifyWarning:卡"AP_2_0"不是 FITS标准(无效值字符串:'-3.29292923201e-05').固定的 符合FITS标准的"AP_2_0"卡. [astropy.io.fits.verify] 警告:VerifyWarning:卡"AP_1_1"不是FITS标准(无效 值字符串:-1.51738446887e-05").修复了"AP_1_1"卡可以满足 FITS标准. [astropy.io.fits.verify]警告:Verify警告:卡 "AP_0_2"不是FITS标准(无效值字符串: '-5.18321445978e-06').修复了"AP_0_2"卡符合FITS标准的问题. [astropy.io.fits.verify]警告:VerifyWarning:卡"BP_1_0"不是 FITS标准(无效值字符串:'8.99029048217e-07').固定的 符合FITS标准的"BP_1_0"卡. [astropy.io.fits.verify] 警告:验证警告:卡"BP_0_1"不是FITS标准(无效 值字符串:"1.15967736014e-06").修复了"BP_0_1"卡可以满足 FITS标准. [astropy.io.fits.verify]警告:Verify警告:卡 "BP_2_0"不是FITS标准(无效值字符串: '-2.97837492348e-06').固定了"BP_2_0"卡以符合FITS标准. [astropy.io.fits.verify]警告:VerifyWarning:卡"BP_1_1"不是 FITS标准(无效值字符串:-2.71998518336e-05").固定的 符合FITS标准的"BP_1_1"卡. [astropy.io.fits.verify] 警告:VerifyWarning:卡"BP_0_2"不是FITS标准(无效 值字符串:-1.66872388359e-05").修复了"BP_0_2"卡满足 FITS标准. [astropy.io.fits.verify]警告:Verify警告:卡 "WCSR_PRJ"不是FITS标准(无效值字符串:"3.6679e-07"). 修复了"WCSR_PRJ"卡符合FITS标准的问题. [astropy.io.fits.verify]警告:VerifyWarning:卡"WCSR_PIX"为 不是FITS标准(无效值字符串:'8.2565e-05').固定的 "WCSR_PIX"卡符合FITS标准. [astropy.io.fits.verify]

WARNING: VerifyWarning: Verification reported errors: [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'A_2_0' is not FITS standard (invalid value string: '3.29341755408e-05'). Fixed 'A_2_0' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Note: astropy.io.fits uses zero-based indexing. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'A_1_1' is not FITS standard (invalid value string: '1.51709339878e-05'). Fixed 'A_1_1' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'A_0_2' is not FITS standard (invalid value string: '5.17973753556e-06'). Fixed 'A_0_2' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'B_2_0' is not FITS standard (invalid value string: '2.97627426087e-06'). Fixed 'B_2_0' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'B_1_1' is not FITS standard (invalid value string: '2.71948126373e-05'). Fixed 'B_1_1' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'B_0_2' is not FITS standard (invalid value string: '1.66848449653e-05'). Fixed 'B_0_2' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'AP_1_0' is not FITS standard (invalid value string: '1.79541533196e-06'). Fixed 'AP_1_0' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'AP_0_1' is not FITS standard (invalid value string: '9.20624843151e-07'). Fixed 'AP_0_1' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'AP_2_0' is not FITS standard (invalid value string: '-3.29292923201e-05'). Fixed 'AP_2_0' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'AP_1_1' is not FITS standard (invalid value string: '-1.51738446887e-05'). Fixed 'AP_1_1' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'AP_0_2' is not FITS standard (invalid value string: '-5.18321445978e-06'). Fixed 'AP_0_2' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'BP_1_0' is not FITS standard (invalid value string: '8.99029048217e-07'). Fixed 'BP_1_0' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'BP_0_1' is not FITS standard (invalid value string: '1.15967736014e-06'). Fixed 'BP_0_1' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'BP_2_0' is not FITS standard (invalid value string: '-2.97837492348e-06'). Fixed 'BP_2_0' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'BP_1_1' is not FITS standard (invalid value string: '-2.71998518336e-05'). Fixed 'BP_1_1' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'BP_0_2' is not FITS standard (invalid value string: '-1.66872388359e-05'). Fixed 'BP_0_2' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'WCSR_PRJ' is not FITS standard (invalid value string: '3.6679e-07'). Fixed 'WCSR_PRJ' card to meet the FITS standard. [astropy.io.fits.verify] WARNING: VerifyWarning: Card 'WCSR_PIX' is not FITS standard (invalid value string: '8.2565e-05'). Fixed 'WCSR_PIX' card to meet the FITS standard. [astropy.io.fits.verify]

已固定"A_2_0"卡符合FITS标准是什么意思?卡A_2_0指向的数据发生了什么?我对警告:VerifyWarning:注意:astropy.io.fits使用基于零的索引的含义也很感兴趣.

What does it mean that Fixed 'A_2_0' card to meet the FITS standard? What happened with the data to which the card A_2_0 is referring to? I am also interested in the meaning of WARNING: VerifyWarning: Note: astropy.io.fits uses zero-based indexing.

推荐答案

如注释中所述,io.fits具有用于

As already noted in the comments, io.fits has functionality for verifying the validity of headers, and will even fix minor trivial formatting errors (it tries its best to only write perfectly valid FITS files as best possible).

尽管有一些选项可用于在写文件时执行验证,但在某些情况下,它也可以在读取时执行自动验证,尤其是在解析标头时.这是一个长期存在的问题(这只是一个相关示例;有几个示例)当前没有什么好方法可以控制读取时间验证/修正.有一种更简单的方法可以将此静音或完全禁用它可能会很好.我认为这不会太难解决,我猜只是没有人有足够的动力.尽管目前,如果您希望使警告静音,则可以使用标准的 Python警告来取消警告系统.

Although there are options for how to perform verification at the time of writing out a file, there are also some cases where it performs automatic verification at read time too, particularly while parsing the headers. It's a long standing open issue (this is just one related example; there are several) that there's no great way currently to control for read-time verification / fixups. It might be nice to have an easier way to silence this, or disable it altogether. I think this would not be too hard to fix, just no one has ever been sufficiently motivated I guess. Although currently, if you wish to silence the warnings, you can do so with the standard Python warnings system.

关于警告本身的含义,我认为这可能是科学表示法中使用e而不是E的原因(FITS标准可以追溯到FORTRAN的时代,后者我认为更常见).如果消息能更好地准确解释其修复内容,那就太好了.

With that out of the way, as to the meanings of the warnings themselves, I think it's probably the use of e instead of E in scientific notation (the FITS standard goes back to days of FORTRAN where the latter was more common I think). It would be nice if the message explained better exactly what it was fixing.

注释注意:astropy.io.fits使用基于零的索引."从技术上讲,它只是第一条警告消息的一部分,并且主要出于历史原因而存在.将其添加到此消息中的事实甚至是一个小错误,因为该消息甚至还提到了任何索引(在过去,它可能说过一些有关卡[N]中的错误"的内容,其中N将是卡的索引).出现此消息的原因只是提醒那些更习惯使用基于1的索引的FORTRAN和/或IRAF的用户,而PyFITS/astropy.io.fits使用基于0的索引来提供HDU编号和标头卡号由C和Python使用.在这一点上,它可能会被删除,或者至少固定为仅附加到与之实际相关的警告消息中.

The note "Note: astropy.io.fits uses zero-based indexing." is technically just part of the first warning message, and is there mostly for historical reasons. The fact that it was added to this message is a bit of a bug even, since the message does even mention any indices (in the past it might have said something about "Error in card [N]", where N would be an index of the card). The reason for this message was just as a reminder to users who were more accustomed to FORTRAN and/or IRAF, which uses 1-based indexing, whereas PyFITS/astropy.io.fits gives HDU numbers and header card numbers using 0-based indexing as used by C and Python. At this point it could probably be removed, or at least fixed to only be appended to warning messages to which it's actually relevant.

这篇关于固定符合FITS标准的卡意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆