Spcreadr: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
No edit summary
imported>Donal
 
(11 intermediate revisions by 2 users not shown)
Line 6: Line 6:


:x = spcreadr(filename,''subs,wlrange,options'')
:x = spcreadr(filename,''subs,wlrange,options'')
:[data,xaxis,auditlog] = spcreadr(filename,''subs,wlrange,options'')
:[data,xaxis,auditlog,description] = spcreadr(filename,''subs,wlrange,options'')


===Description===
===Description===
Line 15: Line 15:


* '''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.
:: If filename is omitted or blank, the user will be prompted to select a file graphically.
::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 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 a blank string, the user will be prompted to select a file. Importer will also load DHB files.


====Optional Inputs====
====Optional Inputs====
Line 26: Line 27:
====Outputs====
====Outputs====


* '''x''' = a dataset object containing the spectrum, or
* '''x''' = a dataset object containing the spectrum,


* '''data''' = a data array with measured intensities,
* '''data''' = a data array with measured intensities,


* '''xaxis''' = vector containing the wavelength axis, and
* '''xaxis''' = vector containing the wavelength axis,
 
* '''auditlog''' = char array with the log from the file,


* '''auditlog''' = char array with the log from the file.
* '''description''' = char array, description of the file from its comment field.


===Options===
===Options===
Line 38: Line 41:
''options'' =  a structure array with the following fields:
''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:
* '''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' | {'matchvars'} |'intersect' | 'interpolate' ], defines action taken when the x-axes of two spectra being read do not match. The options are:
**  ''''matchvars'''' uses MATCHVARS to merge imported spectra when the spectral x-axes differ.
**  ''''intersect'''' returns only the points where the spectral x-axis values overlap excatly.
**  ''''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.  
**  ''''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.  
Line 44: Line 50:


* '''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.
* '''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===


[[areadr]], [[xclgetdata]], [[xclputdata]], [[xclreadr]]
[[Data Importing Formats]], [[jcampreadr]], [[writespc]], [[xclreadr]]

Latest revision as of 15:15, 17 June 2015

Purpose

Reads a Galactic SPC file.

Synopsis

x = spcreadr(filename,subs,wlrange,options)
[data,xaxis,auditlog,description] = 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 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' | {'matchvars'} |'intersect' | 'interpolate' ], defines action taken when the x-axes of two spectra being read do not match. The options are:
    • 'matchvars' uses MATCHVARS to merge imported spectra when the spectral x-axes differ.
    • '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

Data Importing Formats, jcampreadr, writespc, xclreadr