Netcdfreadr: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Scott
(Created page with "===Purpose=== Reads in netCDF files and outputs a DataSet and or structure. ===Synopsis=== :x = netcdfreadr(filenames, options); ===Description=== If no file is given (fi...")
 
imported>Bob
 
(7 intermediate revisions by one other user not shown)
Line 9: Line 9:
===Description===
===Description===


If no file is given (filenames) then prompts user for filename/s. Default options are set to handle Mass Spectroscopy exported data.
If no file is given (filenames) then prompts user for filename/s. Default option settings are set to handle Mass Spectroscopy (MS) data.


'''NOTE''': This function uses netcnetCDF Library Functions available in Matlab 2009a and newer.
'''NOTE''': This function uses netCDF Library Functions available in Matlab 2009a and newer.


====Inputs====
====Inputs====
Line 21: Line 21:
====Outputs====
====Outputs====


* '''x''' = takes one of two forms:
* '''x''' = takes one of 3 forms:


:# 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
:# '''rawdata''' : Genereic structure of all data.
:# If the input consists of multiple files, but the data cannot be combined, the output is a cell array with a dataset object for each input file (see the nonmatching option defined above)
:#:: .varname    = variable name.
:#:: .xtype      = variable datatype.
:#:: .varDimsIDs = dimensions IDs.
:#:: .varAtts    = number of attributes.
:#:: .varID      = variable ID.
:#:: .data       = variable data.
:#:: .attributes(j).attname  = attribute name.
:#:: .attributes(j).attval  = attribute value.
:# '''datastruct''' : Structure of data with variable names as field names.
:# '''dso''' : Dataset Object (only when .getms = yes).


===Options===
===Options===
Line 30: Line 39:
''options'' =  a structure array with the following fields:
''options'' =  a structure array with the following fields:


* '''nonmatching''': [ 'error' | {'cell'} ], defines action taken when the x-axes or data types of multiple spectra being read do not match. The default choice, 'cell', returns a cell array where each element is a dataset object with data from a single file. The other choice, 'error', will return an error when the files do not match.
* '''output''' : [ { 'dso' } | 'rawdata' | 'datastruct' | 'all'] What output to pass.
 
* '''getms''' : [ { 'yes' } | 'no' ] Get Mass Spec dataset from file.
* '''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.
* '''massoffset''' : [ 0 ] Shift point for round-off (when using .getms).
* '''chunksize''' : [ 1.5 ] Divide data into chunks of chunksize*1,000,000 elements when contructing a MS dataset. Value of 1.5 million is good default for 32bit systems.
* '''massres''' : [1.0] desired output resolution in m/z units (when using .getms)
* '''massresprompt''' : [ 'yes' | { 'no' } ] prompt user for value for '''massres'''


===See Also===
===See Also===

Latest revision as of 14:44, 28 January 2015

Purpose

Reads in netCDF files and outputs a DataSet and or structure.

Synopsis

x = netcdfreadr(filenames, options);

Description

If no file is given (filenames) then prompts user for filename/s. Default option settings are set to handle Mass Spectroscopy (MS) data.

NOTE: This function uses netCDF Library Functions available in Matlab 2009a and newer.

Inputs

  • filename = a text string with the name of a spectral file or a cell of strings of 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 AIT files in the identified folder.

Outputs

  • x = takes one of 3 forms:
  1. rawdata : Genereic structure of all data.
    .varname = variable name.
    .xtype = variable datatype.
    .varDimsIDs = dimensions IDs.
    .varAtts = number of attributes.
    .varID = variable ID.
    .data = variable data.
    .attributes(j).attname = attribute name.
    .attributes(j).attval = attribute value.
  2. datastruct : Structure of data with variable names as field names.
  3. dso : Dataset Object (only when .getms = yes).

Options

options = a structure array with the following fields:

  • output : [ { 'dso' } | 'rawdata' | 'datastruct' | 'all'] What output to pass.
  • getms : [ { 'yes' } | 'no' ] Get Mass Spec dataset from file.
  • massoffset : [ 0 ] Shift point for round-off (when using .getms).
  • chunksize : [ 1.5 ] Divide data into chunks of chunksize*1,000,000 elements when contructing a MS dataset. Value of 1.5 million is good default for 32bit systems.
  • massres : [1.0] desired output resolution in m/z units (when using .getms)
  • massresprompt : [ 'yes' | { 'no' } ] prompt user for value for massres

See Also

Data Importing Formats, asdreadr, asfreadr, fluoromaxreadr, gwscanreadr, hjyreadr, jcampreadr, opusreadr, pdfreadr, pereadr, spareadr, spcreadr, writeasf, xclreadr