- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试使用 astropy 将 WCS 转换为像素,但是当我尝试读取图像时:
from astropy import wcs
w = wcs.WCS('image_file.fits')
我收到以下异常:
*WARNING: Unexpected extra padding at the end of the file. This padding may not be preserved when saving changes. [astropy.io.fits.header]
Traceback (most recent call last):
File "make_stamps.py", line 29, in <module>
w = wcs.WCS(image_file)
File "/Users/anaconda/lib/python2.7/site-packages/astropy/wcs/wcs.py", line 385, in __init__
fobj = fits.open(header)
Fhttp://stackoverflow.com/posts/41513868/editile "/Users/anaconda/lib/python2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 139, in fitsopen
return HDUList.fromfile(name, mode, memmap, save_backup, cache, **kwargs)
File "/Users/anaconda/lib/python2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 281, in fromfile
save_backup=save_backup, cache=cache, **kwargs)
File "/Users/anaconda/lib/python2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 839, in _readfrom
hdu = _BaseHDU.readfrom(ffo, **kwargs)
File "/Users/anaconda/lib/python2.7/site-packages/astropy/io/fits/hdu/base.py", line 423, in readfrom
**kwargs)
File "/Users/anaconda/lib/python2.7/site-packages/astropy/io/fits/hdu/base.py", line 483, in _readfrom_internal
header = Header.fromfile(data, endcard=not ignore_missing_end)
File "/Users/anaconda/lib/python2.7/site-packages/astropy/io/fits/header.py", line 451, in fromfile
padding)[2]
File "/Users/anaconda/lib/python2.7/site-packages/astropy/io/fits/header.py", line 520, in _from_blocks
raise IOError('Header missing END card.')
IOError: Header missing END card.*
我之前在使用fits.open()
时遇到了这个错误但可以通过添加“ignore_missing_end=True”来解决问题。但是,“ignore_missing_end”似乎不是 wcs 类的参数。如何使用astropy.wcs.wcs
读取图像?
最佳答案
那个astropy.wcs.WCS
可以采用文件名只是一个方便的选项,因此您无法传递 astropy.io.fits.open
的(所有)参数也就不足为奇了。也接受此功能。
但是,使用 astropy.io.fits.Header
创建 WCS
非常容易。 。因此,您可以打开该文件,提取相关 header 并自行创建 WCS:
from astropy.io import fits
from astropy.wcs import WCS
with fits.open('your_file.fits', mode='readonly', ignore_missing_end=True) as fitsfile:
# if you want the first extension, otherwise change the [0].
wcs = WCS(fitsfile[0].header)
# Now you can use your WCS, for example:
print(wcs)
关于python - 天体 WCS : "IOError: Header missing END card.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41513868/
要在标题(或谷歌)中简洁地描述这是一个棘手的问题。我有一个分类表,其中某些列可能会根据置信度列为“已删除”。我想用“未识别”替换任何显示“已删除”的列,后跟第一列中未识别的值以行方式说“掉落”。因此,
我在 VSCode 上使用 pygame 模块,但遇到了 pygame 没有 init 成员的问题。我遵循了 this 的解决方案关联。我编辑了用户设置并添加了 "python.linting
我的问题是如何解决丢失的脚本太旧或丢失!! checking for a BSD-compatible install... /usr/bin/install -c checking whether
我正在使用带有启动器的 Spring Boot。当我错误配置启动器(缺少或定义了错误的值)时,它会打印“缺少 bean”错误消息,而不是“缺少值”。很难找到这个错误。 我的开胃菜看起来像 @Condi
我在 Django 1.7 中遇到问题,我正在尝试将用户保存到表中,但我收到一个错误,指出该表不存在。 这是我正在执行的代码: from django.conf import settings fro
我正在查看 EhCache 统计数据,我看到了这些数字: CacheMisses: 75977 CacheHits: 38151 InMemoryCacheMisses: 4843 InMemoryC
我正在尝试使用这些数据运行 lme 模型: tot_nochc=runif(10,1,15) cor_partner=factor(c(1,1,0,1,0,0,0,0,1,0)) age=runif(
我在 Microsoft Visual Studio C++ 中编写了一个程序,并为此使用了 SFML。我包含了程序所需的正确的 .dll 文件,并将它们复制到“发布”文件夹中。有效。整个程序在我的电
在设置新的Reaction CSR应用程序、一些样板库等过程中。在控制台中收到以下错误:。现在,我不会去修复一些我没有维护的包。我怎么才能找到真正的问题呢?Vite dev Build没有报告错误。
我正在上 React Native 类(class),然后使用 Flow 尝试纠正类(class)中的错误,因为讲师没有使用任何类型检查。 我在 Flow 中遇到了另一个错误,通过在互联网上进行长时间
我想删除图像标签正在寻找的缺失错误。我不想要 ult 标签占位符,试图故意将其保留为空白,直到我使用回形针浏览上传照片。 我已经将 url(:missing) 更改为许多其他内容,例如 nil 等。是
CREATE TABLE customer(customer_id NUMBER(6) PRIMARY KEY , customer_name VARCHAR2(40) NOT NULL , cust
我正在设置 invisible reCAPTCHA在我的 Web 应用程序中并且无法验证用户的响应。 (即使我传递了正确的 POST 参数) 我通过调用 grecaptcha.execute(); 以
我搜索了 these SO results找不到与我的问题相关的任何内容。我怀疑这可能是重复的。 我目前正在 .NET C# 3.5 中编写 Microsoft.Office.Interop.Exce
我在同一行收到两个错误。 Bridge *在 Lan 类中排名第一。我错过了什么? #include #include #include using namespace std; class L
首先,我看到了一些解决方案,但我没有理解它们。我是 QT 的新手,甚至谷歌也没有帮助我。英语不是我的母语 这是在QT Creator 5.6中调试后的报错信息 C2143: syntax error:
有没有办法把表1展开成表2?就是将start_no和end_no之间的每一个整数作为seq_no字段输出,取原表的其他字段组成新表(表2)。 表 1: date source market
我在 Excel (2016) 中制作了一个旭日形图,并希望为所有数据点添加标签。问题是,Excel 会自动丢弃一些标签: 似乎标签被删除是因为数据点太小或标签字符串太长。如何让 Excel 显示所有
在 R 3.0.2 中,missing() 函数可以告诉我们是否缺少形式参数。 如何避免硬编码传递给丢失的变量名称?例如在 demoargs <- function(a=3, b=2, d) {
我试图在 UI 上的某些功能中返回一个按钮,但出现了一个奇怪的错误。有人可以帮忙吗? var div = "View" 我得到的错误是: 参数列表后缺少 )。 最佳答案 onclick="javas
我是一名优秀的程序员,十分优秀!