Library Reference

The ARM Data Integrator (ADI) provides a library of functions to access and manipulate the data stored in ADI’s internal data structures. These functions are provided in three languages:

C Reference

The full C reference library is maintained here.

Datasets

const char *

dsproc_dataset_name (CDSGroup * dataset)

Returns the dataset name.

CDSGroup *

dsproc_get_output_dataset (CDSgroup * dataset)

Get an output dataset.

CDSGroup *

dsproc_get_retrieved_dataset (int ds_id, int obs_index)

Get a retreived dataset.

CDSGroup *

dsproc_get_transformed_dataset (const char * coordsys_name, int ds_id, int obs_index)

Get a transformed dataset.

Dataset Dimensions

CDSDim *

dsproc_get_dim (CDSGroup *dataset, const char *name)

Get a dimension from a dataset.

size_t *

dsproc_get_dim_legth (CDSGroup *dataset, const char *name)

Get the length of a dimension in a dataset.

int

dsproc_set_dim_length (CDSGroup *dataset, const char *name, size_t length)

Set the length of a dimension in a dataset.

Dataset Attributes

int

dsproc_change_att (void *parent, int overwrite, const char *name, CDSDataType type, size_t length, void *value)

Change an attribute for a dataset or variable.

CDSAtt *

dsproc_get_att (void *parent, const char *name)

Get an attribute from a dataset or variable.

char *

dsproc_get_att_text (void *parent, const char *name, size_t *length, char *value)

Get a copy of an attribute value from a dataset or variable.

void *

dsproc_get_att_value (void *parent, const char *name, CDSDataType type, size_t *length, void *value)

Get a copy of an attribute value from a dataset or variable.

int *

dsproc_set_att (void *parent, int overwrite, const char *name, CDSDataType type, size_t length, void *value)

Set the value of an attribute in a dataset or variable.

int *

dsproc_set_att_text (void *parent, const char *name, const char *format,…)

Set the value of an attribute in a dataset or variable.

int *

dsproc_set_att_value (void *parent, const char *name, CDSDataType type, size_t length, void *value)

Set the value of an attribute in a dataset or variable.

Dataset Variables

CDSVar *

dsproc_clone_var (CDSVar *src_var, CDSGroup *dataset, const char *var_name, CDSDataType data_type, const char **dim_names, int copy_data)

Create a clone of an existing variable.

CDSVar_*

dsproc_define_var (CDSGroup *dataset, const char *name, CDSDataType type, int ndims, const char **dim_names, const char *long_name, const char *standard_name, const char *units, void *valid_min, void *valid_max, void *missing_value, void *fill_value)

Define a new variable in an existing dataset.

int

dsproc_delete_var (CDSVar *var)

Delete a variable from a dataset.

CDSVar *

dsproc_get_coord_var (CDSVar *var, int dim_index)

Get the coordinate variable for a variable’s dimension.

int

dsproc_get_dataset_vars (CDSGroup *dataset, const char **var_names, int required, CDSVar ***vars, CDSVar ***qc_vars, CDSVar ***aqc_vars)

Get variables and companion QC variables from a dataset.

CDSVar *

dsproc_get_output_var (int ds_id, const char *var_name, int obs_index)

Get a variable from an output dataset.

CDSVar *

dsproc_get_qc_var (CDSVar *var)

Get the companion QC variable for a variable.

CDSVar *

dsproc_get_retrieved_var (const char *var_name, int obs_index)

Get a primary variable from the retrieved data.

CDSVar *

dsproc_get_transformed_var (const char *var_name, int obs_index)

Get a primary variable from the transformed data.

CDSVar *

dsproc_get_trans_coordsys_var (const char *coordsys_name, const char *var_name, int obs_index)

Get a variable from a transformation coordinate system.

CDSVar *

dsproc_get_var (CDSGroup *dataset, const char *name)

Get a variable from a dataset.

const char *

dsproc_var_name (CDSVar *var)

Returns the variable name.

size_t *

dsproc_var_sample_count (CDSVar *var)

Returns the number of samples in a variable’s data array.

size_t *

dsproc_var_sample_size (CDSVar *var)

Returns the sample size of a variable.

Dataset Variable Data

void *

dsproc_alloc_var_data (CDSVar *var, size_t sample_start, size_t sample_count)

Allocate memory for a variable’s data array.

void *

dsproc_alloc_var_data_index (CDSVar *var, size_t sample_start, size_t sample_count)

Allocate memory for a variable’s data array.

void *

dsproc_get_var_data_index (CDSVar *var)

Get a data index for a multi-dimensional variable.

void *

dsproc_get_var_data (CDSVar *var, CDSDataType type, size_t sample_start, size_t *sample_count, void *missing_value, void *data)

Get a copy of the data from a dataset variable.

int

dsproc_get_var_missing_values (CDSVar *var, void **values)

Get the missing values for a CDS Variable.

void *

dsproc_init_var_data (CDSVar *var, size_t sample_start, size_t sample_count, int use_missing)

Initialize the data values for a dataset variable.

void *

dsproc_init_var_data_index (CDSVar *var, size_t sample_start, size_t sample_count, int use_missing)

Initialize the data values for a dataset variable.

void *

dsproc_set_var_data (CDSVar *var, CDSDataType type, size_t sample_start, size_t sample_count, void *missing_value, void *data)

Set the data values for a dataset variable.

Dataset Time Data

time_t

dsproc_get_base_time (void *cds_object)

Get the base time of a dataset or time variable.

size_t

dsproc_get_time_range (void *cds_object, timeval_t *start_time, timeval_t *end_time)

Get the time range of a dataset or time variable.

CDSVar *

dsproc_get_time_var (void *cds_object)

Get the time variable used by a dataset.

time_t *

dsproc_get_sample_times (void *cds_object, size_t sample_start, size_t *sample_count, time_t

Get the sample times for a dataset or time variable.

timeval_t *

dsproc_get_sample_timevals (void *cds_object, size_t sample_start, size_t *sample_count, timeval_t *sample_times)

Get the sample times for a dataset or time variable.

int

dsproc_set_base_time (void *cds_object, const char *long_name, time_t base_time)

Set the base time of a dataset or time variable.

int

dsproc_set_sample_times (void *cds_object, size_t sample_start, size_t sample_count, time_t *sample_times)

Set the sample times for a dataset or time variable.

int

dsproc_set_sample_timevals (void *cds_object, size_t sample_start, size_t sample_count, timeval_t *sample_times)

Set the sample times for a dataset or time variable.

Variable Tags

Data Structures

struct

VarTarget

Output Variable Target.

Macros

#define

VAR_SKIP_TRANSFORM 0x1

Flag instructing the transform logic to ignore this variable.

Functions

int

dsproc_add_var_output_target (CDSVar *var, int ds_id, const char *var_name)

Add an output target for a variable.

int

dsproc_copy_var_tag (CDSVar *src_var, CDSVar *dest_var)

Copy a variable tag from one variable to another.

void

dsproc_delete_var_tag (CDSVar *var)

Delete a variable tag.

int

dsproc_get_var_output_targets (CDSVar *var, VarTarget ***targets)

Get the output targets defined for the specified variable.

int

dsproc_set_var_coordsys_name (CDSVar *var, const char *coordsys_name)

Set the coordinate system for a variable.

int

dsproc_set_var_flags (CDSVar *var, int flags)

Set the control flags for a variable.

int

dsproc_set_var_output_target (CDSVar *var, int ds_id, const char *var_name)

Set the output target for a variable.

void

dsproc_unset_var_flags (CDSVar *var, int flags)

Unset the control flags for a variable.

Variable DQRs

Data Structures

struct

varDQR

Variable DQR

Functions

int

dsproc_get_var_dqrs (CDSVar *var, VarDQR ***dqrs)

Get all available DQRs for the data stored in the specified variable.

IDL Reference

The IDL code reference library is here.

Python Reference

The Python code reference library is here.