TECA
The Toolkit for Extreme Climate Analysis
teca_metadata_util Namespace Reference

Codes for dealing with teca_metadata. More...

Functions

TECA_EXPORT int get_array_extent (const teca_metadata &array_attributes, const unsigned long mesh_extent[8], unsigned long array_extent[8])
 
template<typename index_t >
int get_requested_indices (const teca_metadata &request, std::string &request_key, index_t indices[2])
 
template<typename index_t >
int get_requested_index (const teca_metadata &request, std::string &request_key, index_t &index)
 

Detailed Description

Codes for dealing with teca_metadata.

Function Documentation

◆ get_array_extent()

TECA_EXPORT int teca_metadata_util::get_array_extent ( const teca_metadata array_attributes,
const unsigned long  mesh_extent[8],
unsigned long  array_extent[8] 
)

Given a collection of array attributes (following the conventions used by the teca_cf_reader) and a mesh extent, compute and return the valid extent of the array. This takes into account 1d and 2d arrays on a 3d mesh. Return zero if successful. The mesh_dims_active key is required, if not found 1 is returned and the array_extent is set to the mesh_extent.

◆ get_requested_index()

template<typename index_t >
int teca_metadata_util::get_requested_index ( const teca_metadata request,
std::string &  request_key,
index_t &  index 
)

Get the requested index from the request. Use this function when the algorithm can not handle requests for multiple indices. A check is performed to ensure that only one index was requested.

Parameters
[in]requestthe request
[out]request_keythe name of the key holding the index @apram[out] index the requested index
Returns
zero if the index was successfully obtained.

◆ get_requested_indices()

template<typename index_t >
int teca_metadata_util::get_requested_indices ( const teca_metadata request,
std::string &  request_key,
index_t  indices[2] 
)

Get the requested index extent from the request.

Parameters
[in]requestthe request
[out]request_keythe name of the key holding the index @apram[out] indices the requested index extent
Returns
zero if the index was successfully obtained.