FITS 使用自定义元数据导出

发布于 2024-11-01 05:10:48 字数 649 浏览 1 评论 0原文

有人有将数据导出为带有自定义元数据(FITS 标头)信息的 FITS 文件的经验吗?到目前为止,我只能使用标准 Mathematica FITS 标头模板生成 FITS 文件。该文档没有提示是否支持自定义元数据导出以及如何完成。

comp.soft-sys.math.mathematica 的以下建议不起作用:

header=Import[<some FITS file>, "Metadata"]; 
Export<"test.fits",data ,"Metadata"->header] 

或者

Export["test.fits",{"Data"->data,"Metadata"->header}]

将我自己的元数据导出到 FITS 文件的正确方法是什么?

干杯,

Markus

更新:Wolfram 支持的回复: “Mathematica 尚不支持导出 FITS 文件的元数据。 示例指的是此数据的导入。我们确实计划支持 这在未来……” “还计划将二进制表包含到 FITS 导入中 功能。”

我会尝试想出一些解决方法。

does anybody has experience in exporting data as a FITS file with custom Metadata (FITS header) information? So far I was only able to generate FITS files with the standard Mathematica FITS header template. The documentation gives no hint on whether custom Metadata export is supported and how it might be done.

The following suggestions from comp.soft-sys.math.mathematica do not work:

header=Import[<some FITS file>, "Metadata"]; 
Export<"test.fits",data ,"Metadata"->header] 

or

Export["test.fits",{"Data"->data,"Metadata"->header}]

What is the proper way to export my own Metadata to a FITS file ?

Cheers,

Markus

Update: response from Wolfram Support:
"Mathematica does not yet support Export of metadata for FITS file. The
example are referring to importing of this data. We do plan to support
this in the future..."
"There are also plans to include binary tables into FITS import
functionality."

I will try to come up with some workaround.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

巨坚强 2024-11-08 05:10:48

根据 v.7 和 v.8 的 文档,有有几种方法可以实现您想要的,并且您几乎可以使规则形式正确:

Export["test.fits", {"Data" -> data, "Metadata" -> header}, "Rules"]

其他方法是

Export["test.fits", header, "Metadata"]
Export["test.fits", {data, header}, {{"Data", "Metadata"}}]

注意第二种方法中元素标签周围的双括号。

编辑:经过一些测试,由于@belisarius的刺激,每当我包含“元数据”元素时,我都会收到一条错误,指出它不是有效的导出元素。此外,您也无法导出“RawData”元素。因此,我提交错误有两个原因:元数据不可由用户设置,这对于任何严肃的应用程序都至关重要。至少,用户应该至少能够扩充默认的 Mathematica 元数据。其次,文档在描述什么是“有效”导出元素与导入元素方面严重不足。当然,我将 v.6 及更高版本的所有文档描述为严重不足,因此这是本课程的标准。

According to the documentation for v.7 and v.8, there is a couple of ways of accomplishing what you want, and you almost have the rule form correct:

Export["test.fits", {"Data" -> data, "Metadata" -> header}, "Rules"]

The other ways are

Export["test.fits", header, "Metadata"]
Export["test.fits", {data, header}, {{"Data", "Metadata"}}]

note the double brackets around the element labels in the second method.

Edit: After some testing, due to prodding from @belisarius, whenever I include the "Metadata" element, I get an error stating that it is not a valid export element. Also, you can't export a "RawData" element, either. So, I'd submit a bug for two reasons: the metadata isn't user settable which is vitally important for any serious application. At a minimum, the user should at least be able to augment the default Mathematica metadata. Second, the documentation is woefully inadequate in describing what is a "valid" export element vs. import element. Of course, I'd describe all of the documentation for v.6 and beyond as woefully inadequate, so this is par for the course.

ら栖息 2024-11-08 05:10:48

Mathematica 9 现在允许导出元数据(标题)条目,这些条目是标准所需条目的附加内容。在帮助浏览器中,搜索“FITS”,有一个示例显示了这一点(先导出,然后导入进行验证)。

Mathematica 9 now allows export of metadata (header) entries, which are additive to the standard required entries. In the Help browser, search "FITS" and there is an example that shows this (with Export followed by Import to verify).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文