如何从扩展名为 *.spa 的 Nicolet FTIR 光谱文件中读取数据
*.spa 二进制文件格式是商业秘密吗?但Perkin Elmer 向公众公开了*.sp 格式;
如何阅读?
Is the *.spa binary file format trade secret? But Perkin Elmer released *.sp format to public;
how to read?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我知道这个线程现在有点旧了,但我最近需要阅读 SPA 文件,并且想分享我如何设法应对它们。
正如 cooooldog 所说,0x41c 偏移量不是标准的。但是,此偏移量是在 spa 文件本身中编码的。
编辑 spa 文件时,开头有一个短标头,然后是许多零。从 0x11e 开始是非零值。
以下是我如何设法找到光谱文件的正确偏移量的方法:
从 0x11e 开始,我开始读取 int32 值。数据偏移量似乎是在该值之前编码的:54 18 00 00(十进制为 6228)。
编辑:我收到了一组新的 spa 文件,其中搜索的模式不再是 54 18 00 00 而是 40 61 00 00 (24896),因此这可能也不是标准的。事实上,spa 文件中的起始地址似乎编码为 172h 或 182h。我仍然需要一种方法来找到它。
因此,通过查找 6228,稍后在文件中查找数据所需的偏移量就是在该值 6228 之前找到的整数。
如果继续编辑 spa 文件,您应该会找到 32 位编码的浮点值,放置在一堆文本之后。
从现在开始,只需将 0x41c 替换为找到的地址即可读取这些值。
如果这可以帮助任何人......
I know this thread is a bit old now, but I needed to read SPA files recently, and would like to share how I managed to cope with them.
As stated by cooooldog, 0x41c offset is not standard. However, this offset is coded in the spa file itself.
When editing a spa file, there is a short header at the beginning, then many zeros. From 0x11e are non-zero values.
Here is how I managed to find the correct offset for my spectral files:
Starting from 0x11e, I start reading int32 values. It appears that the data offset is coded just before this value : 54 18 00 00 (which is 6228 in decimal).
Edit : I've received new set of spa files where the searched pattern is no longer 54 18 00 00 but 40 61 00 00 (24896), so this might not be standard as well. In fact it appears that starting address is either coded at 172h or 182h in the spa file. I do still need a way to find it out.
So by looking for 6228, the offset needed to find data later in the file is the integer found just before this value of 6228.
If you continue editing your spa file, you should find floating point values, 32-bit coded, placed just after a bunch of text.
From now, reading those values is possible, by just replacing 0x41c by the address found.
If this may help anyone...
我发现光谱偏移的设置位置是在位置 386:
I found where the spectral offset is set, it is on position 386:
Matlab 实现
https://cn.mathworks.com/matlabcentral/fileexchange/57904 -加载光谱
C/C++实现:
Github上有一个小型开源项目:
https:// github.com/aitap/spa2txt
Matlab implementation
https://cn.mathworks.com/matlabcentral/fileexchange/57904-loadspectra
C/C++ implemetation:
There is a small open source project on Github:
https://github.com/aitap/spa2txt
'如何处理.spa(频谱分析仪输出文件)usnig matlab'
好吧,我认为处理读取 .spa 文件的最佳方法是首先使用“记事本”文件将其转换为 txt,然后使用导入工具将其导入到 matlab,该工具为您提供了大量从制表符分隔到以制表符分隔的函数自定义分隔
之后,您选择需要从 .spa 文件中提取的频率和接收功率
有关更多详细信息,您可以查看
https:// nl.mathworks.com/videos/importing-data-from-text-files-interactively-71076.html
这对我处理 .spa 频谱分析仪输出文件有很大帮助
:)
'how to deal with.spa (spectrum analyzer output files ) usnig matlab'
well i think the best way to deal with reading .spa files is first to convert it to txt using 'notepad' file and then import it to matlab using the importing tool which gives you a huge amount of functions starting from tab delimited and ending with custom delimited
after that you select the frequencies and the received power you need to extrat from .spa file
for more details you can check
https://nl.mathworks.com/videos/importing-data-from-text-files-interactively-71076.html
it was a great help for me dealing with .spa spectrum analyzer output files
:)