From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search


Reads Bruker OPUS files into a DataSet object.


data = opusreadr(filename,options)
data = opusreadr({'filename' 'filename2'},options)


OPUSREADR reads in Burker OPUS files (which use a numeric extensions, .#, .####, etc).


Input is the filename of a Bruker OPUS file to read. If omitted, the user is prompted for a file. The reader reads files of type:

kubelka-munck spectrum,
raman spectrum,
gc file, interferograms,
gc file, spectra,
- log reflectance,
photoacoustic spectrum.

Multiple input files must contain the same axisscale for the wavelength (variables) mode. The imported files are returned in a Dataset Object.

Optional Inputs

  • filename = specifies the file(s) to read using:
(a) a string specifying a single file to read
(b) a cell array of strings specifying multiple files to read
(c) the output of the MATLAB "dir" command specifying multiple files to read
If fname is an empty string or matrix or is not supplied, the user is prompted to identify file(s) to load.
  • options = an optional options structure. See Options below.


  • data = containing the spectrum or spectra from the file(s) takes one of two forms:
  1. If input is a single file, or multiple files containing data that can be combined (same number of data points, same x-axis range, same type of data), the output is a dataset object,
  2. If the input consists of multiple files containing data that cannot simply be combined (different number of data points, differing x-axis ranges, etc), the output is either:
a) a cell array with a dataset object for each input file if the 'nonmatching' option has value 'cell', or
b) a dataset object containing the input data combined using the MATCHVARS function if the 'nonmatching' option has value 'matchvars'.


Input 'options' is a structure containing the following fields

  • spectrumtype: [{''} | othertypes ] Specify which data type to read. If empty, the most commonly used type is selected (based on the "typepriority" option below) Spectrum types include: 'absorbance', 'transmittance', 'kubelka-munck spectrum', 'trace', 'raman spectrum', 'emission', 'reflectance' (among others). The entire list of types can be obtained by calling opusreader with the keyword 'types'. The single channel spectrum can be imported by setting spectrumtype to 'undefined Y-units'. For Solo and Solo+MIA use the Expert Preferences GUI to change this setting.
  • typepriority: Specifies a list of spectrum types (in numerical format) in the order that the given block type should be selected if present. This list is used when the spectrumtype is empty, indicating that the most common block should be used.
  • multiblock: [{1}] Defines which block to read when more than one block in a file has the "spectrumtype" type. The value can be any integer between 0 (zero) and infinity but the following are typical settings:
0 = Throws an error "multiple blocks are present"
1 = Always choose the first block matching the type. The first block is usually the original, un-preprocessed version of the data.
inf = Always choose the last block matching the type. The last block is usually a modified (processed) version of the data.
2-n = Chooses the specified block matching the type Mostly useful when an exact sequence of steps have been used in creating the OPUS file and the user knows a specific step in that sequence is the version of the data needed.
  • 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.
  • nonmatching : [ 'error' |{'matchvars'} 'cell'] Governs behavior when multiple files are being read which cannot be combined due to mismatched types, sizes, etc.
'matchvars' returns a dataset object,
'cell' returns cell (see Outputs),
'error' gives an error.
  • waitbar: [ 'off' |{'on'}] Governs display of a progress bar when doing multiple file reading.
  • sorttype [{'none'} |'time'|'name'] Determines whether the output dataset will be sorted.

See Also

Data Importing Formats, brukerxrpdreadr, jcampreadr, pereadr, spareadr, spcreadr, writespc, xclreadr