RAVE
polarvolume.c File Reference

Defines the functions available when working with polar volumes. More...

#include "polarvolume.h"
#include "polarnav.h"
#include "polarscan.h"
#include "rave_types.h"
#include "raveobject_list.h"
#include "rave_datetime.h"
#include "rave_debug.h"
#include "rave_alloc.h"
#include "raveobject_hashtable.h"
#include "rave_utilities.h"
#include "rave_attribute_table.h"
#include <string.h>
#include <float.h>
#include <math.h>
#include <stdio.h>

Classes

struct  _PolarVolume_t
 Represents a volume. More...
 

Macros

#define DEFAULT_PARAMETER_NAME   "DBZH"
 This is the default parameter value that should be used when working with scans.
 

Functions

int PolarVolume_setTime (PolarVolume_t *pvol, const char *value)
 Sets the nominal time.
 
const char * PolarVolume_getTime (PolarVolume_t *pvol)
 Returns the nominal time.
 
int PolarVolume_setDate (PolarVolume_t *pvol, const char *value)
 Sets the nominal date.
 
const char * PolarVolume_getDate (PolarVolume_t *pvol)
 Returns the nominal date.
 
int PolarVolume_setSource (PolarVolume_t *pvol, const char *value)
 Sets the source.
 
const char * PolarVolume_getSource (PolarVolume_t *pvol)
 Returns the source.
 
void PolarVolume_setLongitude (PolarVolume_t *pvol, double lon)
 Sets the longitude for the volume.
 
double PolarVolume_getLongitude (PolarVolume_t *pvol)
 Returns the longitude for the volume.
 
void PolarVolume_setLatitude (PolarVolume_t *pvol, double lat)
 Sets the latitude for the volume.
 
double PolarVolume_getLatitude (PolarVolume_t *pvol)
 Returns the latitude for the volume.
 
void PolarVolume_setHeight (PolarVolume_t *pvol, double height)
 Sets the height for the volume.
 
double PolarVolume_getHeight (PolarVolume_t *pvol)
 Returns the height for the volume.
 
void PolarVolume_setBeamwidth (PolarVolume_t *pvol, double bw)
 Sets the beamwidth for the volume.
 
double PolarVolume_getBeamwidth (PolarVolume_t *pvol)
 Returns the beam width for the volume.
 
void PolarVolume_setBeamwH (PolarVolume_t *self, double beamwidth)
 Sets the horizontal beamwidth.
 
double PolarVolume_getBeamwH (PolarVolume_t *self)
 Returns the horizontal beamwidth.
 
void PolarVolume_setBeamwV (PolarVolume_t *self, double beamwidth)
 Sets the vertical beamwidth.
 
double PolarVolume_getBeamwV (PolarVolume_t *self)
 Returns the vertical beamwidth.
 
double PolarVolume_getDistance (PolarVolume_t *pvol, double lon, double lat)
 Returns the distance from the radar to the specified lon/lat coordinate pair.
 
double PolarVolume_getMaxDistance (PolarVolume_t *pvol)
 Returns the maximum distance (at ground level) that this volume will cover.
 
PolarScan_tPolarVolume_getScanWithMaxDistance (PolarVolume_t *pvol)
 Returns the scan with the highest distance coverage (at ground level).
 
void PolarVolume_setProjection (PolarVolume_t *pvol, Projection_t *projection)
 Sets the projection for this polar volume.
 
Projection_tPolarVolume_getProjection (PolarVolume_t *pvol)
 Returns a copy of the projection that is used for this polar volume.
 
int PolarVolume_addScan (PolarVolume_t *pvol, PolarScan_t *scan)
 Adds a scan to the volume.
 
PolarScan_tPolarVolume_getScan (PolarVolume_t *pvol, int index)
 Returns the scan at given index.
 
int PolarVolume_getNumberOfScans (PolarVolume_t *pvol)
 Returns the number of scans.
 
int PolarVolume_removeScan (PolarVolume_t *pvol, int index)
 Removes the scan at specified index.
 
PolarScan_tPolarVolume_getScanClosestToElevation (PolarVolume_t *pvol, double e, int inside)
 Returns the scan with elevation closest to the specified elevation.
 
int PolarVolume_indexOf (PolarVolume_t *pvol, PolarScan_t *scan)
 Returns the index in the list of scans of the specified scan.
 
void PolarVolume_getLonLatNavigationInfo (PolarVolume_t *pvol, double lon, double lat, double height, PolarNavigationInfo *info)
 Returns the navigation information that is the result from finding the lon/lat-coordinate at the specified height for this volume.
 
PolarNavigationInfoPolarVolume_getVerticalLonLatNavigationInfo (PolarVolume_t *pvol, double lon, double lat, int *nrNavInfo)
 Returns an array of navigation info for all scans at the specified lon/lat.
 
RaveValueType PolarVolume_getNearest (PolarVolume_t *pvol, double lon, double lat, double height, int insidee, double *v)
 Fetches the value nearest to the specified position.
 
RaveValueType PolarVolume_getNearestParameterValue (PolarVolume_t *pvol, const char *quantity, double lon, double lat, double height, int insidee, double *v)
 Fetches the nearest parameter value for the specified position.
 
RaveValueType PolarVolume_getConvertedVerticalMaxValue (PolarVolume_t *self, const char *quantity, double lon, double lat, double *v, PolarNavigationInfo *navinfo)
 Returns the vertical max value at the specified lon/lat coordinate.
 
RaveValueType PolarVolume_getConvertedParameterValueAt (PolarVolume_t *pvol, const char *quantity, int ei, int ri, int ai, double *v)
 Returns the converted parameter value at the specified location.
 
int PolarVolume_getNearestNavigationInfo (PolarVolume_t *pvol, double lon, double lat, double height, int insidee, PolarNavigationInfo *navinfo)
 Returns the navigation nearest to specified lon/lat/height.
 
int PolarVolume_getSurroundingNavigationInfos (PolarVolume_t *pvol, double lon, double lat, double height, int insidee, int surroundingScans, int surroundingRangeBins, int surroundingRays, PolarNavigationInfo navinfos[])
 Returns the navigation info structures representing positions closest surrounding the specfied lon/lat/height.
 
void PolarVolume_addEiForNavInfos (PolarVolume_t *pvol, PolarScan_t *scan, PolarNavigationInfo navinfos[], int noofNavinfos, int startNavInfoIndex)
 Adds elevation angle index information to a list of navigation info structures, based on an input scan.
 
RaveValueType PolarVolume_getNearestConvertedParameterValue (PolarVolume_t *pvol, const char *quantity, double lon, double lat, double height, int insidee, double *v, PolarNavigationInfo *navinfo)
 Fetches the nearest converted parameter value for the specified position.
 
int PolarVolume_getQualityValueAt (PolarVolume_t *pvol, const char *quantity, int ei, int ri, int ai, const char *name, int convert, double *v)
 Returns the quality value for the quality field that has a name matching the how/task attribute for the specified scan.
 
int PolarVolume_setDefaultParameter (PolarVolume_t *pvol, const char *quantity)
 Sets the default parameter that should be used when operating on this volume unless the parameter (quantity) explicitly has been specified in the function.
 
const char * PolarVolume_getDefaultParameter (PolarVolume_t *pvol)
 Returns the currently specified default parameter name.
 
void PolarVolume_sortByElevations (PolarVolume_t *pvol, int ascending)
 Arranges the scans in either ascending or descending elevation.
 
int PolarVolume_isAscendingScans (PolarVolume_t *pvol)
 Verifies that the scans are sorted in ascending order.
 
int PolarVolume_isTransformable (PolarVolume_t *pvol)
 Verifies that all preconditions are met in order to perform a transformation.
 
int PolarVolume_addAttribute (PolarVolume_t *pvol, RaveAttribute_t *attribute)
 Adds a rave attribute to the volume.
 
int PolarVolume_addAttributeVersion (PolarVolume_t *pvol, RaveAttribute_t *attribute, RaveIO_ODIM_Version version)
 Adds a rave attribute to the volume using version as well.
 
RaveAttribute_tPolarVolume_getAttribute (PolarVolume_t *pvol, const char *name)
 Returns the rave attribute that is named accordingly.
 
RaveAttribute_tPolarVolume_getAttributeVersion (PolarVolume_t *pvol, const char *name, RaveIO_ODIM_Version version)
 Returns the rave attribute that is named accordingly for specified version.
 
void PolarVolume_removeAttribute (PolarVolume_t *pvol, const char *attrname)
 Removes a rave attribute from the volume.
 
RaveList_tPolarVolume_getAttributeNames (PolarVolume_t *pvol)
 Returns a list of attribute names.
 
RaveList_tPolarVolume_getAttributeNamesVersion (PolarVolume_t *pvol, RaveIO_ODIM_Version version)
 Returns a list of attribute names for specified version.
 
int PolarVolume_hasAttribute (PolarVolume_t *pvol, const char *name)
 Returns if the volume has the specified attribute or not.
 
RaveObjectList_tPolarVolume_getAttributeValues (PolarVolume_t *pvol)
 Returns a list of attribute values that should be stored for this volume.
 
RaveObjectList_tPolarVolume_getAttributeValuesVersion (PolarVolume_t *pvol, RaveIO_ODIM_Version version)
 Returns a list of attribute values in specified version for attributes that has been set in this volume.
 
int PolarVolume_isValid (PolarVolume_t *pvol)
 Validates the volume regarding storage.
 
PolarScan_tPolarVolume_findScanWithQualityFieldByHowTask (PolarVolume_t *pvol, const char *howtaskvalue, const char *quantity)
 Locates a scan with a quality field that has a how/task value == howtaskvalue.
 
PolarScan_tPolarVolume_findAnyScanWithQualityFieldByHowTask (PolarVolume_t *pvol, const char *howtaskvalue)
 Basically the same as PolarVolume_findScanWithQualityFieldByHowTask with the exception that all parameters are traversed until a how/task value field is found to be matching.
 
RaveField_tPolarVolume_getDistanceField (PolarVolume_t *self)
 Gets the distance field for self.
 
RaveField_tPolarVolume_getHeightField (PolarVolume_t *self)
 Gets the height field for self.
 
PolarObservationPolarVolume_getCorrectedValuesAtHeight (PolarVolume_t *self, double height, double gap, int *nobservations)
 Returns all observations at the specified height inside the specified gap.
 
void PolarVolume_setUseAzimuthalNavInformation (PolarVolume_t *self, int v)
 Utility function for setting all scans in this volume to use or not use azimuthal navigation.
 
int PolarVolume_useAzimuthalNavInformation (PolarVolume_t *self)
 Returns if the azimuthal nav information should be used or not.
 
int PolarVolume_removeParametersExcept (PolarVolume_t *self, RaveList_t *parameters)
 Removes all parameters from all scans belongning to this volume except the ones specified in parameters (list of strings)
 

Variables

RaveCoreObjectType PolarVolume_TYPE
 Type definition to use when creating a rave object.
 

Detailed Description

Defines the functions available when working with polar volumes.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2009-10-15

Macro Definition Documentation

◆ DEFAULT_PARAMETER_NAME

#define DEFAULT_PARAMETER_NAME   "DBZH"

This is the default parameter value that should be used when working with scans.

Function Documentation

◆ PolarVolume_addAttribute()

int PolarVolume_addAttribute ( PolarVolume_t * pvol,
RaveAttribute_t * attribute )

Adds a rave attribute to the volume.

what/date, what/time, what/source, where/lon, where/lat and where/height are handled specially and will be added to respective member instead of stored as attributes. what/date, what/time and what/source must be string. where/lon and where/lat must be double in degrees. where/height must be double in meters.

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

◆ PolarVolume_addAttributeVersion()

int PolarVolume_addAttributeVersion ( PolarVolume_t * pvol,
RaveAttribute_t * attribute,
RaveIO_ODIM_Version version )

Adds a rave attribute to the volume using version as well.

NOTE! This method is usually only used internally.

Parameters
[in]pvol- self
[in]attribute- the attribute
[in]version- version of attribute requested
Returns
1 on success otherwise 0

◆ PolarVolume_addEiForNavInfos()

void PolarVolume_addEiForNavInfos ( PolarVolume_t * pvol,
PolarScan_t * scan,
PolarNavigationInfo navinfos[],
int noofNavinfos,
int startNavInfoIndex )

Adds elevation angle index information to a list of navigation info structures, based on an input scan.

Parameters
[in]pvol- self (MAY NOT BE NULL)
[in]scan- the target scan within the the pvol. this is the scan for which the set ei will be valid.
[in,out]navinfos- array of navigation informations to update with ei information.
[in]noofNavinfos- the length of the navinfos array
[in]startNavInfoIndex- position in the navinfos array at which to start the update. positions located before this index will not be updated.

◆ PolarVolume_addScan()

int PolarVolume_addScan ( PolarVolume_t * pvol,
PolarScan_t * scan )

Adds a scan to the volume.

The scan will automatically be assigned the volumes navigator and projection.

Parameters
[in]pvol- the volume
[in]scan- the scan ®return 0 on failure, otherwise success

◆ PolarVolume_findAnyScanWithQualityFieldByHowTask()

PolarScan_t * PolarVolume_findAnyScanWithQualityFieldByHowTask ( PolarVolume_t * pvol,
const char * howtaskvalue )

Basically the same as PolarVolume_findScanWithQualityFieldByHowTask with the exception that all parameters are traversed until a how/task value field is found to be matching.

Parameters
[in]pvol- self
[in]howtaskvalue- the how/task value
Returns
the scan if found otherwise NULL

◆ PolarVolume_findScanWithQualityFieldByHowTask()

PolarScan_t * PolarVolume_findScanWithQualityFieldByHowTask ( PolarVolume_t * pvol,
const char * howtaskvalue,
const char * quantity )

Locates a scan with a quality field that has a how/task value == howtaskvalue.

Parameters
[in]pvol- self
[in]howtaskvalue- the how/task value
[in]quantity- the quantity
Returns
the scan if found, otherwise NULL

◆ PolarVolume_getAttribute()

RaveAttribute_t * PolarVolume_getAttribute ( PolarVolume_t * pvol,
const char * name )

Returns the rave attribute that is named accordingly.

Parameters
[in]pvol- self
[in]name- the name of the attribute
Returns
the attribute if found otherwise NULL

◆ PolarVolume_getAttributeNames()

RaveList_t * PolarVolume_getAttributeNames ( PolarVolume_t * pvol)

Returns a list of attribute names.

Release with @ref RaveList_freeAndDestroy.

Parameters
[in]pvol- self
Returns
a list of attribute names

◆ PolarVolume_getAttributeNamesVersion()

RaveList_t * PolarVolume_getAttributeNamesVersion ( PolarVolume_t * pvol,
RaveIO_ODIM_Version version )

Returns a list of attribute names for specified version.

Release with @ref RaveList_freeAndDestroy. NOTE! This method is usually only used internally.

Parameters
[in]pvol- self
[in]version- version of attribute requested
Returns
a list of attribute names

◆ PolarVolume_getAttributeValues()

RaveObjectList_t * PolarVolume_getAttributeValues ( PolarVolume_t * pvol)

Returns a list of attribute values that should be stored for this volume.

Parameters
[in]pvol- self
Returns
a list of RaveAttributes.

◆ PolarVolume_getAttributeValuesVersion()

RaveObjectList_t * PolarVolume_getAttributeValuesVersion ( PolarVolume_t * pvol,
RaveIO_ODIM_Version version )

Returns a list of attribute values in specified version for attributes that has been set in this volume.

NOTE! This method is usually only used internally.

Parameters
[in]pvol- self
[in]version- version of attribute requested
Returns
a list of RaveAttributes.

◆ PolarVolume_getAttributeVersion()

RaveAttribute_t * PolarVolume_getAttributeVersion ( PolarVolume_t * pvol,
const char * name,
RaveIO_ODIM_Version version )

Returns the rave attribute that is named accordingly for specified version.

NOTE! This method is usually only used internally.

Parameters
[in]pvol- self
[in]name- the name of the attribute
[in]version- version of attribute requested
Returns
the attribute if found otherwise NULL

◆ PolarVolume_getBeamwH()

double PolarVolume_getBeamwH ( PolarVolume_t * self)

Returns the horizontal beamwidth.

Default is 1.0 * M_PI/360.0.

Parameters
[in]self- self
Returns
the beam width om radians

◆ PolarVolume_getBeamwidth()

double PolarVolume_getBeamwidth ( PolarVolume_t * pvol)

Returns the beam width for the volume.

Parameters
[in]pvol- self
Returns
the beam width in radians

◆ PolarVolume_getBeamwV()

double PolarVolume_getBeamwV ( PolarVolume_t * self)

Returns the vertical beamwidth.

Default is 1.0 * M_PI/360.0.

Parameters
[in]self- self
Returns
the beam width om radians

◆ PolarVolume_getConvertedParameterValueAt()

RaveValueType PolarVolume_getConvertedParameterValueAt ( PolarVolume_t * pvol,
const char * quantity,
int ei,
int ri,
int ai,
double * v )

Returns the converted parameter value at the specified location.

Parameters
[in]pvol- self
[in]quantity- the quantity
[in]ei- elevation index
[in]ri- bin index
[in]ai- azimuthal index
Returns
the type of the value

◆ PolarVolume_getConvertedVerticalMaxValue()

RaveValueType PolarVolume_getConvertedVerticalMaxValue ( PolarVolume_t * self,
const char * quantity,
double lon,
double lat,
double * v,
PolarNavigationInfo * navinfo )

Returns the vertical max value at the specified lon/lat coordinate.

Parameters
[in]self- self
[in]quantity- the parameter (MAY NOT BE NULL)
[in]lon- the longitude (in radians)
[in]lat- the latitude (in radians)
[out]v- the value (MAY NOT BE NULL)
[out]navinfo- will be updated with navigation information
Returns
the type of the value that has been set in v.

◆ PolarVolume_getCorrectedValuesAtHeight()

PolarObservation * PolarVolume_getCorrectedValuesAtHeight ( PolarVolume_t * self,
double height,
double gap,
int * nobservations )

Returns all observations at the specified height inside the specified gap.

I.e. height +/- gap/2.

Parameters
[in]self- self
[in]height- the height
[in]gap- the gap, i.e. +/- gap/2
[out]nobservations- number of returned observations in the array
Returns
the polar observations

◆ PolarVolume_getDate()

const char * PolarVolume_getDate ( PolarVolume_t * pvol)

Returns the nominal date.

Parameters
[in]pvol- self
Returns
the nominal time (or NULL if there is none)

◆ PolarVolume_getDefaultParameter()

const char * PolarVolume_getDefaultParameter ( PolarVolume_t * pvol)

Returns the currently specified default parameter name.

Parameters
[in]scan- self
Returns
the default parameter name

◆ PolarVolume_getDistance()

double PolarVolume_getDistance ( PolarVolume_t * pvol,
double lon,
double lat )

Returns the distance from the radar to the specified lon/lat coordinate pair.

Parameters
[in]pvol- self
[in]lon- the longitude
[in]lat- the latitude
Returns
the distance in meters.

◆ PolarVolume_getDistanceField()

RaveField_t * PolarVolume_getDistanceField ( PolarVolume_t * self)

Gets the distance field for self.

Will always be a 2-dimensional array with n elevation angles * nbins. nbins will be the same number of bins as the scan with most bins has. Scans with less bins than the maximum number of bins will get a -99999.0 value at each location that not can be represented. ysize represents the number of elevations and distance is represented by xsize. The order of the elevation angles will be the same as the current volume so the scans probably should be sorted before calling this method.

Parameters
[in]self- self
Returns
the distance field

◆ PolarVolume_getHeight()

double PolarVolume_getHeight ( PolarVolume_t * pvol)

Returns the height for the volume.

Parameters
[in]pvol- the polar volume
Returns
the height

◆ PolarVolume_getHeightField()

RaveField_t * PolarVolume_getHeightField ( PolarVolume_t * self)

Gets the height field for self.

Will always be a 2-dimensional array with n elevation angles * nbins. nbins will be the same number of bins as the scan with most bins has. Scans with less bins than the maximum number of bins will get a -99999.0 value at each location that not can be represented. ysize represents the number of elevations and distance is represented by xsize. The order of the elevation angles will be the same as the current volume so the scans probably should be sorted before calling this method.

Parameters
[in]self- self
Returns
the height field

◆ PolarVolume_getLatitude()

double PolarVolume_getLatitude ( PolarVolume_t * pvol)

Returns the latitude for the volume.

Parameters
[in]pvol- the polar volume
Returns
the latitude

◆ PolarVolume_getLongitude()

double PolarVolume_getLongitude ( PolarVolume_t * pvol)

Returns the longitude for the volume.

Parameters
[in]pvol- the polar volume
Returns
the longitude

◆ PolarVolume_getLonLatNavigationInfo()

void PolarVolume_getLonLatNavigationInfo ( PolarVolume_t * pvol,
double lon,
double lat,
double height,
PolarNavigationInfo * info )

Returns the navigation information that is the result from finding the lon/lat-coordinate at the specified height for this volume.

Parameters
[in]scan- self
[in]lon- the longitude (in radians)
[in]lat- the latitude (in radians)
[in]height- the altitude (in meters)
[in,out]info- the navigation information

◆ PolarVolume_getMaxDistance()

double PolarVolume_getMaxDistance ( PolarVolume_t * pvol)

Returns the maximum distance (at ground level) that this volume will cover.

Parameters
[in]pvol- self
Returns
the maximum distance in meters

◆ PolarVolume_getNearest()

RaveValueType PolarVolume_getNearest ( PolarVolume_t * pvol,
double lon,
double lat,
double height,
int insidee,
double * v )

Fetches the value nearest to the specified position.

Parameters
[in]pvol- the polar volume (MAY NOT BE NULL)
[in]lon- the longitude (in radians)
[in]lat- the latitude (in radians)
[in]height- the height
[in]insidee- if the estimated elevation must be within the min-max elevation or not to be valid
[out]v- the value (MAY NOT BE NULL)
Returns
what type of value that has been set in v.

◆ PolarVolume_getNearestConvertedParameterValue()

RaveValueType PolarVolume_getNearestConvertedParameterValue ( PolarVolume_t * pvol,
const char * quantity,
double lon,
double lat,
double height,
int insidee,
double * v,
PolarNavigationInfo * navinfo )

Fetches the nearest converted parameter value for the specified position.

Parameters
[in]pvol- self (MAY NOT BE NULL)
[in]quantity- the parameter (MAY NOT BE NULL)
[in]lon- the longitude (in radians)
[in]lat- the latitude (in radians)
[in]height- the height
[in]insidee- if the estimated elevation must be within the min-max elevation or not to be valid
[out]v- the value (MAY NOT BE NULL)
[in,out]navinfo- the navigation information (may be NULL).
Returns
what type of value that has been set in v. If the parameter does not exist in the found scan, RaveValueType_UNDEFINED will be returned.

◆ PolarVolume_getNearestNavigationInfo()

int PolarVolume_getNearestNavigationInfo ( PolarVolume_t * pvol,
double lon,
double lat,
double height,
int insidee,
PolarNavigationInfo * navinfo )

Returns the navigation nearest to specified lon/lat/height.

Parameters
[in]pvol- self (MAY NOT BE NULL)
[in]lon- the longitude (in radians)
[in]lat- the latitude (in radians)
[in]height- the height
[in]insidee- if the estimated elevation must be within the min-max elevation or not to be valid
[in,out]navinfo- the navigation information (may be NULL).
Returns
1 if ei, ri and ai are inside boundaries otherwise 0

◆ PolarVolume_getNearestParameterValue()

RaveValueType PolarVolume_getNearestParameterValue ( PolarVolume_t * pvol,
const char * quantity,
double lon,
double lat,
double height,
int insidee,
double * v )

Fetches the nearest parameter value for the specified position.

Parameters
[in]pvol- self (MAY NOT BE NULL)
[in]quantity- the parameter (MAY NOT BE NULL)
[in]lon- the longitude (in radians)
[in]lat- the latitude (in radians)
[in]height- the height
[in]insidee- if the estimated elevation must be within the min-max elevation or not to be valid
[out]v- the value (MAY NOT BE NULL)
Returns
what type of value that has been set in v. If the parameter does not exist in the found scan, RaveValueType_UNDEFINED will be returned.

◆ PolarVolume_getNumberOfScans()

int PolarVolume_getNumberOfScans ( PolarVolume_t * pvol)

Returns the number of scans.

Parameters
[in]pvol- the volume
Returns
-1 on failure, otherwise a value >= 0

◆ PolarVolume_getProjection()

Projection_t * PolarVolume_getProjection ( PolarVolume_t * pvol)

Returns a copy of the projection that is used for this polar volume.

I.e. remember to release it.

Parameters
[in]pvol- the polar volume
Returns
a projection (or NULL if none is set)

◆ PolarVolume_getQualityValueAt()

int PolarVolume_getQualityValueAt ( PolarVolume_t * pvol,
const char * quantity,
int ei,
int ri,
int ai,
const char * name,
int convert,
double * v )

Returns the quality value for the quality field that has a name matching the how/task attribute for the specified scan.

Parameters
[in]pvol- self
[in]quantity- the parameter quantity
[in]ri- the range index (bin)
[in]ai- the azimuth index (ray)
[in]name- the value of the how/task attribute
[in]convert- indicates if value should be converted with gain and offset or not. 0 for false, true otherwise
[out]v- the found value
Returns
1 if value found otherwise 0

◆ PolarVolume_getScan()

PolarScan_t * PolarVolume_getScan ( PolarVolume_t * pvol,
int index )

Returns the scan at given index.

Parameters
[in]pvol- the volume
[in]index- the index
Returns
the scan at the specified index or NULL on failure.

◆ PolarVolume_getScanClosestToElevation()

PolarScan_t * PolarVolume_getScanClosestToElevation ( PolarVolume_t * pvol,
double e,
int inside )

Returns the scan with elevation closest to the specified elevation.

This function requires that the scans are ordered in ascending order, otherwise the behaviour will be undefined.

Parameters
[in]pvol- the polar volume
[in]e- the elevation (in radians)
[in]inside- if the elevation must be within the min-max elevation or not. Any value != 0 means that elevation must be within range.
Returns
the scan or NULL if nothing is found

◆ PolarVolume_getScanWithMaxDistance()

PolarScan_t * PolarVolume_getScanWithMaxDistance ( PolarVolume_t * pvol)

Returns the scan with the highest distance coverage (at ground level).

Parameters
[in]pvol- self
Returns
the scan with the highest distance coverage

◆ PolarVolume_getSource()

const char * PolarVolume_getSource ( PolarVolume_t * pvol)

Returns the source.

Parameters
[in]pvol- self
Returns
the source or NULL if there is none

◆ PolarVolume_getSurroundingNavigationInfos()

int PolarVolume_getSurroundingNavigationInfos ( PolarVolume_t * pvol,
double lon,
double lat,
double height,
int insidee,
int surroundingScans,
int surroundingRangeBins,
int surroundingRays,
PolarNavigationInfo navinfos[] )

Returns the navigation info structures representing positions closest surrounding the specfied lon/lat/height.

With the input parameters it is possible to state whether surrounding or just nearest position should be returned in each dimension. The navinfos-array must be allocated by calling function to accommodate the number of expected navigation infos to be returned.

Parameters
[in]pvol- self (MAY NOT BE NULL)
[in]lon- the longitude (in radians)
[in]lat- the latitude (in radians)
[in]height- the height
[in]insidee- if the estimated elevation must be within the min-max elevation or not to be valid
[in]surroundingScans- 1 if surrounding positions in the height dimension shall be collected. 0 if only nearest position shall be collected
[in]surroundingRangeBins- 1 if surrounding positions in the range dimension shall be collected. 0 if only nearest position shall be collected
[in]surroundingRays- 1 if surrounding positions in the azimuth dimension shall be collected. 0 if only nearest position shall be collected
[out]navinfos- array of returned navigation informations.
Returns
the number of returned navigation infos

◆ PolarVolume_getTime()

const char * PolarVolume_getTime ( PolarVolume_t * pvol)

Returns the nominal time.

Parameters
[in]pvol- self
Returns
the nominal time (or NULL if there is none)

◆ PolarVolume_getVerticalLonLatNavigationInfo()

PolarNavigationInfo * PolarVolume_getVerticalLonLatNavigationInfo ( PolarVolume_t * pvol,
double lon,
double lat,
int * nrNavInfo )

Returns an array of navigation info for all scans at the specified lon/lat.

◆ PolarVolume_hasAttribute()

int PolarVolume_hasAttribute ( PolarVolume_t * pvol,
const char * name )

Returns if the volume has the specified attribute or not.

Parameters
[in]pvol- self
[in]name- the name of the attribute
Returns
1 if it exists otherwise 0

◆ PolarVolume_indexOf()

int PolarVolume_indexOf ( PolarVolume_t * pvol,
PolarScan_t * scan )

Returns the index in the list of scans of the specified scan.

Parameters
[in]pvol- self
[in]scan- the scan that is searched for
Returns
-1 if not found, otherwise the index of the scan

◆ PolarVolume_isAscendingScans()

int PolarVolume_isAscendingScans ( PolarVolume_t * pvol)

Verifies that the scans are sorted in ascending order.

Parameters
[in]pvol- the volume
Returns
1 if the scans are sorted in ascending order otherwise 0.

◆ PolarVolume_isTransformable()

int PolarVolume_isTransformable ( PolarVolume_t * pvol)

Verifies that all preconditions are met in order to perform a transformation.

Parameters
[in]pvol- the polar volume
Returns
1 if the polar volume is ready, otherwise 0.

◆ PolarVolume_isValid()

int PolarVolume_isValid ( PolarVolume_t * pvol)

Validates the volume regarding storage.

Parameters
[in]pvol- self
Returns
1 if valid, otherwise 0

◆ PolarVolume_removeAttribute()

void PolarVolume_removeAttribute ( PolarVolume_t * pvol,
const char * attrname )

Removes a rave attribute from the volume.

Parameters
[in]pvol- self
[in]attrname- the name of the attribute to remove

◆ PolarVolume_removeParametersExcept()

int PolarVolume_removeParametersExcept ( PolarVolume_t * self,
RaveList_t * parameters )

Removes all parameters from all scans belongning to this volume except the ones specified in parameters (list of strings)

Parameters
[in]self- self
[in]parameters- a list of character arrays
Returns
1 on success otherwise 0

◆ PolarVolume_removeScan()

int PolarVolume_removeScan ( PolarVolume_t * pvol,
int index )

Removes the scan at specified index.

Parameters
[in]pvol- the volume
[in]index- the index of the scan
Returns
1 on sucess otherwise 0

◆ PolarVolume_setBeamwH()

void PolarVolume_setBeamwH ( PolarVolume_t * self,
double beamwidth )

Sets the horizontal beamwidth.

Default is 1.0 * M_PI/360.0

Parameters
[in]self- self
[in]beamwidth- the beam width in radians

◆ PolarVolume_setBeamwidth()

void PolarVolume_setBeamwidth ( PolarVolume_t * pvol,
double bw )

Sets the beamwidth for the volume.

All scans will get the specified beamwidth. If you only want to make the beamwidth affect an individual scan, modify the scan directly.

Parameters
[in]pvol- self
[in]bw- beam width in radians

◆ PolarVolume_setBeamwV()

void PolarVolume_setBeamwV ( PolarVolume_t * self,
double beamwidth )

Sets the vertical beamwidth.

Default is 1.0 * M_PI/360.0

Parameters
[in]self- self
[in]beamwidth- the beam width in radians

◆ PolarVolume_setDate()

int PolarVolume_setDate ( PolarVolume_t * pvol,
const char * value )

Sets the nominal date.

Parameters
[in]pvol- self
[in]value- the date in the format YYYYMMDD
Returns
1 on success, otherwise 0

◆ PolarVolume_setDefaultParameter()

int PolarVolume_setDefaultParameter ( PolarVolume_t * pvol,
const char * quantity )

Sets the default parameter that should be used when operating on this volume unless the parameter (quantity) explicitly has been specified in the function.

All scans that currently are held by this volume and eventual new ones will all get the same default parameter.

Parameters
[in]scan- self
[in]quantity- the parameter (MAY NOT BE NULL)
Returns
1 on success otherwise 0

◆ PolarVolume_setHeight()

void PolarVolume_setHeight ( PolarVolume_t * pvol,
double height )

Sets the height for the volume.

Parameters
[in]pvol- the polar volume
[in]height- the height

◆ PolarVolume_setLatitude()

void PolarVolume_setLatitude ( PolarVolume_t * pvol,
double lat )

Sets the latitude for the volume.

Parameters
[in]pvol- the polar volume
[in]lat- the latitude

◆ PolarVolume_setLongitude()

void PolarVolume_setLongitude ( PolarVolume_t * pvol,
double lon )

Sets the longitude for the volume.

Parameters
[in]pvol- the polar volume
[in]lon- the longitude

◆ PolarVolume_setProjection()

void PolarVolume_setProjection ( PolarVolume_t * pvol,
Projection_t * projection )

Sets the projection for this polar volume.

All scans belonging to this volume will also get this projection assigned.

Parameters
[in]pvol- the polar volume
[in]projection- the projection

◆ PolarVolume_setSource()

int PolarVolume_setSource ( PolarVolume_t * pvol,
const char * value )

Sets the source.

Parameters
[in]pvol- self
[in]value- the source
Returns
1 on success, otherwise 0

◆ PolarVolume_setTime()

int PolarVolume_setTime ( PolarVolume_t * pvol,
const char * value )

Sets the nominal time.

Parameters
[in]pvol- self
[in]value- the time in the format HHmmss
Returns
1 on success, otherwise 0

◆ PolarVolume_setUseAzimuthalNavInformation()

void PolarVolume_setUseAzimuthalNavInformation ( PolarVolume_t * self,
int v )

Utility function for setting all scans in this volume to use or not use azimuthal navigation.

Note, this will only affect currently added scans and will not affect scans added after call to this function.

Parameters
[in]self- self
[in]v- 0 if azimuthal nav information shouldn't be used, otherwise 1

◆ PolarVolume_sortByElevations()

void PolarVolume_sortByElevations ( PolarVolume_t * pvol,
int ascending )

Arranges the scans in either ascending or descending elevation.

Parameters
[in]pvol- the volume
[in]ascending- if 1, ascending sort will be done, otherwise descending

◆ PolarVolume_useAzimuthalNavInformation()

int PolarVolume_useAzimuthalNavInformation ( PolarVolume_t * self)

Returns if the azimuthal nav information should be used or not.

Since this information actually resides in the scans the returned value will be depending on currently contained scans. If all scans have got azimuthal nav information set to 0, then 0 will be returned. Otherwise 1. This means that if at least one scan is using azimuthal nav info, we want to know this when querying the volume.

Parameters
[in]self- self
Returns
1 if nav information is used, otherwise 0.

Variable Documentation

◆ PolarVolume_TYPE

RaveCoreObjectType PolarVolume_TYPE
Initial value:
= {
"PolarVolume",
sizeof(PolarVolume_t),
PolarVolume_constructor,
PolarVolume_destructor,
PolarVolume_copyconstructor
}
struct _PolarVolume_t PolarVolume_t
Defines a Polar Volume.
Definition polarvolume.h:37

Type definition to use when creating a rave object.