ReadSpec

From DAAP
Jump to navigation Jump to search

La fonction readspec permet la lecture entre autres d'un fichier :

  • SPE : spereadone
  • SPC : spcreadone
  • MAT : matreadone
  • FSM : fsmreadone05
  • SP : spreadone
%READSPEC  reads spectrum from disk
%   Reads one or more spectrum files from disk. The input can be a string or a 
%   cell array of strings. The output 'S' is a structure array of spectra. Non
%   defined fields are empty. Depending on the extension of 'filename', dedicated
%   import-filters are used. The following import-filters are implemented:
%   SPE             : spereadone
%   SPC             : spcreadone
%   MAT             : matreadone
%   FSM             : fsmreadone05
%   SP              : spreadone
%
%I/O format: S = readspec('filenames')
%   spectrum.Data            : 3d matrix : xdim*ydim*zdim (channels*strips*frames)
%           .Exposure        : exposure time, in seconds 
%           .Accumulations   : number of accumulations
%           .FileName        : name of the original file (with extension)
%           .FileDate        : creation date of the orignal file 
%           .CalibrationName : name of the calibration structure
%           .CalibrationDate : creation date of the calibration
%           .Wvn             : wavenumber axis (empty for raw spectra)
%           .UserData        : depends on the filetype
%
% readspec(template,i,ext) reads an array of numbered files such
%     as: jaap1.ext, jaap2.ext, where 'template' is a string with the
%     file template (e.g. 'jaap') and 'ext' is a string containing a 
%     valid extension ('spe', 'spc', 'mat')
%     NOTE: leading zeros are not recognized and should be avoided
% readspec without input arguments opens a file selection window
%
% For import of ascii files, use READASC
%
% Erasmus University Rotterdam

% uses:    spereadone 
%          spcreadone 
%          matreadone
%          fsmreadone05  until a more final version is available
%
% Written by Tom Bakker Schut, General Surgery EMCR, 07 1999.

% Modified: PJC 18/11/1999: 1) squeeze datablock added, 2) filedate changed to string
% PJC 23/11/1999: bugfix in 'spcreadone'
% PJC 3/2/2000 by PJC: handles multiple files
% RW  05/05/00: doesn't squeeze anymore
% PJC 25/07/2001: strcmp replaced by strcmpi (i.e. case insensitive)
% PJC/RW 6-02-2004: import numbered files and wildcards added
% PJC 10-2-2004: bugfixes for 'mat' files and wildcard; use of importspec
% added;
% RW 19 march 2004  bugfix: files with trailing blanks can now be read
%           (line 83)
% PJC 02-07-2004: asc import removed for compiler reasons
%                 importspec no longer used (integrated in readspec)
% RW 02-02-2006 added the possibility to read FTIR spectra with a diferent 
%                 output format
% RW 10-02-2006 added the possibility to restrict the wavenumber range of
%                 FTIR files