sdds2math
converts an SDDS file to a file that can be read into Mathematica.
The file contains a single Mathematica variable of the form:
sdds={description,coldef,pardef,arraydef,associates,tables} description={text,contents} coldef={coldef-1, coldef-2, ...} coldef-n={name,units,symbol,format,type,fieldlength,description} pardef={pardef-1, pardef-2, ...} pardef-n={name,fixed_value,units,symbol,type,description} arraydef={arraydef-1, arraydef-2, ...} arraydef-n={name,units,symbol,format,type,fieldlength,group,description} associates={associate-1, associate-2,...} associate-n={sdds,filename,path,contents,description} tables={table-1, table-2, ...} table-n={parameters,data} parameters={parameter-1, parameter-2, ...} data={row-1, row-2, ...} row-n={val-1, val-2, ...}
A number of Mathematica programs to extract information from this variable are available in the file SDDS.m. To include these routines in your Mathematica program, put this file in your working directory and use the following line in your Mathematica program:
Needs["SDDS`"];
The programs are:
SDDSRead[filename_String]
--returns an SDDS structure from a file.
SDDSWrite[sdds_,filename_String]
--writes an SDDS structure to a file.
SDDSGetColumnDefinitions[sdds_]
--returns the list of column definitions.
SDDSGetParameterDefinitions[sdds_]
--returns the list of parameter definitions.
SDDSGetArrayDefinitions[sdds_]
--returns the list of array definitions.
SDDSGetAssociates[sdds_]
--returns the list of associates.
SDDSGetTable[sdds_,n_:1]
--returns the nth table parameters,data.
SDDSGetParameters[sdds_,n_:1]
--returns the parameters from the nth table.
SDDSGetParameter[sdds_,p_String,n_:1]
--returns the value of parameter p from the nth table.
SDDSGetData[sdds_,n_:1]
--returns the data matrix from the nth table.
SDDSGetColumn[sdds_,c_String,n_:1]
--returns the column named c from the nth table.
SDDSGetColumn[sdds_,m_,n_:1]
--returns the mth column from the nth table.
SDDSGetRow[sdds_,m_,n_:1]
--returns the mth row from the nth table.
SDDSGetNColumns[sdds_]
--returns the number of columns.
SDDSGetNParameters[sdds_]
--returns the number of parameters.
SDDSGetNArrays[sdds_]
--returns the number of arrays.
SDDSGetNAssociates[sdds_]
--returns the number of associates.
SDDSGetNTables[sdds_]
--returns the number of tables.
SDDSGetNRows[sdds_,n_:1]
--returns the number of rows in the nth table.
SDDSGetColumnNames[sdds_]
--returns the list of column names.
SDDSGetParameterNames[sdds_]
--returns the list of parameter names.
SDDSGetArrayNames[sdds_]
--returns the list of array names
SDDSGetAssociateNames[sdds_]
--returns the list
of associate names.
pipe
-- The standard SDDS Toolkit pipe option.
comments
-- Put helpful Mathematica comments in the file.
verbose
-- Write header information to the terminal like sddsquery.
format
-- Format for doubles (Default: %g)