5

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.

4

2 回答 2

0

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

于 2013-02-15T03:33:12.180 回答
0

根据 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 及更高版本的所有文档描述为严重不足,因此这是课程的标准。

于 2011-04-12T13:27:59.183 回答