你好呀,
“有人听说过 SPA 光谱数据吗? 我有一个客户拥有此类数据,但将其导入 JMP 似乎并不简单(需要通过 Matlab 和 Python)。 有谁知道如何在 JMP 中更直接地导入这些数据?
提前致谢,
干杯,
瓦莱丽
SPA 文件格式似乎是二进制的。 大概是可能使用一些 JSL Blob 函数完成后,使用 Python 包来完成此操作可能会更容易、更直接。 快速谷歌搜索显示,至少有 4 个 Python 包可以将这些数据读取到数据报中,然后将其写入 CSV 并导入到 JMP 中。
To handle SPA (Spectral Analysis) files in JMP, convert the proprietary SPA format, which stores spectral data along with metadata and calibration information, to a more accessible format like CSV using Python. The SPA format includes headers with instrument settings, measurement parameters, date and time, sample information, and the actual spectral data such as wavelength and intensity/absorbance values. First, install the numpy and scipy libraries. Then, use a Python script to load the SPA file and extract the spectral data, saving it as a CSV file and bring it to JMP.
import numpy as np
import scipy.io
spa_data = scipy.io.loadmat('path_to_your_spa_file.spa')
spectral_data = spa_data['data'] # Adjust this key as per your SPA file structure
np.savetxt('converted_data.csv', spectral_data, delimiter=',')
当我看到这篇文章时,我正在研究一些这方面的东西,所以我尝试使用 scipy.io(按照@Chandramouli_R 的建议)来访问我在 Github 上找到的.spa 文件,但没有任何运气,也没有从scipy.io 文档中找到任何其他帮助。可能只是我的无知。但是,我利用了Github 上的一个产品来读取 .spa 文件,并将这些努力作为TRL 中 Python 集成日志的一部分包含在这里。但是,似乎 .spa 文件的结构可能有所不同(正如 ZGainsforth 在此处代码后的评论中指出的那样),因此“一个代码适用于所有人”可能不太可能,而是需要 SME 和二进制/十六进制编辑器来评估差异并修改 Python 导入代码。