12-02-2012 02:58 PM
Hi,
Does anyone know how to read a Omnic Thermo .spa spectra file?
Regards
Guswib
12-03-2012 01:39 PM
Hi Guswib,
I assume you’re referring to reading this file into LabVIEW? What are you looking to do with the data in this file?
12-03-2012 02:09 PM
I indend to make a very specific data treatment program for my experiment. For that reason I just need to be able to read the IR spectra inside the file.
12-04-2012 07:14 PM
It doesn't appear that .spa files can be brought directly into LabVIEW. Do you have any programs that you can open it with and possible convert it to a different data type?
03-30-2013 11:41 PM
Did you find a way to do this? I need to do it too. I found some info...
Do you have any particular language in mind, or would you like us to surprise you? – Ignacio Vazquez-Abrams May 22 '10 at 6:24 I would prefer: Matlab, VBA, any other like C, Pascal will all be OK. Thanks – cooooldog May 24 '10 at 0:59
As a Matter of fact, I have obtained the following Matlab/Octave codes for some specific *.spa spectra I obtained before. The only concern I have is, when reading the spectrum data, the offset typically is 0x41ch, but not always be 0x41ch when the *.spa files were re-named or saved as new or converted between %transmittance and absorbance via Omnic software.%%%%%%%%%%%****************%%%%%%%%%%%% – cooooldog May 24 '10 at 1:05
clc filename='c:\Documents and Settings\User Name\My Documents\Spectral File.SPA'; fid=fopen(filename,'r'); % Find the points number fseek(fid,hex2dec('234'),'bof'); Number_of_DataPoints=fread(fid,1,'int32'); %Find the maximum and minimum of Wavenumber (cm-1) range fseek(fid,576,'bof'); Maximum_Wavenumber=fread(fid,1,'single'); Minimum_Wavenumber=fread(fid,1,'single'); Interval=(Maximum_Wavenumber-Minimum_Wavenumber)/(Number_of_DataPoints-1); Wavenumber=linspace(Minimum_Wavenumber,Maximum_Wavenumber,Number_of_DataPoints).'; Wavenumber=flipud(Wavenumber); – cooooldog May 24 '10 at 1:05
%Find the Y-Axis data type: %Transmittance or Absorbance fseek(fid,hex2dec('360'),'bof'); Y_Label=char(fread(fid,14,'uchar')'); % How to define the offset for spectral data still remains unresolved. fseek(fid,hex2dec('41c'),'bof'); spectrum=fread(fid,Number_of_DataPoints,'single');%'double'); % float64, %real*8 figure(1),plot(Wavenumber,spectrum,'r'); set(gcf,'color','w'); set(gca,'xdir','rev','xcolor','b','ycolor','b','xlim',[round(Minimum_Wavenumber),round(Maximum_Wavenumber)]); xlabel('Wavenumber /cm^{-1}'); ylabel(Y_Label); – cooooldog May 24 '10 at 1:06
03-31-2013 12:43 AM
Playing around tonight, I have found that all my files have SGL array spectra that begin at 4x952 bytes; Hope this helps.