Spcreadr and Stdfir: Difference between pages

From Eigenvector Research Documentation Wiki
(Difference between pages)
Jump to navigation Jump to search
imported>Donal
 
imported>Jeremy
(Importing text file)
 
Line 1: Line 1:
===Purpose===
===Purpose===
 
Standardization using FIR filtering.
Reads a Galactic SPC file.
 
===Synopsis===
===Synopsis===
 
:sspec = stdfir(nspec,rspec,win,''mc'')
:x = spcreadr(filename,''subs,wlrange,options'')
:[data,xaxis,auditlog,description] = spcreadr(filename,''subs,wlrange,options'')
 
===Description===
===Description===
 
STDFIR is a moving window multiplicative scatter correction with a fixed window size. This algorithm uses an inverse least squares regression. (Also see MSCORR.)
SPCREADR reads a Galactic SPC file.
Inputs are nspec the new spectra to be standardized, rspec the standard spectra from the standard instrument (a row vector that is a reference spectrum), and win is the window width (must be an odd number).
 
If the optional input ''mc'' is 1 {default} the regression allows for an offset and a slope, if ''mc'' is set to 0 only the slope is used (no offset is used i.e. it is a force fit through zero).
====Inputs====
The output is sspec the standardized spectra. This routine is based on the method discussed in
 
Blank, T.B., Sum, S.T., Brown, S.D., and Monfre, S.L.,  "Transfer of Near-Infrared Multivariate Calibrations without Standards", ''Anal. Chem.'', 68(17), 2987-2995, 1996.
* '''filename''' = a text string with the name of a SPC file or a cell of strings of SPC filenames.
::If (filename) is omitted or an empty cell {}, the user will be prompted to select a folder and then one or more SPC files in the identified folder.
 
::If filename is a blank string, the user will be prompted to select a file. Importer will also load DHB files.
 
====Optional Inputs====
 
* '''''subs''''' = [], scalar or vector indicating the sub-files to read, e.g. [3] reads sub-file 3, [3:9] reads sub-files 3 to 9, {default reads all sub-files} and
 
* '''''wlrange''''' = [], two element vector (inclusive endpoints) of the wavelength range to return {default returns the entire wavelength range}.
 
====Outputs====
 
* '''x''' = a dataset object containing the spectrum,
 
* '''data''' = a data array with measured intensities,
 
* '''xaxis''' = vector containing the wavelength axis,
 
* '''auditlog''' = char array with the log from the file,
 
* '''description''' = char array, description of the file from its comment field.
 
===Options===
 
''options'' =  a structure array with the following fields:
 
* '''waitbar''': [ 'off' | 'on' |{'auto'}] governs the display of a waitbar when loading multiple files. If 'auto', waitbar is displayed for larger sets of files only.
 
* '''nonmatching''': [ 'none' | 'intersect' |{'interpolate'} ], defines action taken when the x-axes of two spectra being read do not match. The options are:
**  ''''intersect'''' returns only the points where the spectral x-axis values overlap excatly.
**  ''''interpolate'''' returns the overlapping portions with linear interpolation to match spectral points exactly. As no extrapolation will be done, the returned spectra will cover the smallest common spectral range.  
**  ''''none'''' ignores x-axis differences as long as the number of data points is the same in all spectra.
 
* '''textauditlog''': [ {'no'} | 'yes' ], governs output of audit log contents. When 'yes', the auditlog is returned as a raw text array. Otherwise, the auditlog is returned as a structure with field names taken from auditlog keys.
 
* '''multiselect''' : [ 'off' | {'on'} ] governs whether file selection dialog should allow multiple files to be selected and imported. Setting to 'off' will restrict user to importing only one file at a time.
 
===See Also===
===See Also===
 
[[mscorr]], [[stdgen]]
[[Data Importing Formats]], [[jcampreadr]], [[writespc]], [[xclreadr]]

Revision as of 09:21, 2 September 2008

Purpose

Standardization using FIR filtering.

Synopsis

sspec = stdfir(nspec,rspec,win,mc)

Description

STDFIR is a moving window multiplicative scatter correction with a fixed window size. This algorithm uses an inverse least squares regression. (Also see MSCORR.) Inputs are nspec the new spectra to be standardized, rspec the standard spectra from the standard instrument (a row vector that is a reference spectrum), and win is the window width (must be an odd number). If the optional input mc is 1 {default} the regression allows for an offset and a slope, if mc is set to 0 only the slope is used (no offset is used i.e. it is a force fit through zero). The output is sspec the standardized spectra. This routine is based on the method discussed in Blank, T.B., Sum, S.T., Brown, S.D., and Monfre, S.L., "Transfer of Near-Infrared Multivariate Calibrations without Standards", Anal. Chem., 68(17), 2987-2995, 1996.

See Also

mscorr, stdgen