das2C
das core C utilities (v3)
Loading...
Searching...
No Matches
Data Structures | Functions
dataset.h File Reference

Objects which correlate arrays in index space. More...

#include <das3/dimension.h>
#include <das3/codec.h>
Include dependency graph for dataset.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  DasDs
 Das Datasets. More...
 

Functions

DAS_API DasDs * DasDs_copy (const DasDs *pThis)
 Copy a dataset object.
 
DAS_API size_t DasDs_memIndexed (const DasDs *pThis)
 The apparent memory usage of all arrays in the dataset.
 
bool DasDs_cubicCoords (const DasDs *pThis, const DasDim **pCoords)
 Get coordinate dimensions that satisfy the cubic dataset condition.
 

Detailed Description

Objects which correlate arrays in index space.

Function Documentation

◆ DasDs_copy()

DAS_API DasDs * DasDs_copy ( const DasDs *  pThis)

Copy a dataset object.

This is a copy of all structural elements of a dataset, but not it's bulk storage. The following structures are copied:

but not:

  • The parent descriptor pointer!
  • Owned DasAry objects.

The new dataset will have no NULL parent pointer. To attache it to a stream call DasStream_addDesc()

The copied objects, most notably the codecs, can be changed with affecting original dataset. If desired arrays can be detached from the new dataset or others can be added without affecting the initial dataset.

All packet reads by the initial dataset will automatically provide data to both datasets, which is typically what is needed when writing a DasStream filter such as a PSD calculator.

Note that the DasDim and DasCodec object control what is emitted on a calls to DasIO_writeDesc() and DasIO_writeData().

Parameters
pThisthe source dataset
Returns
A new dataset object allocated on the heap that shares it's storage arrays with the original dataset.

◆ DasDs_memIndexed()

DAS_API size_t DasDs_memIndexed ( const DasDs *  pThis)

The apparent memory usage of all arrays in the dataset.

Note that this is less the the apparent memory usage of all variables in the dataset.

◆ DasDs_cubicCoords()

bool DasDs_cubicCoords ( const DasDs *  pThis,
const DasDim **  pCoords 
)

Get coordinate dimensions that satisfy the cubic dataset condition.

Cubic datasets have one coordinate physical dimension for each dataset array dimension and all coordinate variables are rank 1. This is a very common condition, in fact whole libraries are based on the assumption that it's always satisfied. Das2C does not make this assumption up front.

Parameters
pThisA das dataset object
[out]pCoordsa pointer to a buffer to hold coordinate dimension object pointers, at least dataset Rank elements long. See DasDs_shape() to get the dataset rank. On a successful call, there will be one coordinate dimension pointer in each location in pCoords.
Returns
True if a set of coordinates that are orthogonal in index space exist for this dataset. False otherwise.