SPA (Single Photon Absorption) Spectral data import in JMPHi there,
'Anyone heard about SPA spectral data? I have a customer having those kind of data and seems not straightforward to import that in JMP (need to go through Matlab and Python). Does anybody know how we can import those data more straightforward in JMP?
Thanks in advance,
Cheers,
Valérie
Re: SPA (Single Photon Absorption) Spectral data import in JMPSPA file format appears to be binary. It probably could be done with some JSL Blob functions, it would probably be easier and more direct to use a Python package to do this. A quick google search shows there are at least 4 python packages that can read this data into a datagram, which could then be written to CSV and imported into JMP.
Re: SPA (Single Photon Absorption) Spectral data import in JMPThank you Sam!
Re: SPA (Single Photon Absorption) Spectral data import in JMPTo 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=',')
Re: SPA (Single Photon Absorption) Spectral data import in JMPI was working on something in this vein when I saw this post, so I tried scipy.io (as @Chandramouli_R suggested) to access .spa files I’d found on Github, but didn’t have any luck or identify any additional help from the scipy.io docs. Likely just my ignorance. However, I utilized one of the offerings on Github for reading .spa files and included the efforts as part of a Python integration journal found in the TRL here. However, it appears the .spa files can differ in structure (as ZGainsforth notes in the comments after the code here) so “one code for all” may be unlikely, rather requiring SME and a binary/hex editor to assess differences and make modifications to the Python import code.