UltraScan III
List of all members | Classes | Public Types | Static Public Member Functions | Static Public Attributes | Static Private Member Functions
US_DataIO Class Reference

Data structures and methods to read/write experimental data. More...

#include "us_dataIO.h"

Classes

class  BeckmanRawScan
 Beckman Raw data scan. More...
 
class  EditedData
 The CCW data after edits are applied. More...
 
class  EditedPoint
 Changes made to a scan value. More...
 
class  EditValues
 Entries for edits of a scan. More...
 
class  NewEditedData
 The CCW data after edits are applied. More...
 
class  Parameters
 A private convenience class. More...
 
class  RawData
 All data associated with a cell / channel / wavelength (CCW) More...
 
class  Scan
 Single scan parameter and readings. More...
 
class  SpeedData
 Additional data for each triplet, if equilibrium data. More...
 

Public Types

enum  ioError {
  OK, CANTOPEN, BADCRC, NOT_USDATA,
  BADTYPE, BADXML, NODATA, NO_GUID_MATCH,
  BAD_VERSION
}
 Values that are returned for various errors when managing scan data. More...
 

Static Public Member Functions

static bool readLegacyFile (const QString &, BeckmanRawScan &)
 
static int writeRawData (const QString &, RawData &)
 
static int readRawData (const QString &, RawData &)
 
static int readEdits (const QString &, EditValues &)
 
static QString errorString (int)
 
static int index (const QVector< double > &, double)
 
static int index (US_DataIO::RawData *, double)
 
static int index (US_DataIO::EditedData *, double)
 
static int loadData (const QString &, const QString &, QVector< EditedData > &, QVector< RawData > &)
 
static int loadData (const QString &, const QString &, QVector< EditedData > &)
 
static int loadData (const QString &, const QString &, EditedData &)
 
static void adjust_interference (RawData &, const EditValues &)
 
static void calc_integral (RawData &, const EditValues &)
 
static bool spike_check (const Scan &, const QVector< double > &, int, int, int, double *)
 

Static Public Attributes

static const uint format_version = 5
 

Static Private Member Functions

static void writeScan (QDataStream &, const Scan &, quint32 &, const Parameters &)
 
static void write (QDataStream &, const char *, int, quint32 &)
 
static void read (QDataStream &, char *, int, quint32 &)
 
static void ident (QXmlStreamReader &, EditValues &)
 
static void run (QXmlStreamReader &, EditValues &)
 
static void all_lambdas (QXmlStreamReader &, EditValues &)
 
static void excludes (QXmlStreamReader &, EditValues &)
 
static void params (QXmlStreamReader &, EditValues &)
 
static void operations (QXmlStreamReader &, EditValues &)
 
static void do_edits (QXmlStreamReader &, EditValues &)
 
static void copyRange (double, double, const Scan &, Scan &, const QVector< double > &)
 
static void copyxRange (double, double, const QVector< double > &, QVector< double > &)
 
static QList< double > calc_residuals (int, const QVector< Scan > &)
 

Detailed Description

Data structures and methods to read/write experimental data.

The US_DataIO class provides data structures and static methods to read and write experimental data.

For memory efficiency, there is only a single vector of radius values that applies to all the scans. So for instance, if you have an instance of RawData or EditedData like this:

EditedData* data;

you could refer to an individual scan reading value like this:

data->scanData[ scanIndex ].rvalues[ readingIndex ]

Definition at line 24 of file us_dataIO.h.

Member Enumeration Documentation

Values that are returned for various errors when managing scan data.

Enumerator
OK 
CANTOPEN 
BADCRC 
NOT_USDATA 
BADTYPE 
BADXML 
NODATA 
NO_GUID_MATCH 
BAD_VERSION 

Definition at line 245 of file us_dataIO.h.

Member Function Documentation

void US_DataIO::adjust_interference ( RawData data,
const EditValues ev 
)
static

Adjust interference data by aligning air gaps at zero fringes

Parameters
dataA reference to the RawData structure to be adjusted
evThe EditValues used for the adjustment. Only airGapLeft, airGapRight, and includes are needed.

Definition at line 1202 of file us_dataIO.cpp.

void US_DataIO::all_lambdas ( QXmlStreamReader &  xml,
EditValues parameters 
)
staticprivate

Definition at line 831 of file us_dataIO.cpp.

void US_DataIO::calc_integral ( RawData data,
const EditValues ee 
)
static

Align integral fringe shifts within the valid data range

Parameters
dataA reference to the RawData structure to be adjusted
eeThe EditValues used for the adjustment. Only rangeLeft, rangeRight, and gapTolerance are needed.

Definition at line 1251 of file us_dataIO.cpp.

QList< double > US_DataIO::calc_residuals ( int  order,
const QVector< Scan > &  sl 
)
staticprivate

Definition at line 1553 of file us_dataIO.cpp.

void US_DataIO::copyRange ( double  left,
double  right,
const Scan orig,
Scan dest,
const QVector< double > &  origx 
)
staticprivate

Definition at line 1362 of file us_dataIO.cpp.

void US_DataIO::copyxRange ( double  left,
double  right,
const QVector< double > &  origx,
QVector< double > &  destx 
)
staticprivate

Definition at line 1416 of file us_dataIO.cpp.

void US_DataIO::do_edits ( QXmlStreamReader &  xml,
EditValues parameters 
)
staticprivate

Definition at line 971 of file us_dataIO.cpp.

QString US_DataIO::errorString ( int  code)
static

A string describing the last read or write error

Parameters
codeThe error code to be described

Definition at line 1651 of file us_dataIO.cpp.

void US_DataIO::excludes ( QXmlStreamReader &  xml,
EditValues parameters 
)
staticprivate

Definition at line 955 of file us_dataIO.cpp.

void US_DataIO::ident ( QXmlStreamReader &  xml,
EditValues parameters 
)
staticprivate

Definition at line 773 of file us_dataIO.cpp.

int US_DataIO::index ( const QVector< double > &  xvals,
double  xvalue 
)
static

Determine the index of a radius in a vector of radii

Parameters
xvalsA vector of data radius information
xvalueThe radius where the index is needed

Definition at line 1620 of file us_dataIO.cpp.

int US_DataIO::index ( US_DataIO::RawData rdata,
double  xvalue 
)
static

Determine the index of a radius in a RawData set

Parameters
rdataA pointer to the RawData set to examine
xvalueThe radius where the index is needed

Definition at line 1608 of file us_dataIO.cpp.

int US_DataIO::index ( US_DataIO::EditedData edata,
double  xvalue 
)
static

Determine the index of a radius in an EditedData set

Parameters
edataA pointer to the EditedData set to examine
xvalueThe radius where the index is needed

Definition at line 1614 of file us_dataIO.cpp.

int US_DataIO::loadData ( const QString &  directory,
const QString &  editFilename,
QVector< EditedData > &  data,
QVector< RawData > &  raw 
)
static

Load edited data into a data structure. This is the method most analysis programs will call to read data into memory. It uses the functions readRawData and readEdits.

Parameters
directoryThe directory of the auc files
editFilenameThe the file with the edited parameters
dataThe location where the edited data is placed
rawThe location where the raw data is placed

Definition at line 1017 of file us_dataIO.cpp.

int US_DataIO::loadData ( const QString &  directory,
const QString &  editFilename,
QVector< EditedData > &  data 
)
static

This is an overloaded method to read data into memory. It uses the functions readRawData and readEdits.

Parameters
directoryThe directory of the auc files
editFilenameThe the file with the edited parameters
dataThe location where the edited data is placed

Definition at line 992 of file us_dataIO.cpp.

int US_DataIO::loadData ( const QString &  directory,
const QString &  editFilename,
EditedData data 
)
static

This is an overloaded method to read data into memory. It uses the functions readRawData and readEdits.

Parameters
directoryThe directory of the auc files
editFilenameThe the file with the edited parameters
dataThe location where the edited data is placed

Definition at line 1001 of file us_dataIO.cpp.

void US_DataIO::operations ( QXmlStreamReader &  xml,
EditValues parameters 
)
staticprivate

Definition at line 930 of file us_dataIO.cpp.

void US_DataIO::params ( QXmlStreamReader &  xml,
EditValues parameters 
)
staticprivate

Definition at line 847 of file us_dataIO.cpp.

void US_DataIO::read ( QDataStream &  ds,
char *  cc,
int  len,
quint32 &  crc 
)
staticprivate

Definition at line 732 of file us_dataIO.cpp.

int US_DataIO::readEdits ( const QString &  filename,
EditValues parameters 
)
static

Read a set of edit parameters in xml format

Parameters
filenameThe filename to be read
parametersA reference to the data structure for the read data

Definition at line 738 of file us_dataIO.cpp.

bool US_DataIO::readLegacyFile ( const QString &  file,
BeckmanRawScan data 
)
static

Read a set of legacy data in raw teckman data set format

Parameters
fileThe filename to be read
dataA reference to the data structure location for read data

Definition at line 193 of file us_dataIO.cpp.

int US_DataIO::readRawData ( const QString &  file,
RawData data 
)
static

Read a set of data in the US3 binary format

Parameters
fileThe filename to be read
dataA reference to the data structure for the read data

Definition at line 500 of file us_dataIO.cpp.

void US_DataIO::run ( QXmlStreamReader &  xml,
EditValues parameters 
)
staticprivate

Definition at line 801 of file us_dataIO.cpp.

bool US_DataIO::spike_check ( const Scan sc,
const QVector< double > &  xvalues,
int  point,
int  start,
int  end,
double *  value 
)
static

Check a scan point to see if it is a spike relative to the non-interpolated points around it

Parameters
scThe scan to check
xvaluesThe vector of radius values associated with the scan
pointThe inde of the point to check
startThe beginning of the valid scan range
endThe end of the valid scan range
valueThe value of the interpolated point if a spike is detected
Returns
A flag indication if the point is a spike

Definition at line 1427 of file us_dataIO.cpp.

void US_DataIO::write ( QDataStream &  ds,
const char *  c,
int  len,
quint32 &  crc 
)
staticprivate

Definition at line 494 of file us_dataIO.cpp.

int US_DataIO::writeRawData ( const QString &  file,
RawData data 
)
static

Write a set of data to a file in the US3 binary format

Parameters
fileThe filename to be read
dataA reference to the data structure of the data to be written

Definition at line 260 of file us_dataIO.cpp.

void US_DataIO::writeScan ( QDataStream &  ds,
const Scan data,
quint32 &  crc,
const Parameters pp 
)
staticprivate

Definition at line 414 of file us_dataIO.cpp.

Member Data Documentation

const uint US_DataIO::format_version = 5
static

A constant value that identifies the format of the auc raw data. Internal programs use this value to determine if the format of the file is known.

Definition at line 31 of file us_dataIO.h.


The documentation for this class was generated from the following files: