NeXusDataFormat
1
NeXusCAPI
|
Functions | |
NXstatus | NXflush (NXhandle *pHandle) |
flush data to disk | |
NXstatus | NXmakedata (NXhandle handle, CONSTCHAR *label, int datatype, int rank, int dim[]) |
Create a multi dimensional data array or dataset. | |
NXstatus | NXcompmakedata (NXhandle handle, CONSTCHAR *label, int datatype, int rank, int dim[], int comp_typ, int bufsize[]) |
Create a compressed dataset. | |
NXstatus | NXcompress (NXhandle handle, int compr_type) |
Switch compression on. | |
NXstatus | NXopendata (NXhandle handle, CONSTCHAR *label) |
Open access to a dataset. | |
NXstatus | NXclosedata (NXhandle handle) |
Close access to a dataset. | |
NXstatus | NXputdata (NXhandle handle, const void *data) |
Write data to a datset which has previouly been opened with NXopendata. | |
NXstatus | NXputattr (NXhandle handle, CONSTCHAR *name, const void *data, int iDataLen, int iType) |
Write an attribute. | |
NXstatus | NXputslab (NXhandle handle, const void *data, const int start[], const int size[]) |
Write a subset of a multi dimensional dataset. | |
NXstatus | NXgetdata (NXhandle handle, void *data) |
Read a complete dataset from the currently open dataset into memory. | |
NXstatus | NXgetslab (NXhandle handle, void *data, const int start[], const int size[]) |
Read a subset of data from file into memory. | |
NXstatus | NXgetnextattr (NXhandle handle, NXname pName, int *iLength, int *iType) |
Iterate over global, group or dataset attributes depending on the currently open group or dataset. | |
NXstatus | NXgetattr (NXhandle handle, char *name, void *data, int *iDataLen, int *iType) |
Read an attribute. | |
NXstatus | NXsetnumberformat (NXhandle handle, int type, char *format) |
Sets the format for number printing. |
NXstatus NXclosedata | ( | NXhandle | handle | ) |
Close access to a dataset.
handle | A NeXus file handle as initialized by NXopen. |
NXstatus NXcompmakedata | ( | NXhandle | handle, |
CONSTCHAR * | label, | ||
int | datatype, | ||
int | rank, | ||
int | dim[], | ||
int | comp_typ, | ||
int | bufsize[] | ||
) |
Create a compressed dataset.
The dataset is NOT opened. Data from this set will automatically be compressed when writing and decompressed on reading.
handle | A NeXus file handle as initialized by NXopen. |
label | The name of the dataset |
datatype | The data type of this data set. |
rank | The number of dimensions this dataset is going to have |
comp_typ | The compression scheme to use. Possible values:
|
dim | An array of size rank holding the size of the dataset in each dimension. The first dimension can be NX_UNLIMITED. Data can be appended to such a dimension using NXputslab. |
bufsize | The dimensions of the subset of the data which usually be writen in one go. This is a parameter used by HDF for performance optimisations. If you write your data in one go, this should be the same as the data dimension. If you write it in slabs, this is your preferred slab size. |
NXstatus NXcompress | ( | NXhandle | handle, |
int | compr_type | ||
) |
Switch compression on.
This routine is superseeded by NXcompmakedata and thus is deprecated.
handle | A NeXus file handle as initialized by NXopen. |
compr_type | The compression scheme to use. Possible values:
|
NXstatus NXflush | ( | NXhandle * | pHandle | ) |
flush data to disk
pHandle | A NeXus file handle as initialized by NXopen. |
NXstatus NXgetattr | ( | NXhandle | handle, |
char * | name, | ||
void * | data, | ||
int * | iDataLen, | ||
int * | iType | ||
) |
Read an attribute.
handle | A NeXus file handle as initialized by NXopen. |
name | The name of the atrribute to read. |
data | A pointer to a memory area large enough to hold the attributes value. |
iDataLen | The length of data in bytes. |
iType | A pointer to an integer which will had been set to the NeXus data type of the attribute. |
NXstatus NXgetdata | ( | NXhandle | handle, |
void * | data | ||
) |
Read a complete dataset from the currently open dataset into memory.
handle | A NeXus file handle as initialized by NXopen. |
data | A pointer to the memory area where to read the data, too. Data must point to a memory area large enough to accomodate the data read. Otherwise your program may behave in unexpected and unwelcome ways. |
NXstatus NXgetnextattr | ( | NXhandle | handle, |
NXname | pName, | ||
int * | iLength, | ||
int * | iType | ||
) |
Iterate over global, group or dataset attributes depending on the currently open group or dataset.
In order to search attributes multiple calls to NXgetnextattr are performed in a loop until NXgetnextattr returns NX_EOD which indicates that there are no further attributes. reset search using NXinitattrdir
handle | A NeXus file handle as initialized by NXopen. |
pName | The name of the attribute |
iLength | A pointer to an integer which be set to the length of the attribute data. |
iType | A pointer to an integer which be set to the NeXus data type of the attribute. |
NXstatus NXgetslab | ( | NXhandle | handle, |
void * | data, | ||
const int | start[], | ||
const int | size[] | ||
) |
Read a subset of data from file into memory.
handle | A NeXus file handle as initialized by NXopen. |
data | A pointer to the memory data where to copy the data too. The pointer must point to a memory area large enough to accomodate the size of the data read. |
start | An array holding the start indices where to start reading the data subset. |
size | An array holding the size of the data subset to read for each dimension. |
NXstatus NXmakedata | ( | NXhandle | handle, |
CONSTCHAR * | label, | ||
int | datatype, | ||
int | rank, | ||
int | dim[] | ||
) |
Create a multi dimensional data array or dataset.
The dataset is NOT opened.
handle | A NeXus file handle as initialized by NXopen. |
label | The name of the dataset |
datatype | The data type of this data set. |
rank | The number of dimensions this dataset is going to have |
dim | An array of size rank holding the size of the dataset in each dimension. The first dimension can be NX_UNLIMITED. Data can be appended to such a dimension using NXputslab. |
NXstatus NXopendata | ( | NXhandle | handle, |
CONSTCHAR * | label | ||
) |
Open access to a dataset.
After this call it is possible to write and read data or attributes to and from the dataset.
handle | A NeXus file handle as initialized by NXopen. |
label | The name of the dataset |
NXstatus NXputattr | ( | NXhandle | handle, |
CONSTCHAR * | name, | ||
const void * | data, | ||
int | iDataLen, | ||
int | iType | ||
) |
Write an attribute.
The kind of attribute written depends on the poistion in the file: at root level, a global attribute is written, if agroup is open but no dataset, a group attribute is written, if a dataset is open, a dataset attribute is written.
handle | A NeXus file handle as initialized by NXopen. |
name | The name of the attribute. |
data | A pointer to the data to write for the attribute. |
iDataLen | The length of the data in data in bytes. |
iType | The NeXus data type of the attribute. |
NXstatus NXputdata | ( | NXhandle | handle, |
const void * | data | ||
) |
Write data to a datset which has previouly been opened with NXopendata.
This writes all the data in one go. Data should be a pointer to a memory area matching the datatype and dimensions of the dataset.
handle | A NeXus file handle as initialized by NXopen. |
data | Pointer to data to write. |
NXstatus NXputslab | ( | NXhandle | handle, |
const void * | data, | ||
const int | start[], | ||
const int | size[] | ||
) |
Write a subset of a multi dimensional dataset.
handle | A NeXus file handle as initialized by NXopen. |
data | A pointer to a memory area holding the data to write. |
start | An array holding the start indices where to start the data subset. |
size | An array holding the size of the data subset to write in each dimension. |
NXstatus NXsetnumberformat | ( | NXhandle | handle, |
int | type, | ||
char * | format | ||
) |
Sets the format for number printing.
This call has only an effect when using the XML physical file format.
handle | A NeXus file handle as initialized by NXopen. |
type | The NeXus data type to set the format for. |
format | The C-language format string to use for this data type. |