固定卡满足FITS标准是什么意思?
What does it mean that a card is fixed to meet FITS standard?
我正在尝试使用 FITS 文件。我有以下代码:
from astropy.io import fits
from astropy.wcs import WCS
hdul = fits.open(fitsfilename)[0]
wcs = WCS(hdul.header)
它给了我这些警告:
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 所指的数据发生了什么?我也对 WARNING 的含义感兴趣:VerifyWarning: 注意:astropy.io.fits 使用基于零的索引。
正如评论中已经指出的那样,io.fits
具有 verifying the validity of headers 的功能,甚至会修复微小的格式错误(它会尽力只编写完全有效的 FITS 文件) .
虽然有一些选项可以在写出文件时执行验证,但在某些情况下它也会在读取时执行自动验证,尤其是在解析 header 时。这是 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 的日子,我认为后者更常见)。如果该消息能更好地准确解释它正在修复的内容,那就太好了。
注释 "Note: astropy.io.fits uses zero-based indexing." 在技术上只是第一条警告消息的一部分,主要是出于历史原因。它被添加到这个消息中的事实甚至有点错误,因为消息甚至提到了任何索引(在过去它可能会说一些关于 "Error in card [N]",其中 N
将是一个卡片索引)。这条消息的原因只是提醒那些更习惯于 FORTRAN and/or IRAF 的用户,它使用基于 1 的索引,而 PyFITS/astropy.io.fits 给出 HDU 编号和 header 卡号使用 C 和 Python 使用的基于 0 的索引。此时它可能会被删除,或者至少固定为仅附加到它实际相关的警告消息中。
我正在尝试使用 FITS 文件。我有以下代码:
from astropy.io import fits
from astropy.wcs import WCS
hdul = fits.open(fitsfilename)[0]
wcs = WCS(hdul.header)
它给了我这些警告:
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 所指的数据发生了什么?我也对 WARNING 的含义感兴趣:VerifyWarning: 注意:astropy.io.fits 使用基于零的索引。
正如评论中已经指出的那样,io.fits
具有 verifying the validity of headers 的功能,甚至会修复微小的格式错误(它会尽力只编写完全有效的 FITS 文件) .
虽然有一些选项可以在写出文件时执行验证,但在某些情况下它也会在读取时执行自动验证,尤其是在解析 header 时。这是 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 的日子,我认为后者更常见)。如果该消息能更好地准确解释它正在修复的内容,那就太好了。
注释 "Note: astropy.io.fits uses zero-based indexing." 在技术上只是第一条警告消息的一部分,主要是出于历史原因。它被添加到这个消息中的事实甚至有点错误,因为消息甚至提到了任何索引(在过去它可能会说一些关于 "Error in card [N]",其中 N
将是一个卡片索引)。这条消息的原因只是提醒那些更习惯于 FORTRAN and/or IRAF 的用户,它使用基于 1 的索引,而 PyFITS/astropy.io.fits 给出 HDU 编号和 header 卡号使用 C 和 Python 使用的基于 0 的索引。此时它可能会被删除,或者至少固定为仅附加到它实际相关的警告消息中。