RAVE
rave_field.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2009-2010 Swedish Meteorological and Hydrological Institute, SMHI,
3
4This file is part of RAVE.
5
6RAVE is free software: you can redistribute it and/or modify
7it under the terms of the GNU Lesser General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11RAVE is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU Lesser General Public License for more details.
15
16You should have received a copy of the GNU Lesser General Public License
17along with RAVE. If not, see <http://www.gnu.org/licenses/>.
18------------------------------------------------------------------------*/
26#ifndef RAVE_FIELD_H
27#define RAVE_FIELD_H
28#include "rave_object.h"
29#include "rave_types.h"
30#include "rave_attribute.h"
31#include "rave_list.h"
32#include "raveobject_list.h"
33#include "rave_data2d.h"
34#include "lazy_dataset.h"
39
44
54int RaveField_setData(RaveField_t* field, long xsize, long ysize, void* data, RaveDataType type);
55
62
71int RaveField_createData(RaveField_t* field, long xsize, long ysize, RaveDataType type);
72
79int RaveField_setDatafield(RaveField_t* field, RaveData2D_t* datafield);
80
86void* RaveField_getData(RaveField_t* field);
87
96
105int RaveField_getValue(RaveField_t* field, long x, long y, double* v);
106
114int RaveField_setValue(RaveField_t* field, long x, long y, double value);
115
124int RaveField_getConvertedValue(RaveField_t* field, long x, long y, double* v);
125
132
139
146
154
164
171RaveAttribute_t* RaveField_getAttribute(RaveField_t* field, const char* name);
172
179int RaveField_hasAttribute(RaveField_t* field, const char* name);
180
187
196
203
212
220
225
234int RaveField_hasAttributeStringValue(RaveField_t* field, const char* name, const char* value);
235
245
253int RaveField_circshiftData(RaveField_t* field, int nx, int ny);
254
255#endif /* RAVE_FIELD_H */
This is a wrapper around a lazy nodelist reader used for fetching data from a HL_NodeList.
Used for keeping track on attributes.
Represents a 2-dimensional data array.
int RaveField_hasAttributeStringValue(RaveField_t *field, const char *name, const char *value)
Checks if the field has the attribute named name that is of type string and has a matching value.
Definition rave_field.c:341
RaveData2D_t * RaveField_getDatafield(RaveField_t *field)
Returns the 2d field associated with this rave field.
Definition rave_field.c:178
RaveObjectList_t * RaveField_getAttributeValuesVersion(RaveField_t *field, RaveIO_ODIM_Version version)
Returns a list of attribute values that has been set for this field and version.
Definition rave_field.c:323
int RaveField_setValue(RaveField_t *field, long x, long y, double value)
Sets the value at specified position.
Definition rave_field.c:198
RaveList_t * RaveField_getAttributeNames(RaveField_t *field)
Returns a list of attribute names.
Definition rave_field.c:305
long RaveField_getXsize(RaveField_t *field)
Returns the xsize / number of bins.
Definition rave_field.c:230
RaveCoreObjectType RaveField_TYPE
Type definition to use when creating a rave object.
Definition rave_field.c:402
RaveDataType RaveField_getDataType(RaveField_t *field)
Returns the data type.
Definition rave_field.c:248
long RaveField_getYsize(RaveField_t *field)
Returns the ysize / number of rays.
Definition rave_field.c:239
int RaveField_hasAttribute(RaveField_t *field, const char *name)
Returns if the specified attribute exists.
Definition rave_field.c:299
RaveField_t * RaveField_concatX(RaveField_t *field, RaveField_t *other)
Concatenates field with other horizontally and returns the new field.
Definition rave_field.c:361
int RaveField_setLazyDataset(RaveField_t *field, LazyDataset_t *lazyDataset)
Sets a lazy dataset as data member.
Definition rave_field.c:131
void RaveField_removeAttributes(RaveField_t *field)
Removes all attributes from the field.
Definition rave_field.c:335
int RaveField_addAttribute(RaveField_t *field, RaveAttribute_t *attribute)
Adds a rave attribute to the parameter.
Definition rave_field.c:257
int RaveField_createData(RaveField_t *field, long xsize, long ysize, RaveDataType type)
Creates a empty data field.
Definition rave_field.c:143
RaveObjectList_t * RaveField_getAttributeValues(RaveField_t *field)
Returns a list of attribute values that has been set for this field.
Definition rave_field.c:317
int RaveField_setDatafield(RaveField_t *field, RaveData2D_t *datafield)
Sets the rave data 2d field.
Definition rave_field.c:154
int RaveField_addAttributeVersion(RaveField_t *field, RaveAttribute_t *attribute, RaveIO_ODIM_Version version)
Adds a rave attribute to the parameter.
Definition rave_field.c:263
RaveList_t * RaveField_getAttributeNamesVersion(RaveField_t *field, RaveIO_ODIM_Version version)
Returns a list of attribute names.
Definition rave_field.c:311
int RaveField_getValue(RaveField_t *field, long x, long y, double *v)
Returns the value at the specified index.
Definition rave_field.c:192
int RaveField_setData(RaveField_t *field, long xsize, long ysize, void *data, RaveDataType type)
Sets the data in the rave field.
Definition rave_field.c:120
int RaveField_circshiftData(RaveField_t *field, int nx, int ny)
Circular shift of the internal field in x & y dimension.
Definition rave_field.c:393
RaveAttribute_t * RaveField_getAttribute(RaveField_t *field, const char *name)
Returns the rave attribute that is named accordingly.
Definition rave_field.c:289
RaveObjectList_t * RaveField_getInternalAttributeValues(RaveField_t *field)
Returns a reference to the internally stored attributes.
Definition rave_field.c:329
int RaveField_getConvertedValue(RaveField_t *field, long x, long y, double *v)
Returns the converted value at the specified index.
Definition rave_field.c:204
void * RaveField_getData(RaveField_t *field)
Returns a pointer to the internal data storage.
Definition rave_field.c:172
Implementation of a simple list.
Generic implementation of an object that is used within rave.
Type definitions for RAVE.
RaveIO_ODIM_Version
The /Conventions version in a ODIM HDF5 file.
Definition rave_types.h:43
RaveDataType
Different data types that are supported during transformation.
Definition rave_types.h:130
Implementation of a rave object list that ensures that the objects contained within the list are rele...
Represents one lazy dataset.
Definition lazy_dataset.c:37
Represents one scan in a volume.
Definition rave_attribute.c:46
Represents a date time instance.
Definition rave_data2d.c:38
Represents the cartesian volume.
Definition rave_field.c:36
LazyDataset_t * lazyDataset
the lazy dataset
Definition rave_field.c:39
RAVE_OBJECT_HEAD RaveData2D_t * data
Always on top.
Definition rave_field.c:38
Represents a list.
Definition rave_list.c:36
Represents a list.
Definition raveobject_list.c:35
The rave object type definition.
Definition rave_object.h:52