RAVE
|
Defines the functions available when working with polar scans. More...
#include "polarscanparam.h"
#include "rave_debug.h"
#include "rave_alloc.h"
#include <string.h>
#include "rave_object.h"
#include "rave_datetime.h"
#include "rave_transform.h"
#include "rave_data2d.h"
#include "raveobject_hashtable.h"
#include "rave_utilities.h"
#include "rave_attribute_table.h"
#include <float.h>
Classes | |
struct | _PolarScanParam_t |
Represents one param in a scan. More... | |
Functions | |
int | PolarScanParam_setQuantity (PolarScanParam_t *scanparam, const char *quantity) |
Sets the quantity. | |
const char * | PolarScanParam_getQuantity (PolarScanParam_t *scanparam) |
Returns the quantity. | |
void | PolarScanParam_setGain (PolarScanParam_t *scanparam, double gain) |
Sets the gain. | |
double | PolarScanParam_getGain (PolarScanParam_t *scanparam) |
Returns the gain. | |
void | PolarScanParam_setOffset (PolarScanParam_t *scanparam, double offset) |
Sets the offset. | |
double | PolarScanParam_getOffset (PolarScanParam_t *scanparam) |
Returns the offset. | |
void | PolarScanParam_setNodata (PolarScanParam_t *scanparam, double nodata) |
Sets the nodata. | |
double | PolarScanParam_getNodata (PolarScanParam_t *scanparam) |
Returns the nodata. | |
void | PolarScanParam_setUndetect (PolarScanParam_t *scanparam, double undetect) |
Sets the undetect. | |
double | PolarScanParam_getUndetect (PolarScanParam_t *scanparam) |
Returns the undetect. | |
int | PolarScanParam_setData (PolarScanParam_t *scanparam, long nbins, long nrays, void *data, RaveDataType type) |
Sets the data. | |
int | PolarScanParam_setLazyDataset (PolarScanParam_t *scanparam, LazyDataset_t *lazyDataset) |
Sets a lazy dataset as data member. | |
int | PolarScanParam_setData2D (PolarScanParam_t *scanparam, RaveData2D_t *data2d) |
Sets the data from a rave data 2d object. | |
int | PolarScanParam_createData (PolarScanParam_t *scanparam, long nbins, long nrays, RaveDataType type) |
Creates a data field with the specified dimensions and type. | |
void * | PolarScanParam_getData (PolarScanParam_t *scanparam) |
Returns a pointer to the internal data storage. | |
RaveData2D_t * | PolarScanParam_getData2D (PolarScanParam_t *scanparam) |
Returns a copy of the internal 2d data field. | |
long | PolarScanParam_getNbins (PolarScanParam_t *scanparam) |
Returns the number of bins. | |
long | PolarScanParam_getNrays (PolarScanParam_t *scanparam) |
Returns the number of rays/scan. | |
RaveDataType | PolarScanParam_getDataType (PolarScanParam_t *scanparam) |
Returns the data type. | |
RaveValueType | PolarScanParam_getValue (PolarScanParam_t *scanparam, int bin, int ray, double *v) |
Returns the value at the specified index. | |
RaveValueType | PolarScanParam_getConvertedValue (PolarScanParam_t *scanparam, int bin, int ray, double *v) |
Returns the linear converted value at the specified index. | |
int | PolarScanParam_setValue (PolarScanParam_t *scanparam, int bin, int ray, double v) |
Sets the value. | |
int | PolarScanParam_addAttribute (PolarScanParam_t *scanparam, RaveAttribute_t *attribute) |
Adds a rave attribute to the parameter. | |
int | PolarScanParam_addAttributeVersion (PolarScanParam_t *scanparam, RaveAttribute_t *attribute, RaveIO_ODIM_Version version) |
Adds a rave attribute to the parameter. | |
RaveAttribute_t * | PolarScanParam_getAttribute (PolarScanParam_t *scanparam, const char *name) |
Returns the rave attribute that is named accordingly. | |
RaveAttribute_t * | PolarScanParam_getAttributeVersion (PolarScanParam_t *scanparam, const char *name, RaveIO_ODIM_Version version) |
Returns the rave attribute that is named accordingly and version. | |
int | PolarScanParam_hasAttribute (PolarScanParam_t *scanparam, const char *name) |
Returns if the specified attribute exists. | |
RaveList_t * | PolarScanParam_getAttributeNames (PolarScanParam_t *scanparam) |
Returns a list of attribute names. | |
RaveList_t * | PolarScanParam_getAttributeNamesVersion (PolarScanParam_t *scanparam, RaveIO_ODIM_Version version) |
Returns a list of attribute names for specified version. | |
RaveObjectList_t * | PolarScanParam_getAttributeValues (PolarScanParam_t *scanparam) |
Returns a list of attribute values that should be stored for this parameter. | |
RaveObjectList_t * | PolarScanParam_getAttributeValuesVersion (PolarScanParam_t *scanparam, RaveIO_ODIM_Version version) |
Returns a list of attribute values in specified version that has been added to this parameter. | |
int | PolarScanParam_addQualityField (PolarScanParam_t *param, RaveField_t *field) |
Adds a quality field to this scan. | |
RaveField_t * | PolarScanParam_getQualityField (PolarScanParam_t *param, int index) |
Returns the quality field at the specified location. | |
int | PolarScanParam_getNumberOfQualityFields (PolarScanParam_t *param) |
Returns the number of quality fields. | |
void | PolarScanParam_removeQualityField (PolarScanParam_t *param, int index) |
Removes the quality field at the specified location. | |
RaveObjectList_t * | PolarScanParam_getQualityFields (PolarScanParam_t *param) |
Returns all quality fields belonging to this scan parameter. | |
RaveField_t * | PolarScanParam_getQualityFieldByHowTask (PolarScanParam_t *param, const char *value) |
Returns a quality field based on the value of how/task that should be a string. | |
RaveField_t * | PolarScanParam_toField (PolarScanParam_t *param) |
Converts a polar scan parameter into a rave field. | |
PolarScanParam_t * | PolarScanParam_fromField (RaveField_t *field) |
Translates a rave field into a polar scan parameter. | |
int | PolarScanParam_convertDataDoubleToUchar (PolarScanParam_t *param) |
Converter for 64-bit float (from BUFR) to 8-bit uint, primarily for reverting reflectivity data back to what they once were. | |
int | PolarScanParam_shiftData (PolarScanParam_t *param, int nrays) |
Performs a circular shift of the dataset and the attributes that are associated with the rays. | |
void | PolarScanParam_setLegend (PolarScanParam_t *self, RaveLegend_t *legend) |
Sets the legend associated with this parameter. | |
int | PolarScanParam_hasLegend (PolarScanParam_t *self) |
Returns if there is a legend associated with this parameter or not. | |
RaveLegend_t * | PolarScanParam_getLegend (PolarScanParam_t *self) |
Returns the legend associated with this parameter. | |
Variables | |
RaveCoreObjectType | PolarScanParam_TYPE |
Type definition to use when creating a rave object. | |
Defines the functions available when working with polar scans.
int PolarScanParam_addAttribute | ( | PolarScanParam_t * | scanparam, |
RaveAttribute_t * | attribute ) |
Adds a rave attribute to the parameter.
[in] | scanparam | - self |
[in] | attribute | - the attribute |
int PolarScanParam_addAttributeVersion | ( | PolarScanParam_t * | scanparam, |
RaveAttribute_t * | attribute, | ||
RaveIO_ODIM_Version | version ) |
Adds a rave attribute to the parameter.
NOTE! This method is usually only used internally.
[in] | scanparam | - self |
[in] | attribute | - the attribute |
[in] | version | - the version of the attribute added |
int PolarScanParam_addQualityField | ( | PolarScanParam_t * | param, |
RaveField_t * | field ) |
Adds a quality field to this scan.
[in] | param | - self |
[in] | field | - the field to add |
int PolarScanParam_convertDataDoubleToUchar | ( | PolarScanParam_t * | param | ) |
Converter for 64-bit float (from BUFR) to 8-bit uint, primarily for reverting reflectivity data back to what they once were.
[in] | param | - the quantity to convert |
int PolarScanParam_createData | ( | PolarScanParam_t * | scanparam, |
long | nbins, | ||
long | nrays, | ||
RaveDataType | type ) |
Creates a data field with the specified dimensions and type.
The data till be initialized to 0.
[in] | scanparam | - self |
[in] | nbins | - number of bins |
[in] | nrays | - number of rays |
[in] | type | - the type of the data |
PolarScanParam_t * PolarScanParam_fromField | ( | RaveField_t * | field | ) |
Translates a rave field into a polar scan parameter.
It will only atempt to find to use what/gain, what/offset, what/nodata and what/undetect. If these doesn't exist, default values will be used.
[in] | field | - the field to convert into a polar scan parameter |
RaveAttribute_t * PolarScanParam_getAttribute | ( | PolarScanParam_t * | scanparam, |
const char * | name ) |
Returns the rave attribute that is named accordingly.
[in] | scanparam | - self |
[in] | name | - the name of the attribute |
RaveList_t * PolarScanParam_getAttributeNames | ( | PolarScanParam_t * | scanparam | ) |
Returns a list of attribute names.
Release with @ref RaveList_freeAndDestroy.
[in] | scanparam | - self |
RaveList_t * PolarScanParam_getAttributeNamesVersion | ( | PolarScanParam_t * | scanparam, |
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.
[in] | scanparam | - self |
[in] | version | - the version of the attribute |
RaveObjectList_t * PolarScanParam_getAttributeValues | ( | PolarScanParam_t * | scanparam | ) |
Returns a list of attribute values that should be stored for this parameter.
Corresponding members will also be added as attribute values. E.g. gain will be stored as a double with name what/gain.
[in] | scanparam | - self |
RaveObjectList_t * PolarScanParam_getAttributeValuesVersion | ( | PolarScanParam_t * | scanparam, |
RaveIO_ODIM_Version | version ) |
Returns a list of attribute values in specified version that has been added to this parameter.
Corresponding members will also be added as attribute values. E.g. gain will be stored NOTE! This method is usually only used internally. as a double with name what/gain.
[in] | scanparam | - self |
[in] | version | - the version of the attribute |
RaveAttribute_t * PolarScanParam_getAttributeVersion | ( | PolarScanParam_t * | scanparam, |
const char * | name, | ||
RaveIO_ODIM_Version | version ) |
Returns the rave attribute that is named accordingly and version.
NOTE! This method is usually only used internally.
[in] | scanparam | - self |
[in] | name | - the name of the attribute |
[in] | version | - the version of the attribute |
RaveValueType PolarScanParam_getConvertedValue | ( | PolarScanParam_t * | scanparam, |
int | bin, | ||
int | ray, | ||
double * | v ) |
Returns the linear converted value at the specified index.
That is, offset + gain * value;
[in] | scanparam | - self |
[in] | bin | - the bin index |
[in] | ray | - the ray index |
[out] | v | - the data at the specified index |
void * PolarScanParam_getData | ( | PolarScanParam_t * | scanparam | ) |
Returns a pointer to the internal data storage.
[in] | scanparam | - self |
RaveData2D_t * PolarScanParam_getData2D | ( | PolarScanParam_t * | scanparam | ) |
Returns a copy of the internal 2d data field.
[in] | scanparam | - self |
RaveDataType PolarScanParam_getDataType | ( | PolarScanParam_t * | scan | ) |
Returns the data type.
[in] | scanparam | - self |
double PolarScanParam_getGain | ( | PolarScanParam_t * | scanparam | ) |
Returns the gain.
[in] | scanparam | - self |
RaveLegend_t * PolarScanParam_getLegend | ( | PolarScanParam_t * | self | ) |
Returns the legend associated with this parameter.
[in] | self | - self |
long PolarScanParam_getNbins | ( | PolarScanParam_t * | scanparam | ) |
Returns the number of bins.
[in] | scanparam | - self |
double PolarScanParam_getNodata | ( | PolarScanParam_t * | scanparam | ) |
Returns the nodata.
[in] | scanparam | - self |
long PolarScanParam_getNrays | ( | PolarScanParam_t * | scanparam | ) |
Returns the number of rays/scan.
[in] | scanparam | - self |
int PolarScanParam_getNumberOfQualityFields | ( | PolarScanParam_t * | param | ) |
Returns the number of quality fields.
[in] | param | - self |
double PolarScanParam_getOffset | ( | PolarScanParam_t * | scanparam | ) |
Returns the offset.
[in] | scanparam | - self |
RaveField_t * PolarScanParam_getQualityField | ( | PolarScanParam_t * | param, |
int | index ) |
Returns the quality field at the specified location.
[in] | param | - self |
[in] | index | - the index |
RaveField_t * PolarScanParam_getQualityFieldByHowTask | ( | PolarScanParam_t * | param, |
const char * | value ) |
Returns a quality field based on the value of how/task that should be a string.
[in] | param | - self |
[in] | value | - the value of the how/task attribute |
RaveObjectList_t * PolarScanParam_getQualityFields | ( | PolarScanParam_t * | param | ) |
Returns all quality fields belonging to this scan parameter.
The returned object is only a reference so do not modify it.
[in] | param | - self |
const char * PolarScanParam_getQuantity | ( | PolarScanParam_t * | scanparam | ) |
Returns the quantity.
[in] | scanparam | - self |
double PolarScanParam_getUndetect | ( | PolarScanParam_t * | scanparam | ) |
Returns the undetect.
[in] | scanparam | - self |
RaveValueType PolarScanParam_getValue | ( | PolarScanParam_t * | scanparam, |
int | bin, | ||
int | ray, | ||
double * | v ) |
Returns the value at the specified index.
[in] | scanparam | - self |
[in] | bin | - the bin index |
[in] | ray | - the ray index |
[out] | v | - the data at the specified index |
int PolarScanParam_hasAttribute | ( | PolarScanParam_t * | scanparam, |
const char * | name ) |
Returns if the specified attribute exists.
[in] | scan | - self |
[in] | name | - the name of the attribute |
int PolarScanParam_hasLegend | ( | PolarScanParam_t * | self | ) |
Returns if there is a legend associated with this parameter or not.
[in] | self | - self |
void PolarScanParam_removeQualityField | ( | PolarScanParam_t * | param, |
int | index ) |
Removes the quality field at the specified location.
[in] | param | - self |
[in] | index | - the index |
int PolarScanParam_setData | ( | PolarScanParam_t * | scanparam, |
long | nbins, | ||
long | nrays, | ||
void * | data, | ||
RaveDataType | type ) |
Sets the data.
[in] | scanparam | - self |
[in] | nbins | - number of bins |
[in] | nrays | - number of rays |
[in] | data | - the data |
[in] | type | - the data type |
int PolarScanParam_setData2D | ( | PolarScanParam_t * | scanparam, |
RaveData2D_t * | data2d ) |
Sets the data from a rave data 2d object.
[in] | scanparam | - self |
[in] | data2d | - the data 2d field |
void PolarScanParam_setGain | ( | PolarScanParam_t * | scanparam, |
double | gain ) |
Sets the gain.
[in] | scanparam | - self |
[in] | gain | - the gain |
int PolarScanParam_setLazyDataset | ( | PolarScanParam_t * | scanparam, |
LazyDataset_t * | lazyDataset ) |
Sets a lazy dataset as data member.
On any requests to receive data, the lazy dataset will be used to populate the internal data field.
[in] |
void PolarScanParam_setLegend | ( | PolarScanParam_t * | self, |
RaveLegend_t * | legend ) |
Sets the legend associated with this parameter.
[in] | self | - self |
[in] | legend | - the legend |
void PolarScanParam_setNodata | ( | PolarScanParam_t * | scanparam, |
double | nodata ) |
Sets the nodata.
[in] | scanparam | - self |
[in] | nodata | - the nodata |
void PolarScanParam_setOffset | ( | PolarScanParam_t * | scanparam, |
double | offset ) |
Sets the offset.
[in] | scanparam | - self |
[in] | offset | - the offset |
int PolarScanParam_setQuantity | ( | PolarScanParam_t * | scanparam, |
const char * | quantity ) |
Sets the quantity.
[in] | scanparam | - self |
[in] | quantity | - the quantity, e.g. DBZH |
void PolarScanParam_setUndetect | ( | PolarScanParam_t * | scanparam, |
double | undetect ) |
Sets the undetect.
[in] | scanparam | - self |
[in] | undetect | - the undetect |
int PolarScanParam_setValue | ( | PolarScanParam_t * | scanparam, |
int | bin, | ||
int | ray, | ||
double | v ) |
Sets the value.
[in] | scanparam | - self |
[in] | bin | - the bin index |
[in] | ray | - the ray index |
[in] | v | - the value (converted) |
int PolarScanParam_shiftData | ( | PolarScanParam_t * | param, |
int | nrays ) |
Performs a circular shift of the dataset and the attributes that are associated with the rays.
It can be negative for counter clock wise and positive for clock wise rotation.
[in] | param | - the parameter |
[in] | nrays | - the number of rays to shift |
RaveField_t * PolarScanParam_toField | ( | PolarScanParam_t * | param | ) |
Converts a polar scan parameter into a rave field.
I.e. this function will only take the actual parameter data and convert it into a field. It will not consider any quality field.
[in] | param | - self |
RaveCoreObjectType PolarScanParam_TYPE |
Type definition to use when creating a rave object.