Gwyfile Library
Functions
High level data management

Functions

int * gwyfile_object_container_enumerate_channels (const GwyfileObject *object, unsigned int *nchannels)
 Enumerates channels in a Gwyddion GWY file. More...
 
int * gwyfile_object_container_enumerate_volume (const GwyfileObject *object, unsigned int *nvolume)
 Enumerates volume data in a Gwyddion GWY file. More...
 
int * gwyfile_object_container_enumerate_graphs (const GwyfileObject *object, unsigned int *ngraphs)
 Enumerates graphs in a Gwyddion GWY file. More...
 
int * gwyfile_object_container_enumerate_xyz (const GwyfileObject *object, unsigned int *nxyz)
 Enumerates XYZ data in a Gwyddion GWY file. More...
 
int * gwyfile_object_container_enumerate_curvemaps (const GwyfileObject *object, unsigned int *nxyz)
 Enumerates curve map data in a Gwyddion GWY file. More...
 
int * gwyfile_object_container_enumerate_spectra (const GwyfileObject *object, unsigned int *nspectra)
 Enumerates spectra in a Gwyddion GWY file. More...
 

Detailed Description

High-level functions help with gathering information about specific data types in Gwyddion GWY files. In particular, functions for enumeration of all channels, graphs or volume data in a file are provided. These function also carry out some basic sanity checks, ensuring for instance that if ‘something’ is present at "/0/data" it also actually looks like a valid GwyDataField object.

Function Documentation

◆ gwyfile_object_container_enumerate_channels()

int* gwyfile_object_container_enumerate_channels ( const GwyfileObject *  object,
unsigned int *  nchannels 
)

Enumerates channels in a Gwyddion GWY file.

A channel is considered valid and returned in the list if its primary data field exists. The presence of auxiliary channel data (masks, presentations, selections, colour mapping settings, etc.) is not checked.

Parameters
objectA GWY file data object, presumably the main GwyContainer.
nchannelsReturn location for the number of channels.
Returns
A newly allocated array with channel numbers. It has to be freed later by the caller using free(). NULL is returned when the number of channels found is zero (this does not mean any exception in the freeing rule though).

◆ gwyfile_object_container_enumerate_curvemaps()

int* gwyfile_object_container_enumerate_curvemaps ( const GwyfileObject *  object,
unsigned int *  ncurvemaps 
)

Enumerates curve map data in a Gwyddion GWY file.

Curve map data are considered valid and returned in the list if the map is well-formed. It may be empty and the presence of auxiliary data is not checked.

Parameters
objectA GWY file data object, presumably the main GwyContainer.
ncurvemapsReturn location for the number of curve map data.
Returns
A newly allocated array with curve map data numbers. It has to be freed later by the caller using free(). NULL is returned when the number of curve map data found is zero (this does not mean any exception in the freeing rule though).
Since
1.5

◆ gwyfile_object_container_enumerate_graphs()

int* gwyfile_object_container_enumerate_graphs ( const GwyfileObject *  object,
unsigned int *  ngraphs 
)

Enumerates graphs in a Gwyddion GWY file.

Graphs are considered valid and returned in the list if the graph model object exists. The presence of auxiliary data is not checked.

Parameters
objectA GWY file data object, presumably the main GwyContainer.
ngraphsReturn location for the number of graphs.
Returns
A newly allocated array with graph numbers. It has to be freed later by the caller using free(). NULL is returned when the number of graphs found is zero (this does not mean any exception in the freeing rule though).

◆ gwyfile_object_container_enumerate_spectra()

int* gwyfile_object_container_enumerate_spectra ( const GwyfileObject *  object,
unsigned int *  nspectra 
)

Enumerates spectra in a Gwyddion GWY file.

A spectra object is considered valid and returned in the list if it looks sane. The presence of auxiliary spectra data is not checked.

Parameters
objectA GWY file data object, presumably the main GwyContainer.
nspectraReturn location for the number of spectra.
Returns
A newly allocated array with spectra numbers. It has to be freed later by the caller using free(). NULL is returned when the number of spectra found is zero (this does not mean any exception in the freeing rule though).

◆ gwyfile_object_container_enumerate_volume()

int* gwyfile_object_container_enumerate_volume ( const GwyfileObject *  object,
unsigned int *  nvolume 
)

Enumerates volume data in a Gwyddion GWY file.

Volume data are considered valid and returned in the list if the data brick exists. The presence of auxiliary data is not checked.

Parameters
objectA GWY file data object, presumably the main GwyContainer.
nvolumeReturn location for the number of volume data.
Returns
A newly allocated array with volume data numbers. It has to be freed later by the caller using free(). NULL is returned when the number of volume data found is zero (this does not mean any exception in the freeing rule though).

◆ gwyfile_object_container_enumerate_xyz()

int* gwyfile_object_container_enumerate_xyz ( const GwyfileObject *  object,
unsigned int *  nxyz 
)

Enumerates XYZ data in a Gwyddion GWY file.

XYZ data are considered valid and returned in the list if its primary surface object exists. The presence of auxiliary data is not checked.

Parameters
objectA GWY file data object, presumably the main GwyContainer.
nxyzReturn location for the number of XYZ data.
Returns
A newly allocated array with XYZ data numbers. It has to be freed later by the caller using free(). NULL is returned when the number of XYZ data found is zero (this does not mean any exception in the freeing rule though).
Since
1.2