RAVE
acqvafeaturemap.h File Reference

Feature map used when working with acqva. More...

#include "rave_object.h"
#include "raveobject_list.h"
#include "rave_datetime.h"
#include "rave_types.h"

Go to the source code of this file.

Typedefs

typedef struct _AcqvaFeatureMap_t AcqvaFeatureMap_t
 Defines a feature map.
 
typedef struct _AcqvaFeatureMapElevation_t AcqvaFeatureMapElevation_t
 Defines a feature map elevation.
 
typedef struct _AcqvaFeatureMapField_t AcqvaFeatureMapField_t
 Defines a feature map field.
 

Functions

AcqvaFeatureMap_tAcqvaFeatureMap_load (const char *filename)
 Loads a ACQVA feature map.
 
int AcqvaFeatureMap_save (AcqvaFeatureMap_t *self, const char *filename)
 Saves the ACQVA feature map.
 
int AcqvaFeatureMap_setNod (AcqvaFeatureMap_t *self, const char *source)
 Sets the nod for this feature map.
 
const char * AcqvaFeatureMap_getNod (AcqvaFeatureMap_t *self)
 Returns the nod for this feature map.
 
void AcqvaFeatureMap_setLongitude (AcqvaFeatureMap_t *self, double lon)
 The longitude for this source.
 
double AcqvaFeatureMap_getLongitude (AcqvaFeatureMap_t *self)
 The longitude for this source.
 
void AcqvaFeatureMap_setLatitude (AcqvaFeatureMap_t *self, double lat)
 The latitude for this source.
 
double AcqvaFeatureMap_getLatitude (AcqvaFeatureMap_t *self)
 The latitude for this source.
 
void AcqvaFeatureMap_setHeight (AcqvaFeatureMap_t *self, double height)
 The height for this source.
 
double AcqvaFeatureMap_getHeight (AcqvaFeatureMap_t *self)
 The height for this source.
 
int AcqvaFeatureMap_setStartdate (AcqvaFeatureMap_t *self, const char *date)
 Sets the start date of the period this map represents.
 
const char * AcqvaFeatureMap_getStartdate (AcqvaFeatureMap_t *self)
 Returns the start date of the period this map represents.
 
int AcqvaFeatureMap_setEnddate (AcqvaFeatureMap_t *self, const char *date)
 Sets the end date of the period this map represents.
 
const char * AcqvaFeatureMap_getEnddate (AcqvaFeatureMap_t *self)
 Returns the start date of the period this map represents.
 
AcqvaFeatureMapField_tAcqvaFeatureMap_createField (AcqvaFeatureMap_t *self, long nbins, long nrays, RaveDataType type, double elangle)
 Creates a field in the feature map with wanted elevation angle and the geometry (nrays, nbins) and the field data is set to 1.
 
int AcqvaFeatureMap_addField (AcqvaFeatureMap_t *self, AcqvaFeatureMapField_t *field)
 Adds a field (scan) to the feature map.
 
AcqvaFeatureMapElevation_tAcqvaFeatureMap_createElevation (AcqvaFeatureMap_t *self, double elangle)
 Creates an elevation group in the feature map unless it already exists (same elangle) which will instead return that elevation group.
 
int AcqvaFeatureMap_addElevation (AcqvaFeatureMap_t *self, AcqvaFeatureMapElevation_t *elevation)
 Adds an elevation group in the feature map unless it already exists.
 
int AcqvaFeatureMap_getNumberOfElevations (AcqvaFeatureMap_t *self)
 Returns the number of elevation groups in the feature map.
 
AcqvaFeatureMapElevation_tAcqvaFeatureMap_getElevation (AcqvaFeatureMap_t *self, int index)
 Returns the elevation group at given index.
 
void AcqvaFeatureMap_removeElevation (AcqvaFeatureMap_t *self, int index)
 Removes the elevation group at specified index.
 
AcqvaFeatureMapField_tAcqvaFeatureMap_findField (AcqvaFeatureMap_t *self, long nbins, long nrays, double elangle)
 Locates a matching field that is very close to elangle < 1e-4 with wanted nrays & nbins.
 
AcqvaFeatureMapElevation_tAcqvaFeatureMap_findElevation (AcqvaFeatureMap_t *self, double elangle)
 Locates a matching field that is very close to elangle < 1e-4.
 
int AcqvaFeatureMapElevation_setElangle (AcqvaFeatureMapElevation_t *self, double elangle)
 Sets the elevation angle for this group.
 
double AcqvaFeatureMapElevation_getElangle (AcqvaFeatureMapElevation_t *self)
 Gets the elevation angle for this group.
 
int AcqvaFeatureMapElevation_add (AcqvaFeatureMapElevation_t *self, AcqvaFeatureMapField_t *field)
 Adds a field to the elevation group.
 
int AcqvaFeatureMapElevation_size (AcqvaFeatureMapElevation_t *self)
 Returns number of fields in this elevation group.
 
AcqvaFeatureMapField_tAcqvaFeatureMapElevation_get (AcqvaFeatureMapElevation_t *self, int index)
 Returns field at index.
 
void AcqvaFeatureMapElevation_remove (AcqvaFeatureMapElevation_t *self, int index)
 Returns field at index.
 
AcqvaFeatureMapField_tAcqvaFeatureMapElevation_find (AcqvaFeatureMapElevation_t *self, long nbins, long nrays)
 Locates a field that matches the nbins and nrays.
 
int AcqvaFeatureMapElevation_has (AcqvaFeatureMapElevation_t *self, long nbins, long nrays)
 Locates a field that matches the nbins and nrays and returns true or false depending on if it exists.
 
int AcqvaFeatureMapField_setElangle (AcqvaFeatureMapField_t *self, double elangle)
 Sets the elevation angle for this field.
 
double AcqvaFeatureMapField_getElangle (AcqvaFeatureMapField_t *self)
 Gets the elevation angle for this field.
 
long AcqvaFeatureMapField_getNbins (AcqvaFeatureMapField_t *self)
 
long AcqvaFeatureMapField_getNrays (AcqvaFeatureMapField_t *self)
 
RaveDataType AcqvaFeatureMapField_getDatatype (AcqvaFeatureMapField_t *self)
 
int AcqvaFeatureMapField_createData (AcqvaFeatureMapField_t *self, long nbins, long nrays, RaveDataType type)
 Creates a data field with specified geometry and type and will be initialized to 0.
 
int AcqvaFeatureMapField_setData (AcqvaFeatureMapField_t *self, long nbins, long nrays, void *data, RaveDataType type)
 Sets a data field with specified data, geometry and type.
 
void * AcqvaFeatureMapField_getData (AcqvaFeatureMapField_t *self)
 Returns the data.
 
int AcqvaFeatureMapField_fill (AcqvaFeatureMapField_t *self, double value)
 Fills the complete array with wanted value.
 
int AcqvaFeatureMapField_setValue (AcqvaFeatureMapField_t *self, int bin, int ray, double v)
 Sets a value in the data field.
 
int AcqvaFeatureMapField_getValue (AcqvaFeatureMapField_t *self, int bin, int ray, double *v)
 Gets a value from the data field.
 
AcqvaFeatureMapField_tAcqvaFeatureMapField_createField (long nbins, long nrays, RaveDataType type, double elangle)
 Creates a feature map field with wanted dimensions, type and elangle.
 

Variables

RaveCoreObjectType AcqvaFeatureMap_TYPE
 Type definition to use when creating a rave object.
 
RaveCoreObjectType AcqvaFeatureMapElevation_TYPE
 Type definition to use when creating a rave object.
 
RaveCoreObjectType AcqvaFeatureMapField_TYPE
 Type definition to use when creating a rave object.
 

Detailed Description

Feature map used when working with acqva.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2025-11-11

Typedef Documentation

◆ AcqvaFeatureMap_t

Defines a feature map.

◆ AcqvaFeatureMapElevation_t

Defines a feature map elevation.

This is mostly used internally by the feature map to group different elevation angles.

◆ AcqvaFeatureMapField_t

Defines a feature map field.

Function Documentation

◆ AcqvaFeatureMap_addElevation()

int AcqvaFeatureMap_addElevation ( AcqvaFeatureMap_t * self,
AcqvaFeatureMapElevation_t * elevation )

Adds an elevation group in the feature map unless it already exists.

If it already exists an error will be returned.

Parameters
[in]self- self
[in]elevation- the elevation group

◆ AcqvaFeatureMap_addField()

int AcqvaFeatureMap_addField ( AcqvaFeatureMap_t * self,
AcqvaFeatureMapField_t * field )

Adds a field (scan) to the feature map.

The field must contain the elevation angle and the geometry (nrays, nbins). Offset is assumed to be 0, gain = 1

Parameters
[in]self- self
[in]field- the field ®return 0 on failure, otherwise success

◆ AcqvaFeatureMap_createElevation()

AcqvaFeatureMapElevation_t * AcqvaFeatureMap_createElevation ( AcqvaFeatureMap_t * self,
double elangle )

Creates an elevation group in the feature map unless it already exists (same elangle) which will instead return that elevation group.

Parameters
[in]self- self
[in]elangle- the elevation angle in radians.

◆ AcqvaFeatureMap_createField()

AcqvaFeatureMapField_t * AcqvaFeatureMap_createField ( AcqvaFeatureMap_t * self,
long nbins,
long nrays,
RaveDataType type,
double elangle )

Creates a field in the feature map with wanted elevation angle and the geometry (nrays, nbins) and the field data is set to 1.

Parameters
[in]self- self
[in]nbins- number of bins
[in]nrays- number of rays
[in]type- the datatype
[in]elangle- the elevation angle of the field ®return the field

◆ AcqvaFeatureMap_findElevation()

AcqvaFeatureMapElevation_t * AcqvaFeatureMap_findElevation ( AcqvaFeatureMap_t * self,
double elangle )

Locates a matching field that is very close to elangle < 1e-4.

Parameters
[in]self- self
[in]elangle- the elevation angle in radians
Returns
the feature map elevation group

◆ AcqvaFeatureMap_findField()

AcqvaFeatureMapField_t * AcqvaFeatureMap_findField ( AcqvaFeatureMap_t * self,
long nbins,
long nrays,
double elangle )

Locates a matching field that is very close to elangle < 1e-4 with wanted nrays & nbins.

Parameters
[in]self- self
[in]nrays- number of rays
[in]nbins- number of bins
[in]elangle- the elevation angle in radians
Returns
the rave field

◆ AcqvaFeatureMap_getElevation()

AcqvaFeatureMapElevation_t * AcqvaFeatureMap_getElevation ( AcqvaFeatureMap_t * self,
int index )

Returns the elevation group at given index.

Parameters
[in]self- self
[in]index- the index
Returns
the elevation group

◆ AcqvaFeatureMap_getEnddate()

const char * AcqvaFeatureMap_getEnddate ( AcqvaFeatureMap_t * self)

Returns the start date of the period this map represents.

Parameters
[in]self- self
Returns
the date (YYYYmmdd)

◆ AcqvaFeatureMap_getHeight()

double AcqvaFeatureMap_getHeight ( AcqvaFeatureMap_t * self)

The height for this source.

Parameters
[in]self- self
Returns
the altitude above sea level in meters

◆ AcqvaFeatureMap_getLatitude()

double AcqvaFeatureMap_getLatitude ( AcqvaFeatureMap_t * self)

The latitude for this source.

Parameters
[in]self- self
Returns
the latitude in radians

◆ AcqvaFeatureMap_getLongitude()

double AcqvaFeatureMap_getLongitude ( AcqvaFeatureMap_t * self)

The longitude for this source.

Parameters
[in]self- self
Returns
the longitude in radians

◆ AcqvaFeatureMap_getNod()

const char * AcqvaFeatureMap_getNod ( AcqvaFeatureMap_t * self)

Returns the nod for this feature map.

Parameters
[in]self- self
Returns
the nod

◆ AcqvaFeatureMap_getNumberOfElevations()

int AcqvaFeatureMap_getNumberOfElevations ( AcqvaFeatureMap_t * self)

Returns the number of elevation groups in the feature map.

Parameters
[in]self- self
Returns
the number of elevation groups

◆ AcqvaFeatureMap_getStartdate()

const char * AcqvaFeatureMap_getStartdate ( AcqvaFeatureMap_t * self)

Returns the start date of the period this map represents.

Parameters
[in]self- self
Returns
the date (YYYYmmdd)

◆ AcqvaFeatureMap_load()

AcqvaFeatureMap_t * AcqvaFeatureMap_load ( const char * filename)

Loads a ACQVA feature map.

Parameters
[in]filename- the filename
Returns
the feature map or NULL on failure

◆ AcqvaFeatureMap_removeElevation()

void AcqvaFeatureMap_removeElevation ( AcqvaFeatureMap_t * self,
int index )

Removes the elevation group at specified index.

Parameters
[in]self- self
[in]index- the index

◆ AcqvaFeatureMap_save()

int AcqvaFeatureMap_save ( AcqvaFeatureMap_t * self,
const char * filename )

Saves the ACQVA feature map.

Parameters
[in]self- self
[in]filename- the name to use when saving the feature map
Returns
1 on success otherwise 0

◆ AcqvaFeatureMap_setEnddate()

int AcqvaFeatureMap_setEnddate ( AcqvaFeatureMap_t * self,
const char * date )

Sets the end date of the period this map represents.

Parameters
[in]self- self
[in]date- the date (YYYYmmdd)
Returns
1 on success otherwise 0

◆ AcqvaFeatureMap_setHeight()

void AcqvaFeatureMap_setHeight ( AcqvaFeatureMap_t * self,
double height )

The height for this source.

Parameters
[in]self- self
[in]height- the altitude above sea level in meters

◆ AcqvaFeatureMap_setLatitude()

void AcqvaFeatureMap_setLatitude ( AcqvaFeatureMap_t * self,
double lat )

The latitude for this source.

Parameters
[in]self- self
[in]lat- the latitude (in radians)

◆ AcqvaFeatureMap_setLongitude()

void AcqvaFeatureMap_setLongitude ( AcqvaFeatureMap_t * self,
double lon )

The longitude for this source.

Parameters
[in]self- self
[in]lon- the longitude (in radians)

◆ AcqvaFeatureMap_setNod()

int AcqvaFeatureMap_setNod ( AcqvaFeatureMap_t * self,
const char * source )

Sets the nod for this feature map.

Parameters
[in]self- self
[in]nod- the nod
Returns
1 on success otherwise 0

◆ AcqvaFeatureMap_setStartdate()

int AcqvaFeatureMap_setStartdate ( AcqvaFeatureMap_t * self,
const char * date )

Sets the start date of the period this map represents.

Parameters
[in]self- self
[in]date- the date (YYYYmmdd)
Returns
1 on success otherwise 0

◆ AcqvaFeatureMapElevation_add()

int AcqvaFeatureMapElevation_add ( AcqvaFeatureMapElevation_t * self,
AcqvaFeatureMapField_t * field )

Adds a field to the elevation group.

The field must have same elevation angle as the group and the nbins and nrays must not already exist.

Parameters
[in]self- the elevation
[in]field- the field. nbins/nrays must already exist in the group
Returns
1 if successful, otherwise 0

◆ AcqvaFeatureMapElevation_find()

AcqvaFeatureMapField_t * AcqvaFeatureMapElevation_find ( AcqvaFeatureMapElevation_t * self,
long nbins,
long nrays )

Locates a field that matches the nbins and nrays.

Parameters
[in]self- self
[in]nrays- number of rays
[in]nbins- number of bins
Returns
the featuremap field

◆ AcqvaFeatureMapElevation_get()

AcqvaFeatureMapField_t * AcqvaFeatureMapElevation_get ( AcqvaFeatureMapElevation_t * self,
int index )

Returns field at index.

Parameters
[in]self- self
[in]index- index
Returns
the featuremap field or NULL

◆ AcqvaFeatureMapElevation_getElangle()

double AcqvaFeatureMapElevation_getElangle ( AcqvaFeatureMapElevation_t * self)

Gets the elevation angle for this group.

Parameters
[in]self- self
Returns
the elevation angle of this group (in radians)

◆ AcqvaFeatureMapElevation_has()

int AcqvaFeatureMapElevation_has ( AcqvaFeatureMapElevation_t * self,
long nbins,
long nrays )

Locates a field that matches the nbins and nrays and returns true or false depending on if it exists.

Parameters
[in]self- self
[in]nrays- number of rays
[in]nbins- number of bins
Returns
true or false

◆ AcqvaFeatureMapElevation_remove()

void AcqvaFeatureMapElevation_remove ( AcqvaFeatureMapElevation_t * self,
int index )

Returns field at index.

Parameters
[in]self- self
[in]index- index
Returns
the featuremap field or NULL

◆ AcqvaFeatureMapElevation_setElangle()

int AcqvaFeatureMapElevation_setElangle ( AcqvaFeatureMapElevation_t * self,
double elangle )

Sets the elevation angle for this group.

Parameters
[in]self- self
[in]elangle- the elevation angle of this group (in radians)
Returns
1 if the elevation angle is possible to set

◆ AcqvaFeatureMapElevation_size()

int AcqvaFeatureMapElevation_size ( AcqvaFeatureMapElevation_t * self)

Returns number of fields in this elevation group.

Parameters
[in]self- the elevation
Returns
number of fields in group

◆ AcqvaFeatureMapField_createData()

int AcqvaFeatureMapField_createData ( AcqvaFeatureMapField_t * self,
long nbins,
long nrays,
RaveDataType type )

Creates a data field with specified geometry and type and will be initialized to 0.

Parameters
[in]self- self
[in]nbins- number of bins
[in]nrays- number of rays
[in]type- data type
Returns
1 on success otherwise 0

◆ AcqvaFeatureMapField_createField()

AcqvaFeatureMapField_t * AcqvaFeatureMapField_createField ( long nbins,
long nrays,
RaveDataType type,
double elangle )

Creates a feature map field with wanted dimensions, type and elangle.

◆ AcqvaFeatureMapField_fill()

int AcqvaFeatureMapField_fill ( AcqvaFeatureMapField_t * self,
double value )

Fills the complete array with wanted value.

Parameters
[in]self- self
[in]value- the value to use for all cells
Returns
1 on success otherwise 0

◆ AcqvaFeatureMapField_getData()

void * AcqvaFeatureMapField_getData ( AcqvaFeatureMapField_t * self)

Returns the data.

◆ AcqvaFeatureMapField_getDatatype()

RaveDataType AcqvaFeatureMapField_getDatatype ( AcqvaFeatureMapField_t * self)
Parameters
[in]self- self
Returns
data type

◆ AcqvaFeatureMapField_getElangle()

double AcqvaFeatureMapField_getElangle ( AcqvaFeatureMapField_t * self)

Gets the elevation angle for this field.

Parameters
[in]self- self
Returns
the elevation angle of this group (in radians)

◆ AcqvaFeatureMapField_getNbins()

long AcqvaFeatureMapField_getNbins ( AcqvaFeatureMapField_t * self)
Parameters
[in]self- self
Returns
number of bins

◆ AcqvaFeatureMapField_getNrays()

long AcqvaFeatureMapField_getNrays ( AcqvaFeatureMapField_t * self)
Parameters
[in]self- self
Returns
number of rays

◆ AcqvaFeatureMapField_getValue()

int AcqvaFeatureMapField_getValue ( AcqvaFeatureMapField_t * self,
int bin,
int ray,
double * v )

Gets a value from the data field.

Parameters
[in]self- self
[in]bin- bin index
[in]ray- ray index
[in,out]v- the value to retrieve (must be != NULL)
Returns
1 on success otherwise 0

◆ AcqvaFeatureMapField_setData()

int AcqvaFeatureMapField_setData ( AcqvaFeatureMapField_t * self,
long nbins,
long nrays,
void * data,
RaveDataType type )

Sets a data field with specified data, geometry and type.

◆ AcqvaFeatureMapField_setElangle()

int AcqvaFeatureMapField_setElangle ( AcqvaFeatureMapField_t * self,
double elangle )

Sets the elevation angle for this field.

Parameters
[in]self- self
[in]elangle- the elevation angle of this group (in radians)
Returns
1 if the elevation angle is possible to set

◆ AcqvaFeatureMapField_setValue()

int AcqvaFeatureMapField_setValue ( AcqvaFeatureMapField_t * self,
int bin,
int ray,
double v )

Sets a value in the data field.

Parameters
[in]self- self
[in]bin- bin index
[in]ray- ray index
[in]v- the value to set
Returns
1 on success otherwise 0

Variable Documentation

◆ AcqvaFeatureMap_TYPE

RaveCoreObjectType AcqvaFeatureMap_TYPE
extern

Type definition to use when creating a rave object.

◆ AcqvaFeatureMapElevation_TYPE

RaveCoreObjectType AcqvaFeatureMapElevation_TYPE
extern

Type definition to use when creating a rave object.

◆ AcqvaFeatureMapField_TYPE

RaveCoreObjectType AcqvaFeatureMapField_TYPE
extern

Type definition to use when creating a rave object.