Spcreadr: Difference between revisions
Jump to navigation
Jump to search
imported>Jeremy (Importing text file) |
imported>Jeremy (Importing text file) |
||
Line 7: | Line 7: | ||
:x = spcreadr(filename,''subs,wlrange,options'') | :x = spcreadr(filename,''subs,wlrange,options'') | ||
:[data,xaxis,auditlog] = spcreadr(filename,''subs,wlrange,options'') | :[data,xaxis,auditlog] = spcreadr(filename,''subs,wlrange,options'') | ||
Line 14: | Line 13: | ||
SPCREADR reads a Galactic SPC file. | SPCREADR reads a Galactic SPC file. | ||
==== | ====Inputs==== | ||
* '''filename''' = a text string with the name of a SPC file or a cell of strings of SPC filenames. | * '''filename''' = a text string with the name of a SPC file or a cell of strings of SPC filenames. | ||
Line 22: | Line 21: | ||
* '''If''' filename is an empty cell {}, the user will be prompted to select a folder and then one or more SPC files in the folder the identified folder. | * '''If''' filename is an empty cell {}, the user will be prompted to select a folder and then one or more SPC files in the folder the identified folder. | ||
==== | ====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 | * '''''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 | ||
Line 28: | Line 27: | ||
* '''''wlrange''''' = [], two element vector (inclusive endpoints) of the wavelength range to return {default returns the entire wavelength range}. | * '''''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, or | * '''x''' = a dataset object containing the spectrum, or | ||
Line 40: | Line 39: | ||
===Options=== | ===Options=== | ||
''options'' = a structure array with the following fields: | |||
* '''axismatching''': [ 'none' | 'intersect' |{'interpolate'} ], defines action taken when the x-axes of two spectra being read do not match. The options are: | * '''axismatching''': [ 'none' | 'intersect' |{'interpolate'} ], defines action taken when the x-axes of two spectra being read do not match. The options are: |
Revision as of 16:35, 3 September 2008
Purpose
Reads a Galactic SPC file.
Synopsis
- x = spcreadr(filename,subs,wlrange,options)
- [data,xaxis,auditlog] = spcreadr(filename,subs,wlrange,options)
Description
SPCREADR reads a Galactic SPC file.
Inputs
- filename = a text string with the name of a SPC file or a cell of strings of SPC filenames.
- If filename is omitted or blank, the user will be prompted to select a file graphically.
- If filename is an empty cell {}, the user will be prompted to select a folder and then one or more SPC files in the folder the identified folder.
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, or
- data = a data array with measured intensities,
- xaxis = vector containing the wavelength axis, and
- auditlog = char array with the log from the file.
Options
options = a structure array with the following fields:
- axismatching: [ '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.