RAVE
rave_types.c File Reference

Type definitions for RAVE. More...

#include "rave_types.h"
#include "rave_alloc.h"
#include "rave_debug.h"
#include "string.h"
#include "stdlib.h"
#include <stdio.h>

Classes

struct  RaveTypes_ProductMapping
 Mapping between a product type and the corresponding string. More...
 
struct  RaveIO_ObjectTypeMapping
 Mapping between a object type and the corresponding string. More...
 

Functions

int get_ravetype_size (RaveDataType type)
 Returns the size of the datatype.
 
Rave_ProductType RaveTypes_getProductTypeFromString (const char *name)
 Translates the string representation of the product type into the enum.
 
const char * RaveTypes_getStringFromProductType (Rave_ProductType type)
 Returns the string representation of the product type.
 
Rave_ObjectType RaveTypes_getObjectTypeFromString (const char *name)
 Translates the string representation of the object type into the enum.
 
const char * RaveTypes_getStringFromObjectType (Rave_ObjectType type)
 Returns the string representation of the object type.
 
void RaveTypes_FreePolarObservationLinkedList (PolarObservationLinkedList *obs)
 Deallocates this linked list and all its children.
 
PolarObservationRaveTypes_PolarObservationLinkedListToArray (PolarObservationLinkedList *llobs, int *nritems)
 Creates an array of PolarObservations from a PolarObservationLinkedList.
 
PolarObservationRaveTypes_FilterPolarObservationDataValues (PolarObservation *observations, int nobservations, int *ndataobservations)
 Removes all items that are not data-values in the observation array.
 
void RaveTypes_SortPolarObservations (PolarObservation *observations, int nobservations)
 Sorts the array of observations.
 

Detailed Description

Type definitions for RAVE.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2009-12-17

Function Documentation

◆ get_ravetype_size()

int get_ravetype_size ( RaveDataType type)

Returns the size of the datatype.

Parameters
[in]type- the rave data type
Returns
the size or -1 if size not can be determined

◆ RaveTypes_FilterPolarObservationDataValues()

PolarObservation * RaveTypes_FilterPolarObservationDataValues ( PolarObservation * observations,
int nobservations,
int * ndataobservations )

Removes all items that are not data-values in the observation array.

Parameters
[in]observations- the array to be filtered
[in]nobservations- number of observations
[out]ndataobservations- the number of returned observations containing data values
Returns
the data observations

◆ RaveTypes_FreePolarObservationLinkedList()

void RaveTypes_FreePolarObservationLinkedList ( PolarObservationLinkedList * obs)

Deallocates this linked list and all its children.

Parameters
[in]obs- the observation to release

◆ RaveTypes_getObjectTypeFromString()

Rave_ObjectType RaveTypes_getObjectTypeFromString ( const char * name)

Translates the string representation of the object type into the enum.

Parameters
[in]name- the string representation of the object type
Returns
a object type or UNDEFINED if not found.

◆ RaveTypes_getProductTypeFromString()

Rave_ProductType RaveTypes_getProductTypeFromString ( const char * name)

Translates the string representation of the product type into the enum.

Parameters
[in]name- the string representation of the product type
Returns
a product type or UNDEFINED if not found.

◆ RaveTypes_getStringFromObjectType()

const char * RaveTypes_getStringFromObjectType ( Rave_ObjectType type)

Returns the string representation of the object type.

Parameters
[in]type- the object type
Returns
the string representation or NULL if nothing could be found.

◆ RaveTypes_getStringFromProductType()

const char * RaveTypes_getStringFromProductType ( Rave_ProductType type)

Returns the string representation of the product type.

Parameters
[in]type- the product type
Returns
the string representation or NULL if nothing could be found.

◆ RaveTypes_PolarObservationLinkedListToArray()

PolarObservation * RaveTypes_PolarObservationLinkedListToArray ( PolarObservationLinkedList * obs,
int * nritems )

Creates an array of PolarObservations from a PolarObservationLinkedList.

Parameters
[in]obs- the linked list to be transformed into an array
[out]nritems- the number of items in the array
Returns
the array

◆ RaveTypes_SortPolarObservations()

void RaveTypes_SortPolarObservations ( PolarObservation * observations,
int nobservations )

Sorts the array of observations.

All observations that are not data will be places furthest down in the array.

Parameters
[in]observations- the observations to be sorted
[in]nobservations- number of observations to be sorted