areaDetector 1-8
Public Member Functions
NDFileNetCDF Class Reference

Writes NDArrays to files in the netCDF file format. More...

#include <NDFileNetCDF.h>

Inheritance diagram for NDFileNetCDF:
NDPluginFile NDPluginDriver asynNDArrayDriver asynPortDriver

List of all members.

Public Member Functions

 NDFileNetCDF (const char *portName, int queueSize, int blockingCallbacks, const char *NDArrayPort, int NDArrayAddr, int priority, int stackSize)
 Constructor for NDFileNetCDF; parameters are identical to those for NDPluginFile::NDPluginFile, and are passed directly to that base class constructor.
virtual asynStatus openFile (const char *fileName, NDFileOpenMode_t openMode, NDArray *pArray)
 Opens a netCDF file.
virtual asynStatus readFile (NDArray **pArray)
 Read NDArray data from a netCDF file; NOTE: not implemented yet.
virtual asynStatus writeFile (NDArray *pArray)
 Writes NDArray data to a netCDF file.
virtual asynStatus closeFile ()
 Closes the netCDF file opened with NDFileNetCDF::openFile.

Detailed Description

Writes NDArrays to files in the netCDF file format.

netCDF is an open-source, portable, self-describing binary format supported by Unidata at UCAR (http://www.unidata.ucar.edu/software/netcdf). The netCDF format supports arrays of any dimension and all of the data types supported by NDArray. It can store multiple NDArrays in a single file, so it sets NDPluginFile::supportsMultipleArrays to 1. If also can store all of the attributes associated with an NDArray. This class implements the 4 pure virtual functions from NDPluginFile: openFile, readFile, writeFile and closeFile.


Constructor & Destructor Documentation

NDFileNetCDF::NDFileNetCDF ( const char *  portName,
int  queueSize,
int  blockingCallbacks,
const char *  NDArrayPort,
int  NDArrayAddr,
int  priority,
int  stackSize 
)

Constructor for NDFileNetCDF; parameters are identical to those for NDPluginFile::NDPluginFile, and are passed directly to that base class constructor.

After calling the base class constructor this method sets NDPluginFile::supportsMultipleArrays=1.


Member Function Documentation

asynStatus NDFileNetCDF::closeFile ( ) [virtual]

Closes the netCDF file opened with NDFileNetCDF::openFile.

Implements NDPluginFile.

asynStatus NDFileNetCDF::openFile ( const char *  fileName,
NDFileOpenMode_t  openMode,
NDArray pArray 
) [virtual]

Opens a netCDF file.

In write mode if NDFileModeMultiple is set then the first dimension is set to NC_UNLIMITED to allow multiple arrays to be written to the same file. NOTE: Does not currently support NDFileModeRead or NDFileModeAppend.

Parameters:
[in]fileNameAbsolute path name of the file to open.
[in]openModeBit mask with one of the access mode bits NDFileModeRead, NDFileModeWrite, NDFileModeAppend. May also have the bit NDFileModeMultiple set if the file is to be opened to write or read multiple NDArrays into a single file.
[in]pArrayPointer to an NDArray; this array is used to determine the header information and data structure for the file.

Implements NDPluginFile.

asynStatus NDFileNetCDF::readFile ( NDArray **  pArray) [virtual]

Read NDArray data from a netCDF file; NOTE: not implemented yet.

Parameters:
[in]pArrayPointer to the address of an NDArray to read the data into.

Implements NDPluginFile.

asynStatus NDFileNetCDF::writeFile ( NDArray pArray) [virtual]

Writes NDArray data to a netCDF file.

Parameters:
[in]pArrayPointer to an NDArray to write to the file. This function can be called multiple times between the call to openFile and closeFile if NDFileModeMultiple was set in openMode in the call to NDFileNetCDF::openFile.

Implements NDPluginFile.


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