RAVE
cartesian.h File Reference

Defines the functions available when working with cartesian products. More...

#include "rave_proj.h"
#include "projection.h"
#include "area.h"
#include "rave_object.h"
#include "rave_types.h"
#include "rave_list.h"
#include "raveobject_list.h"
#include "rave_attribute.h"
#include "rave_field.h"
#include "cartesianparam.h"

Go to the source code of this file.

Typedefs

typedef struct _Cartesian_t Cartesian_t
 Defines a Cartesian product.
 

Functions

int Cartesian_setTime (Cartesian_t *cartesian, const char *value)
 Sets the nominal time.
 
const char * Cartesian_getTime (Cartesian_t *cartesian)
 Returns the nominal time.
 
int Cartesian_setDate (Cartesian_t *cartesian, const char *value)
 Sets the nominal date.
 
const char * Cartesian_getDate (Cartesian_t *cartesian)
 Returns the nominal date.
 
int Cartesian_setStartTime (Cartesian_t *cartesian, const char *value)
 Sets the start time.
 
const char * Cartesian_getStartTime (Cartesian_t *cartesian)
 Returns the start time.
 
int Cartesian_setStartDate (Cartesian_t *cartesian, const char *value)
 Sets the start date.
 
const char * Cartesian_getStartDate (Cartesian_t *cartesian)
 Returns the start date.
 
int Cartesian_setEndTime (Cartesian_t *cartesian, const char *value)
 Sets the end time.
 
const char * Cartesian_getEndTime (Cartesian_t *cartesian)
 Returns the end time.
 
int Cartesian_setEndDate (Cartesian_t *cartesian, const char *value)
 Sets the end date.
 
const char * Cartesian_getEndDate (Cartesian_t *cartesian)
 Returns the end date.
 
int Cartesian_setSource (Cartesian_t *cartesian, const char *value)
 Sets the source.
 
const char * Cartesian_getSource (Cartesian_t *cartesian)
 Returns the source.
 
int Cartesian_setProdname (Cartesian_t *cartesian, const char *value)
 Sets the product name.
 
const char * Cartesian_getProdname (Cartesian_t *cartesian)
 Returns the product name.
 
int Cartesian_setObjectType (Cartesian_t *self, Rave_ObjectType type)
 Sets the object type this cartesian product should represent.
 
Rave_ObjectType Cartesian_getObjectType (Cartesian_t *self)
 Returns the object type this cartesian product represents.
 
void Cartesian_setXSize (Cartesian_t *self, long xsize)
 The xsize to use for the parameters.
 
void Cartesian_setYSize (Cartesian_t *self, long ysize)
 The ysize to use for the parameters.
 
long Cartesian_getXSize (Cartesian_t *cartesian)
 Returns the xsize.
 
long Cartesian_getYSize (Cartesian_t *cartesian)
 Returns the ysize.
 
void Cartesian_setAreaExtent (Cartesian_t *cartesian, double llX, double llY, double urX, double urY)
 Sets the area extent for this cartesian product.
 
void Cartesian_getAreaExtent (Cartesian_t *cartesian, double *llX, double *llY, double *urX, double *urY)
 Gets the area extent for this cartesian product.
 
int Cartesian_getExtremeLonLatBoundaries (Cartesian_t *self, double *ulLon, double *ulLat, double *lrLon, double *lrLat)
 Determines the extreme lon lat boundaries for this area.
 
void Cartesian_setXScale (Cartesian_t *cartesian, double xscale)
 Sets the xscale.
 
double Cartesian_getXScale (Cartesian_t *cartesian)
 Returns the xscale.
 
void Cartesian_setYScale (Cartesian_t *cartesian, double yscale)
 Sets the yscale.
 
double Cartesian_getYScale (Cartesian_t *cartesian)
 Returns the yscale.
 
int Cartesian_setProduct (Cartesian_t *cartesian, Rave_ProductType type)
 Sets the product this cartesian represents.
 
Rave_ProductType Cartesian_getProduct (Cartesian_t *cartesian)
 Returns the product this cartesian represents.
 
double Cartesian_getNodata (Cartesian_t *self)
 Returns the nodata value.
 
double Cartesian_getUndetect (Cartesian_t *self)
 Returns the undetect value.
 
double Cartesian_getLocationX (Cartesian_t *cartesian, long x)
 Returns the location within the area as identified by a x-position.
 
double Cartesian_getLocationY (Cartesian_t *cartesian, long y)
 Returns the location within the area as identified by a y-position.
 
long Cartesian_getIndexX (Cartesian_t *cartesian, double x)
 Returns the x index Evaluated as: (x - lowerLeft.x)/xscale.
 
long Cartesian_getIndexY (Cartesian_t *cartesian, double y)
 Returns the y index Evaluated as: (upperRight.y - y)/yscale.
 
int Cartesian_getLonLatFromXY (Cartesian_t *self, int x, int y, double *lon, double *lat)
 Converts a x/y position into lon/lat.
 
int Cartesian_getLonLatFromXYLocation (Cartesian_t *self, double x, double y, double *lon, double *lat)
 Converts a x/y cartesian coordinate into lon/lat.
 
int Cartesian_getXYFromLonLat (Cartesian_t *self, double lon, double lat, int *x, int *y)
 Converts a lon/lat position into a x/y position.
 
int Cartesian_getXYLocationFromLonLat (Cartesian_t *self, double lon, double lat, double *x, double *y)
 Converts a lon/lat position into a x/y cartesian coordinate.
 
int Cartesian_setDefaultParameter (Cartesian_t *self, const char *name)
 Sets the default parameter.
 
const char * Cartesian_getDefaultParameter (Cartesian_t *self)
 Returns the default parameter.
 
int Cartesian_setProjection (Cartesian_t *cartesian, Projection_t *projection)
 Sets the projection that defines this cartesian product.
 
Projection_tCartesian_getProjection (Cartesian_t *cartesian)
 Returns a copy of the projection that is used for this cartesian product.
 
const char * Cartesian_getProjectionString (Cartesian_t *cartesian)
 Returns the projection string defining this cartesian product.
 
int Cartesian_setValue (Cartesian_t *cartesian, long x, long y, double v)
 Sets the value at the specified coordinates.
 
int Cartesian_setConvertedValue (Cartesian_t *cartesian, long x, long y, double v)
 Scales the value v according to gain and offset before setting it.
 
RaveValueType Cartesian_getValue (Cartesian_t *cartesian, long x, long y, double *v)
 Returns the value at the specified x and y position.
 
RaveValueType Cartesian_getConvertedValue (Cartesian_t *cartesian, long x, long y, double *v)
 Returns the converted value at the specified x and y position.
 
RaveValueType Cartesian_getValueAtLocation (Cartesian_t *cartesian, double lx, double ly, double *v)
 Returns the value from the location as defined by the area definition.
 
RaveValueType Cartesian_getConvertedValueAtLocation (Cartesian_t *cartesian, double lx, double ly, double *v)
 Returns the converted value from the location as defined by the area definition.
 
RaveValueType Cartesian_getConvertedValueAtLonLat (Cartesian_t *cartesian, double lon, double lat, double *v)
 Returns the converted value from the lon/lat position within the area.
 
int Cartesian_getQualityValueAtLocation (Cartesian_t *cartesian, double lx, double ly, const char *name, double *v)
 Returns the quality value at the specified location from the specified quality field.
 
int Cartesian_getConvertedQualityValueAtLocation (Cartesian_t *cartesian, double lx, double ly, const char *name, double *v)
 Returns the scaled quality value at the specified location from the specified quality field.
 
int Cartesian_getQualityValueAtLonLat (Cartesian_t *cartesian, double lon, double lat, const char *name, double *v)
 Returns the quality value at the specified lon/lat from the specified quality field.
 
int Cartesian_getConvertedQualityValueAtLonLat (Cartesian_t *cartesian, double lon, double lat, const char *name, double *v)
 Returns the scaled quality value at the specified lon/lat from the specified quality field.
 
void Cartesian_init (Cartesian_t *cartesian, Area_t *area)
 Initializes this cartesian product with basic information.
 
RaveValueType Cartesian_getMean (Cartesian_t *cartesian, long x, long y, int N, double *v)
 Returns the mean value over a NxN square around the specified x and y position.
 
int Cartesian_isTransformable (Cartesian_t *cartesian)
 Verifies that all preconditions are met in order to perform a transformation.
 
int Cartesian_addAttribute (Cartesian_t *cartesian, RaveAttribute_t *attribute)
 Adds a rave attribute to the cartesian product.
 
int Cartesian_addAttributeVersion (Cartesian_t *cartesian, RaveAttribute_t *attribute, RaveIO_ODIM_Version version)
 Adds a rave attribute to the cartesian product for specified version.
 
RaveAttribute_tCartesian_getAttribute (Cartesian_t *cartesian, const char *name)
 Returns the rave attribute that is named accordingly.
 
RaveAttribute_tCartesian_getAttributeVersion (Cartesian_t *cartesian, const char *name, RaveIO_ODIM_Version version)
 Returns the rave attribute that is named accordingly for specified version.
 
RaveList_tCartesian_getAttributeNames (Cartesian_t *cartesian)
 Returns a list of attribute names.
 
RaveList_tCartesian_getAttributeNamesVersion (Cartesian_t *cartesian, RaveIO_ODIM_Version version)
 Returns a list of attribute names actual for specified version.
 
RaveObjectList_tCartesian_getAttributeValues (Cartesian_t *cartesian)
 Returns a list of attribute values that should be stored for this cartesian product.
 
RaveObjectList_tCartesian_getAttributeValuesVersion (Cartesian_t *cartesian, RaveIO_ODIM_Version version)
 Returns a list of attribute values that has been set for this product.
 
int Cartesian_hasAttribute (Cartesian_t *cartesian, const char *name)
 Returns if the cartesian product has got the specified attribute.
 
int Cartesian_addQualityField (Cartesian_t *cartesian, RaveField_t *field)
 Adds a quality field to this cartesian product.
 
RaveField_tCartesian_getQualityField (Cartesian_t *cartesian, int index)
 Returns the quality field at the specified location.
 
int Cartesian_getNumberOfQualityFields (Cartesian_t *cartesian)
 Returns the number of quality fields.
 
void Cartesian_removeQualityField (Cartesian_t *cartesian, int index)
 Removes the quality field at the specified location.
 
RaveObjectList_tCartesian_getQualityFields (Cartesian_t *cartesian)
 Returns all quality fields belonging to this cartesian.
 
RaveField_tCartesian_getQualityFieldByHowTask (Cartesian_t *cartesian, const char *name)
 Returns a quality field based on the value of how/task that should be a string.
 
RaveField_tCartesian_findQualityFieldByHowTask (Cartesian_t *self, const char *value)
 Same as Cartesian_getQualityFieldByHowTask but it first tries if there are any quality fields in the current parameter before checking self.
 
int Cartesian_addParameter (Cartesian_t *self, CartesianParam_t *param)
 Adds a parameter to the cartesian product.
 
CartesianParam_tCartesian_getParameter (Cartesian_t *self, const char *name)
 Returns the parameter with the specified quantity.
 
int Cartesian_hasParameter (Cartesian_t *self, const char *name)
 Returns if the product contains the specified parameter or not.
 
void Cartesian_removeParameter (Cartesian_t *self, const char *name)
 Removes the parameter with the specified quantity.
 
int Cartesian_getParameterCount (Cartesian_t *self)
 Return the number of parameters.
 
RaveList_tCartesian_getParameterNames (Cartesian_t *self)
 Returns a list of parameter names.
 
CartesianParam_tCartesian_createParameter (Cartesian_t *self, const char *quantity, RaveDataType type, double datavalue)
 Creates a parameter.
 

Variables

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

Detailed Description

Defines the functions available when working with cartesian products.

This object supports RAVE_OBJECT_CLONE.

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

Typedef Documentation

◆ Cartesian_t

typedef struct _Cartesian_t Cartesian_t

Defines a Cartesian product.

Function Documentation

◆ Cartesian_addAttribute()

int Cartesian_addAttribute ( Cartesian_t * cartesian,
RaveAttribute_t * attribute )

Adds a rave attribute to the cartesian product.

If attribute maps to the member attributes it will be used to set the specific member instead.

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

◆ Cartesian_addAttributeVersion()

int Cartesian_addAttributeVersion ( Cartesian_t * cartesian,
RaveAttribute_t * attribute,
RaveIO_ODIM_Version version )

Adds a rave attribute to the cartesian product for specified version.

If attribute maps to the member attributes it will be used to set the specific member. NOTE! This method is usually only used internally. instead.

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

◆ Cartesian_addParameter()

int Cartesian_addParameter ( Cartesian_t * self,
CartesianParam_t * param )

Adds a parameter to the cartesian product.

The quantity is used as unique identifier which means that any existing one will be removed.

Parameters
[in]self- self
[in]param- the parameter
Returns
1 on success

◆ Cartesian_addQualityField()

int Cartesian_addQualityField ( Cartesian_t * cartesian,
RaveField_t * field )

Adds a quality field to this cartesian product.

Parameters
[in]cartesian- self
[in]field- the field to add
Returns
1 on success otherwise 0

◆ Cartesian_createParameter()

CartesianParam_t * Cartesian_createParameter ( Cartesian_t * self,
const char * quantity,
RaveDataType type,
double datavalue )

Creates a parameter.

The created parameter will be added to the internal list of parameters. So if you are just going to create one, wrap the call in a RAVE_OBJECT_RELEASE. It is essential that _init has been called in order for this to have any effect.

Parameters
[in]self- self
[in]quantity- the quantity of the created parameter
[in]type- the data type
[in]datavalue- value to initialise the data field with
Returns
the created parameter

◆ Cartesian_findQualityFieldByHowTask()

RaveField_t * Cartesian_findQualityFieldByHowTask ( Cartesian_t * self,
const char * value )

Same as Cartesian_getQualityFieldByHowTask but it first tries if there are any quality fields in the current parameter before checking self.

Parameters
[in]self- self

◆ Cartesian_getAreaExtent()

void Cartesian_getAreaExtent ( Cartesian_t * cartesian,
double * llX,
double * llY,
double * urX,
double * urY )

Gets the area extent for this cartesian product.

Parameters
[in]cartesian- the cartesian product
[out]llX- lower left X position (may be NULL)
[out]llY- lower left Y position (may be NULL)
[out]urX- upper right X position (may be NULL)
[out]urY- upper right Y position (may be NULL)

◆ Cartesian_getAttribute()

RaveAttribute_t * Cartesian_getAttribute ( Cartesian_t * cartesian,
const char * name )

Returns the rave attribute that is named accordingly.

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

◆ Cartesian_getAttributeNames()

RaveList_t * Cartesian_getAttributeNames ( Cartesian_t * cartesian)

Returns a list of attribute names.

Release with @ref RaveList_freeAndDestroy.

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

◆ Cartesian_getAttributeNamesVersion()

RaveList_t * Cartesian_getAttributeNamesVersion ( Cartesian_t * cartesian,
RaveIO_ODIM_Version version )

Returns a list of attribute names actual for specified version.

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

Parameters
[in]cartesian- self
[in]version- the attribute version
Returns
a list of attribute names

◆ Cartesian_getAttributeValues()

RaveObjectList_t * Cartesian_getAttributeValues ( Cartesian_t * cartesian)

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

Corresponding members will also be added as attribute values.

Parameters
[in]cartesian- self
[in]otype- what type of attributes that should be returned, if it is for a cartesian image or a image belonging to a cartesian volume
Returns
a list of RaveAttributes.

◆ Cartesian_getAttributeValuesVersion()

RaveObjectList_t * Cartesian_getAttributeValuesVersion ( Cartesian_t * cartesian,
RaveIO_ODIM_Version version )

Returns a list of attribute values that has been set for this product.

NOTE! This method is usually only used internally.

Parameters
[in]cartesian- self
[in]version- the attribute version belonging to a cartesian volume
Returns
a list of RaveAttributes.

◆ Cartesian_getAttributeVersion()

RaveAttribute_t * Cartesian_getAttributeVersion ( Cartesian_t * cartesian,
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]cartesian- self
[in]name- the name of the attribute
[in]version- the attribute version
Returns
the attribute if found otherwise NULL

◆ Cartesian_getConvertedQualityValueAtLocation()

int Cartesian_getConvertedQualityValueAtLocation ( Cartesian_t * cartesian,
double lx,
double ly,
const char * name,
double * v )

Returns the scaled quality value at the specified location from the specified quality field.

First the code tests if the quality field exist in the default param. If not, it will check for the quality field in self.

Parameters
[in]cartesian- self
[in]lx- the position as defined in the area definition
[in]ly- the position as defined in the area definition
[in]name- the name of the quality field (how/task)
[out]v- the data at the specified position
Returns
1 if value could be returned otherwise 0

◆ Cartesian_getConvertedQualityValueAtLonLat()

int Cartesian_getConvertedQualityValueAtLonLat ( Cartesian_t * cartesian,
double lon,
double lat,
const char * name,
double * v )

Returns the scaled quality value at the specified lon/lat from the specified quality field.

That is the value got when applying gain and offset. First the code tests if the quality field exist in the default param. If not, it will check for the quality field in self.

Parameters
[in]cartesian- self
[in]lon- the longitude in radians
[in]lat- the latitude in radians
[in]name- the name of the quality field (how/task)
[out]v- the data at the specified position
Returns
1 if value could be returned otherwise 0

◆ Cartesian_getConvertedValue()

RaveValueType Cartesian_getConvertedValue ( Cartesian_t * cartesian,
long x,
long y,
double * v )

Returns the converted value at the specified x and y position.

Parameters
[in]cartesian- the cartesian product
[in]x- the x index
[in]y- the y index
[out]v- the data at the specified index
Returns
the type of data

◆ Cartesian_getConvertedValueAtLocation()

RaveValueType Cartesian_getConvertedValueAtLocation ( Cartesian_t * cartesian,
double lx,
double ly,
double * v )

Returns the converted value from the location as defined by the area definition.

Same as calling Cartesian_getConvertedValue(c, Cartesian_getIndexX(c), Cartesian_getIndexY(c), &v).

Parameters
[in]cartesian- self
[in]lx- the position as defined in the area definition
[in]ly- the position as defined in the area definition
[out]v- the data at the specified position
Returns
the type of data

◆ Cartesian_getConvertedValueAtLonLat()

RaveValueType Cartesian_getConvertedValueAtLonLat ( Cartesian_t * cartesian,
double lon,
double lat,
double * v )

Returns the converted value from the lon/lat position within the area.

Parameters
[in]cartesian- self
[in]lon- the longitude (in radians)
[in]lat- the latitude (in radians)
[out]v- the data at the specified position
Returns
the type of data

◆ Cartesian_getDate()

const char * Cartesian_getDate ( Cartesian_t * cartesian)

Returns the nominal date.

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

◆ Cartesian_getDefaultParameter()

const char * Cartesian_getDefaultParameter ( Cartesian_t * self)

Returns the default parameter.

Parameters
[in]self- self
Returns
the default parameter

◆ Cartesian_getEndDate()

const char * Cartesian_getEndDate ( Cartesian_t * cartesian)

Returns the end date.

Parameters
[in]cartesian- self
Returns
the end date (or NULL if there is none)

◆ Cartesian_getEndTime()

const char * Cartesian_getEndTime ( Cartesian_t * cartesian)

Returns the end time.

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

◆ Cartesian_getExtremeLonLatBoundaries()

int Cartesian_getExtremeLonLatBoundaries ( Cartesian_t * self,
double * ulLon,
double * ulLat,
double * lrLon,
double * lrLat )

Determines the extreme lon lat boundaries for this area.

I.e. the outer boundaries of this cartesian image will be steped over until the absolute min/max lon/lat positions are found for this image. Note, that the bounding box returned will be in a different setup than area extent

Parameters
[in]self- self
[out]ulLon- Upper left longitude
[out]ulLat- Upper left latitude
[out]lrLon- Lower right longitude
[out]lrLat- Lower right latitude
Returns
1 if the boundaries could be determined otherwise 0

◆ Cartesian_getIndexX()

long Cartesian_getIndexX ( Cartesian_t * cartesian,
double x )

Returns the x index Evaluated as: (x - lowerLeft.x)/xscale.

Parameters
[in]cartesian- the cartesian product
[in]x- the x position in the area definition
Returns
the x index

◆ Cartesian_getIndexY()

long Cartesian_getIndexY ( Cartesian_t * cartesian,
double y )

Returns the y index Evaluated as: (upperRight.y - y)/yscale.

Parameters
[in]cartesian- the cartesian product
[in]y- the y position in the area definition
Returns
the y index

◆ Cartesian_getLocationX()

double Cartesian_getLocationX ( Cartesian_t * cartesian,
long x )

Returns the location within the area as identified by a x-position.

Evaluated as: upperLeft.x + xscale * x

Parameters
[in]cartesian- the cartesian product
[in]x- the x position in the area definition
Returns
the x location

◆ Cartesian_getLocationY()

double Cartesian_getLocationY ( Cartesian_t * cartesian,
long y )

Returns the location within the area as identified by a y-position.

Evaluated as: upperLeft.y - yscale * y

Parameters
[in]cartesian- the cartesian product
[in]y- the y position in the area definition
Returns
the y location

◆ Cartesian_getLonLatFromXY()

int Cartesian_getLonLatFromXY ( Cartesian_t * self,
int x,
int y,
double * lon,
double * lat )

Converts a x/y position into lon/lat.

Parameters
[in]x- the x position, should >= 0 and < xsize.
[in]y- the y position, should >= 0 and < ysize.
[out]lon- the lon coordinate
[out]lat- the lat coordinate
Returns
1 on success, otherwise 0

◆ Cartesian_getLonLatFromXYLocation()

int Cartesian_getLonLatFromXYLocation ( Cartesian_t * self,
double x,
double y,
double * lon,
double * lat )

Converts a x/y cartesian coordinate into lon/lat.

Parameters
[in]x- the x position, should be inside x-extent
[in]y- the y position, should be inside y-extent.
[out]lon- the lon coordinate
[out]lat- the lat coordinate
Returns
1 on success, otherwise 0

◆ Cartesian_getMean()

RaveValueType Cartesian_getMean ( Cartesian_t * cartesian,
long x,
long y,
int N,
double * v )

Returns the mean value over a NxN square around the specified x and y position.

Parameters
[in]cartesian- the cartesian product
[in]x- the x index
[in]y- the y index
[in]N- the N size
[out]v- the data at the specified index
Returns
the type of data

◆ Cartesian_getNodata()

double Cartesian_getNodata ( Cartesian_t * self)

Returns the nodata value.

Parameters
[in]self- self
Returns
the nodata value

◆ Cartesian_getNumberOfQualityFields()

int Cartesian_getNumberOfQualityFields ( Cartesian_t * cartesian)

Returns the number of quality fields.

Parameters
[in]cartesian- self
Returns
the number of quality fields

◆ Cartesian_getObjectType()

Rave_ObjectType Cartesian_getObjectType ( Cartesian_t * self)

Returns the object type this cartesian product represents.

Parameters
[in]self- self
Returns
the object type

◆ Cartesian_getParameter()

CartesianParam_t * Cartesian_getParameter ( Cartesian_t * self,
const char * name )

Returns the parameter with the specified quantity.

Parameters
[in]self- self
[in]name- the name of the parameter
Returns
the parameter or NULL

◆ Cartesian_getParameterCount()

int Cartesian_getParameterCount ( Cartesian_t * self)

Return the number of parameters.

Parameters
[in]self- self
Returns
the number of parameters

◆ Cartesian_getParameterNames()

RaveList_t * Cartesian_getParameterNames ( Cartesian_t * self)

Returns a list of parameter names.

Parameters
[in]self- self
Returns
a list of parameter names

◆ Cartesian_getProdname()

const char * Cartesian_getProdname ( Cartesian_t * cartesian)

Returns the product name.

Parameters
[in]cartesian- self
Returns
the product name or NULL if there is none

◆ Cartesian_getProduct()

Rave_ProductType Cartesian_getProduct ( Cartesian_t * cartesian)

Returns the product this cartesian represents.

Parameters
[in]cartesian- self
Returns
the product type

◆ Cartesian_getProjection()

Projection_t * Cartesian_getProjection ( Cartesian_t * cartesian)

Returns a copy of the projection that is used for this cartesian product.

I.e. remember to release it.

Parameters
[in]cartesian- the cartesian product
Returns
a projection (or NULL if none is set)

◆ Cartesian_getProjectionString()

const char * Cartesian_getProjectionString ( Cartesian_t * cartesian)

Returns the projection string defining this cartesian product.

Parameters
[in]cartesian- self
Returns
the projection string or NULL if none defined

◆ Cartesian_getQualityField()

RaveField_t * Cartesian_getQualityField ( Cartesian_t * cartesian,
int index )

Returns the quality field at the specified location.

Parameters
[in]cartesian- self
[in]index- the index
Returns
the quality field if found, otherwise NULL

◆ Cartesian_getQualityFieldByHowTask()

RaveField_t * Cartesian_getQualityFieldByHowTask ( Cartesian_t * cartesian,
const char * name )

Returns a quality field based on the value of how/task that should be a string.

Parameters
[in]cartesian- cartesian
[in]value- the value of the how/task attribute
Returns
the field if found otherwise NULL

◆ Cartesian_getQualityFields()

RaveObjectList_t * Cartesian_getQualityFields ( Cartesian_t * cartesian)

Returns all quality fields belonging to this cartesian.

The returned object is only a reference so do not modify it.

Parameters
[in]cartesian- self
Returns
a list of 0 or more quality fields or NULL on error.

◆ Cartesian_getQualityValueAtLocation()

int Cartesian_getQualityValueAtLocation ( Cartesian_t * cartesian,
double lx,
double ly,
const char * name,
double * v )

Returns the quality value at the specified location from the specified quality field.

First the code tests if the quality field exist in the default param. If not, it will check for the quality field in self.

Parameters
[in]cartesian- self
[in]lx- the position as defined in the area definition
[in]ly- the position as defined in the area definition
[in]name- the name of the quality field (how/task)
[out]v- the data at the specified position
Returns
1 if value could be returned otherwise 0

◆ Cartesian_getQualityValueAtLonLat()

int Cartesian_getQualityValueAtLonLat ( Cartesian_t * cartesian,
double lon,
double lat,
const char * name,
double * v )

Returns the quality value at the specified lon/lat from the specified quality field.

First the code tests if the quality field exist in the default param. If not, it will check for the quality field in self.

Parameters
[in]cartesian- self
[in]lon- the longitude in radians
[in]lat- the latitude in radians
[in]name- the name of the quality field (how/task)
[out]v- the data at the specified position
Returns
1 if value could be returned otherwise 0

◆ Cartesian_getSource()

const char * Cartesian_getSource ( Cartesian_t * cartesian)

Returns the source.

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

◆ Cartesian_getStartDate()

const char * Cartesian_getStartDate ( Cartesian_t * cartesian)

Returns the start date.

Parameters
[in]cartesian- self
Returns
the start date (or NULL if there is none)

◆ Cartesian_getStartTime()

const char * Cartesian_getStartTime ( Cartesian_t * cartesian)

Returns the start time.

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

◆ Cartesian_getTime()

const char * Cartesian_getTime ( Cartesian_t * cartesian)

Returns the nominal time.

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

◆ Cartesian_getUndetect()

double Cartesian_getUndetect ( Cartesian_t * self)

Returns the undetect value.

Parameters
[in]self- self
Returns
the undetect value

◆ Cartesian_getValue()

RaveValueType Cartesian_getValue ( Cartesian_t * cartesian,
long x,
long y,
double * v )

Returns the value at the specified x and y position.

Parameters
[in]cartesian- the cartesian product
[in]x- the x index
[in]y- the y index
[out]v- the data at the specified index
Returns
the type of data

◆ Cartesian_getValueAtLocation()

RaveValueType Cartesian_getValueAtLocation ( Cartesian_t * cartesian,
double lx,
double ly,
double * v )

Returns the value from the location as defined by the area definition.

Same as calling Cartesian_getValue(c, Cartesian_getIndexX(c), Cartesian_getIndexY(c), &v).

Parameters
[in]cartesian- self
[in]lx- the position as defined in the area definition
[in]ly- the position as defined in the area definition
[out]v- the data at the specified position
Returns
the type of data

◆ Cartesian_getXScale()

double Cartesian_getXScale ( Cartesian_t * cartesian)

Returns the xscale.

Parameters
[in]cartesian- the cartesian product
Returns
the xscale

◆ Cartesian_getXSize()

long Cartesian_getXSize ( Cartesian_t * cartesian)

Returns the xsize.

Parameters
[in]cartesian- the cartesian product
Returns
the xsize

◆ Cartesian_getXYFromLonLat()

int Cartesian_getXYFromLonLat ( Cartesian_t * self,
double lon,
double lat,
int * x,
int * y )

Converts a lon/lat position into a x/y position.

Parameters
[in]lon- the lon coordinate
[in]lat- the lat coordinate
[out]x- the x position, will be >= 0 and < xsize.
[out]y- the y position, will be >= 0 and < ysize.
Returns
1 on success, otherwise 0

◆ Cartesian_getXYLocationFromLonLat()

int Cartesian_getXYLocationFromLonLat ( Cartesian_t * self,
double lon,
double lat,
double * x,
double * y )

Converts a lon/lat position into a x/y cartesian coordinate.

Parameters
[in]lon- the lon coordinate
[in]lat- the lat coordinate
[out]x- the cartesian x coordinate, should be inside x-extent.
[out]y- the cartesian y coordinate, should be inside y-extent.
Returns
1 on success, otherwise 0

◆ Cartesian_getYScale()

double Cartesian_getYScale ( Cartesian_t * cartesian)

Returns the yscale.

Parameters
[in]cartesian- the cartesian product
Returns
the yscale

◆ Cartesian_getYSize()

long Cartesian_getYSize ( Cartesian_t * cartesian)

Returns the ysize.

Parameters
[in]cartesian- the cartesian product
Returns
the ysize

◆ Cartesian_hasAttribute()

int Cartesian_hasAttribute ( Cartesian_t * cartesian,
const char * name )

Returns if the cartesian product has got the specified attribute.

Parameters
[in]cartesian- self
[in]name- what to look for
Returns
1 if the attribute exists, otherwise 0

◆ Cartesian_hasParameter()

int Cartesian_hasParameter ( Cartesian_t * self,
const char * name )

Returns if the product contains the specified parameter or not.

Parameters
[in]self- self
[in]name- the quantity name
Returns
1 if the parameter exists, otherwise 0

◆ Cartesian_init()

void Cartesian_init ( Cartesian_t * cartesian,
Area_t * area )

Initializes this cartesian product with basic information.

No parameter is created but the dimensions and projection information is setup.

Parameters
[in]cartesian- self
[in]area- the area
Returns
1 on success, otherwise 0

◆ Cartesian_isTransformable()

int Cartesian_isTransformable ( Cartesian_t * cartesian)

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

Parameters
[in]cartesian- the cartesian product
Returns
1 if the cartesian product is ready, otherwise 0.

◆ Cartesian_removeParameter()

void Cartesian_removeParameter ( Cartesian_t * self,
const char * name )

Removes the parameter with the specified quantity.

Parameters
[in]self- self
[in]name- the quantity name

◆ Cartesian_removeQualityField()

void Cartesian_removeQualityField ( Cartesian_t * cartesian,
int index )

Removes the quality field at the specified location.

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

◆ Cartesian_setAreaExtent()

void Cartesian_setAreaExtent ( Cartesian_t * cartesian,
double llX,
double llY,
double urX,
double urY )

Sets the area extent for this cartesian product.

Parameters
[in]cartesian- the cartesian product
[in]llX- lower left X position
[in]llY- lower left Y position
[in]urX- upper right X position
[in]urY- upper right Y position

◆ Cartesian_setConvertedValue()

int Cartesian_setConvertedValue ( Cartesian_t * cartesian,
long x,
long y,
double v )

Scales the value v according to gain and offset before setting it.

I.e. same as Cartesian_setValue(cartesian, x, y, (v - offset)/gain)

◆ Cartesian_setDate()

int Cartesian_setDate ( Cartesian_t * cartesian,
const char * value )

Sets the nominal date.

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

◆ Cartesian_setDefaultParameter()

int Cartesian_setDefaultParameter ( Cartesian_t * self,
const char * name )

Sets the default parameter.

Parameters
[in]self- self
[in]name- the quantity, e.g. DBZH
Returns
1 on success, otherwise 0

◆ Cartesian_setEndDate()

int Cartesian_setEndDate ( Cartesian_t * cartesian,
const char * value )

Sets the end date.

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

◆ Cartesian_setEndTime()

int Cartesian_setEndTime ( Cartesian_t * cartesian,
const char * value )

Sets the end time.

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

◆ Cartesian_setObjectType()

int Cartesian_setObjectType ( Cartesian_t * self,
Rave_ObjectType type )

Sets the object type this cartesian product should represent.

Parameters
[in]self- self
[in]type- the object type
Returns
1 if the specified object type is supported, otherwise 0

◆ Cartesian_setProdname()

int Cartesian_setProdname ( Cartesian_t * cartesian,
const char * value )

Sets the product name.

Parameters
[in]cartesian- self
[in]value- the product name
Returns
1 on success, otherwise 0

◆ Cartesian_setProduct()

int Cartesian_setProduct ( Cartesian_t * cartesian,
Rave_ProductType type )

Sets the product this cartesian represents.

Parameters
[in]cartesianself
[in]type- the product type
Returns
1 if the operation was successful, otherwise 0

◆ Cartesian_setProjection()

int Cartesian_setProjection ( Cartesian_t * cartesian,
Projection_t * projection )

Sets the projection that defines this cartesian product.

Will also necessary pipelines internally

Parameters
[in]cartesian- the cartesian product
[in]projection- the projection
Returns
1 if operation successful, otherwise 0

◆ Cartesian_setSource()

int Cartesian_setSource ( Cartesian_t * cartesian,
const char * value )

Sets the source.

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

◆ Cartesian_setStartDate()

int Cartesian_setStartDate ( Cartesian_t * cartesian,
const char * value )

Sets the start date.

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

◆ Cartesian_setStartTime()

int Cartesian_setStartTime ( Cartesian_t * cartesian,
const char * value )

Sets the start time.

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

◆ Cartesian_setTime()

int Cartesian_setTime ( Cartesian_t * cartesian,
const char * value )

Sets the nominal time.

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

◆ Cartesian_setValue()

int Cartesian_setValue ( Cartesian_t * cartesian,
long x,
long y,
double v )

Sets the value at the specified coordinates.

Parameters
[in]cartesian- the cartesian product
[in]x- the x-position
[in]y- the y-position
[in]v- the value to set
Returns
1 on success, otherwise 0

◆ Cartesian_setXScale()

void Cartesian_setXScale ( Cartesian_t * cartesian,
double xscale )

Sets the xscale.

Parameters
[in]cartesian- the cartesian product
[in]xscale- the xscale

◆ Cartesian_setXSize()

void Cartesian_setXSize ( Cartesian_t * self,
long xsize )

The xsize to use for the parameters.

Parameters
[in]self- self
[in]xsize- the xsize to use

◆ Cartesian_setYScale()

void Cartesian_setYScale ( Cartesian_t * cartesian,
double yscale )

Sets the yscale.

Parameters
[in]cartesian- the cartesian product
[in]yscale- the yscale

◆ Cartesian_setYSize()

void Cartesian_setYSize ( Cartesian_t * self,
long ysize )

The ysize to use for the parameters.

Parameters
[in]self- self
[in]ysize- the ysize to use

Variable Documentation

◆ Cartesian_TYPE

RaveCoreObjectType Cartesian_TYPE
extern

Type definition to use when creating a rave object.