RAVE
acqvafeaturemap.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2025 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 ACQVA_FEATURE_MAP_H
27#define ACQVA_FEATURE_MAP_H
28
29#include "rave_object.h"
30#include "raveobject_list.h"
31#include "rave_datetime.h"
32#include "rave_types.h"
33#include "rave_field.h"
34#include "rave_value.h"
35#include "polarscan.h"
36
41
47
52
57
62
67
73AcqvaFeatureMap_t* AcqvaFeatureMap_load(const char* filename);
74
81int AcqvaFeatureMap_save(AcqvaFeatureMap_t* self, const char* filename);
82
89int AcqvaFeatureMap_setNod(AcqvaFeatureMap_t* self, const char* source);
90
97
103void AcqvaFeatureMap_setLongitude(AcqvaFeatureMap_t* self, double lon);
104
111
117void AcqvaFeatureMap_setLatitude(AcqvaFeatureMap_t* self, double lat);
118
125
131void AcqvaFeatureMap_setHeight(AcqvaFeatureMap_t* self, double height);
132
139
146int AcqvaFeatureMap_setStartdate(AcqvaFeatureMap_t* self, const char* date);
147
154
161int AcqvaFeatureMap_setEnddate(AcqvaFeatureMap_t* self, const char* date);
162
169
177int AcqvaFeatureMap_addAttribute(AcqvaFeatureMap_t* self, const char* name, RaveValue_t* value);
178
185int AcqvaFeatureMap_hasAttribute(AcqvaFeatureMap_t* self, const char* name);
186
194
201void AcqvaFeatureMap_removeAttribute(AcqvaFeatureMap_t* self, const char* name);
202
216
225
233
240
247
255
262
275
283
291
298
306
313
321
329
341
352int AcqvaFeatureMapElevation_has(AcqvaFeatureMapElevation_t* self, long nbins, long nrays, double rscale, double rstart, double beamwidth);
353
361
368
376
383
391
398
406
413
414
420
426
432
440int AcqvaFeatureMapField_addAttribute(AcqvaFeatureMapField_t* self, const char* name, RaveValue_t* value);
441
449
457
465
466
476
481
486
494
503int AcqvaFeatureMapField_setValue(AcqvaFeatureMapField_t* self, int bin, int ray, double v);
504
513int AcqvaFeatureMapField_getValue(AcqvaFeatureMapField_t* self, int bin, int ray, double* v);
514
521
527PolarScan_t* AcqvaFeatureMapField_toScan(AcqvaFeatureMapField_t* self, const char* param, double lon, double lat, double height);
528
541
542#endif
RaveCoreObjectType AcqvaFeatureMap_TYPE
Type definition to use when creating a rave object.
Definition acqvafeaturemap.c:1487
RaveCoreObjectType AcqvaFeatureMapField_TYPE
Type definition to use when creating a rave object.
Definition acqvafeaturemap.c:1503
RaveCoreObjectType AcqvaFeatureMapElevation_TYPE
Type definition to use when creating a rave object.
Definition acqvafeaturemap.c:1495
void AcqvaFeatureMap_removeElevation(AcqvaFeatureMap_t *self, int index)
Removes the elevation group at specified index.
Definition acqvafeaturemap.c:1069
int AcqvaFeatureMapField_setRstart(AcqvaFeatureMapField_t *self, double rstart)
Sets the rstart for this field.
Definition acqvafeaturemap.c:1230
void AcqvaFeatureMap_setLongitude(AcqvaFeatureMap_t *self, double lon)
The longitude for this source.
Definition acqvafeaturemap.c:871
void AcqvaFeatureMapElevation_remove(AcqvaFeatureMapElevation_t *self, int index)
Returns field at index.
Definition acqvafeaturemap.c:1162
const char * AcqvaFeatureMap_getStartdate(AcqvaFeatureMap_t *self)
Returns the start date of the period this map represents.
Definition acqvafeaturemap.c:913
int AcqvaFeatureMap_getNumberOfElevations(AcqvaFeatureMap_t *self)
Returns the number of elevation groups in the feature map.
Definition acqvafeaturemap.c:1057
int AcqvaFeatureMap_setStartdate(AcqvaFeatureMap_t *self, const char *date)
Sets the start date of the period this map represents.
Definition acqvafeaturemap.c:907
int AcqvaFeatureMapField_setValue(AcqvaFeatureMapField_t *self, int bin, int ray, double v)
Sets a value in the data field.
Definition acqvafeaturemap.c:1345
AcqvaFeatureMapElevation_t * AcqvaFeatureMap_findElevation(AcqvaFeatureMap_t *self, double elangle)
Locates a matching field that is very close to elangle < 1e-4.
Definition acqvafeaturemap.c:1090
int AcqvaFeatureMapElevation_has(AcqvaFeatureMapElevation_t *self, long nbins, long nrays, double rscale, double rstart, double beamwidth)
Locates a field that matches the nbins and nrays and returns true or false depending on if it exists.
Definition acqvafeaturemap.c:1188
int AcqvaFeatureMapElevation_add(AcqvaFeatureMapElevation_t *self, AcqvaFeatureMapField_t *field)
Adds a field to the elevation group.
Definition acqvafeaturemap.c:1121
int AcqvaFeatureMapField_hasAttribute(AcqvaFeatureMapField_t *self, const char *name)
Returns if the attribute exists in the map or not.
Definition acqvafeaturemap.c:1290
long AcqvaFeatureMapField_getNrays(AcqvaFeatureMapField_t *self)
Definition acqvafeaturemap.c:1262
double AcqvaFeatureMapField_getBeamwidth(AcqvaFeatureMapField_t *self)
Gets the beamwidth for this field.
Definition acqvafeaturemap.c:1250
int AcqvaFeatureMapField_setBeamwidth(AcqvaFeatureMapField_t *self, double beamwidth)
Sets the beamwidth in radians.
Definition acqvafeaturemap.c:1243
AcqvaFeatureMapElevation_t * AcqvaFeatureMap_createElevation(AcqvaFeatureMap_t *self, double elangle)
Creates an elevation group in the feature map unless it already exists (same elangle) which will inst...
Definition acqvafeaturemap.c:1010
double AcqvaFeatureMap_getLongitude(AcqvaFeatureMap_t *self)
The longitude for this source.
Definition acqvafeaturemap.c:877
AcqvaFeatureMapElevation_t * AcqvaFeatureMap_getElevation(AcqvaFeatureMap_t *self, int index)
Returns the elevation group at given index.
Definition acqvafeaturemap.c:1063
AcqvaFeatureMapField_t * AcqvaFeatureMapElevation_find(AcqvaFeatureMapElevation_t *self, long nbins, long nrays, double rscale, double rstart, double beamwidth)
Locates a field that matches the nbins and nrays.
Definition acqvafeaturemap.c:1168
void AcqvaFeatureMap_setHeight(AcqvaFeatureMap_t *self, double height)
The height for this source.
Definition acqvafeaturemap.c:895
int AcqvaFeatureMap_hasAttribute(AcqvaFeatureMap_t *self, const char *name)
Returns if the attribute exists in the map or not.
Definition acqvafeaturemap.c:947
const char * AcqvaFeatureMap_getNod(AcqvaFeatureMap_t *self)
Returns the nod for this feature map.
Definition acqvafeaturemap.c:865
void AcqvaFeatureMapField_removeAttribute(AcqvaFeatureMapField_t *self, const char *name)
Reomves the attribute with specified name from map.
Definition acqvafeaturemap.c:1302
AcqvaFeatureMapField_t * AcqvaFeatureMapField_createField(long nbins, long nrays, RaveDataType type, double elangle, double rscale, double rstart, double beamwidth)
Creates a field with wanted elevation angle and the geometry (nrays, nbins) and the field data is set...
Definition acqvafeaturemap.c:1451
int AcqvaFeatureMapField_addAttribute(AcqvaFeatureMapField_t *self, const char *name, RaveValue_t *value)
Adds an attribute to the feature map.
Definition acqvafeaturemap.c:1274
double AcqvaFeatureMapElevation_getElangle(AcqvaFeatureMapElevation_t *self)
Gets the elevation angle for this group.
Definition acqvafeaturemap.c:1115
RaveDataType AcqvaFeatureMapField_getDatatype(AcqvaFeatureMapField_t *self)
Definition acqvafeaturemap.c:1268
int AcqvaFeatureMapField_setRscale(AcqvaFeatureMapField_t *self, double rscale)
Sets the rscale for this field.
Definition acqvafeaturemap.c:1217
void * AcqvaFeatureMapField_getData(AcqvaFeatureMapField_t *self)
Returns the data.
Definition acqvafeaturemap.c:1333
int AcqvaFeatureMap_addElevation(AcqvaFeatureMap_t *self, AcqvaFeatureMapElevation_t *elevation)
Adds an elevation group in the feature map unless it already exists.
Definition acqvafeaturemap.c:1035
AcqvaFeatureMap_t * AcqvaFeatureMap_load(const char *filename)
Loads a ACQVA feature map.
Definition acqvafeaturemap.c:712
const char * AcqvaFeatureMap_getEnddate(AcqvaFeatureMap_t *self)
Returns the start date of the period this map represents.
Definition acqvafeaturemap.c:925
RaveField_t * AcqvaFeatureMapField_toRaveField(AcqvaFeatureMapField_t *self)
Creates a rave field from a acqva featuremap field.
Definition acqvafeaturemap.c:1365
AcqvaFeatureMapField_t * AcqvaFeatureMap_findField(AcqvaFeatureMap_t *self, long nbins, long nrays, double elangle, double rscale, double rstart, double beamwidth)
Locates a matching field that is very close to elangle < 1e-4 with wanted nrays & nbins.
Definition acqvafeaturemap.c:1076
AcqvaFeatureMapField_t * AcqvaFeatureMap_createField(AcqvaFeatureMap_t *self, long nbins, long nrays, RaveDataType type, double elangle, double rscale, double rstart, double beamwidth)
Creates a field in the feature map with wanted elevation angle and the geometry (nrays,...
Definition acqvafeaturemap.c:965
void AcqvaFeatureMap_setLatitude(AcqvaFeatureMap_t *self, double lat)
The latitude for this source.
Definition acqvafeaturemap.c:883
double AcqvaFeatureMapField_getRstart(AcqvaFeatureMapField_t *self)
Gets the rstart for this field.
Definition acqvafeaturemap.c:1237
int AcqvaFeatureMapElevation_size(AcqvaFeatureMapElevation_t *self)
Returns number of fields in this elevation group.
Definition acqvafeaturemap.c:1150
double AcqvaFeatureMapField_getElangle(AcqvaFeatureMapField_t *self)
Gets the elevation angle for this field.
Definition acqvafeaturemap.c:1211
int AcqvaFeatureMap_addField(AcqvaFeatureMap_t *self, AcqvaFeatureMapField_t *field)
Adds a field (scan) to the feature map.
Definition acqvafeaturemap.c:987
struct _AcqvaFeatureMapField_t AcqvaFeatureMapField_t
Defines a feature map field.
Definition acqvafeaturemap.h:51
RaveValue_t * AcqvaFeatureMapField_getAttribute(AcqvaFeatureMapField_t *self, const char *name)
Returns the name with specified name.
Definition acqvafeaturemap.c:1296
int AcqvaFeatureMap_setEnddate(AcqvaFeatureMap_t *self, const char *date)
Sets the end date of the period this map represents.
Definition acqvafeaturemap.c:919
struct _AcqvaFeatureMap_t AcqvaFeatureMap_t
Defines a feature map.
Definition acqvafeaturemap.h:40
void AcqvaFeatureMap_removeAttribute(AcqvaFeatureMap_t *self, const char *name)
Reomves the attribute with specified name from map.
Definition acqvafeaturemap.c:959
AcqvaFeatureMapField_t * AcqvaFeatureMapElevation_get(AcqvaFeatureMapElevation_t *self, int index)
Returns field at index.
Definition acqvafeaturemap.c:1156
int AcqvaFeatureMap_setNod(AcqvaFeatureMap_t *self, const char *source)
Sets the nod for this feature map.
Definition acqvafeaturemap.c:847
long AcqvaFeatureMapField_getNbins(AcqvaFeatureMapField_t *self)
Definition acqvafeaturemap.c:1256
int AcqvaFeatureMapField_getValue(AcqvaFeatureMapField_t *self, int bin, int ray, double *v)
Gets a value from the data field.
Definition acqvafeaturemap.c:1351
int AcqvaFeatureMap_save(AcqvaFeatureMap_t *self, const char *filename)
Saves the ACQVA feature map.
Definition acqvafeaturemap.c:786
RaveValue_t * AcqvaFeatureMap_getAttribute(AcqvaFeatureMap_t *self, const char *name)
Returns the name with specified name.
Definition acqvafeaturemap.c:953
PolarScan_t * AcqvaFeatureMapField_toScan(AcqvaFeatureMapField_t *self, const char *param, double lon, double lat, double height)
Creates a polar scan from a field definition.
Definition acqvafeaturemap.c:1407
int AcqvaFeatureMapField_fill(AcqvaFeatureMapField_t *self, double value)
Fills the complete array with wanted value.
Definition acqvafeaturemap.c:1339
double AcqvaFeatureMap_getLatitude(AcqvaFeatureMap_t *self)
The latitude for this source.
Definition acqvafeaturemap.c:889
int AcqvaFeatureMap_addAttribute(AcqvaFeatureMap_t *self, const char *name, RaveValue_t *value)
Adds an attribute to the feature map.
Definition acqvafeaturemap.c:931
struct _AcqvaFeatureMapElevation_t AcqvaFeatureMapElevation_t
Defines a feature map elevation.
Definition acqvafeaturemap.h:46
int AcqvaFeatureMapElevation_setElangle(AcqvaFeatureMapElevation_t *self, double elangle)
Sets the elevation angle for this group.
Definition acqvafeaturemap.c:1108
double AcqvaFeatureMap_getHeight(AcqvaFeatureMap_t *self)
The height for this source.
Definition acqvafeaturemap.c:901
int AcqvaFeatureMapField_createData(AcqvaFeatureMapField_t *self, long nbins, long nrays, RaveDataType type)
Creates a data field with specified geometry and type and will be initialized to 0.
Definition acqvafeaturemap.c:1308
int AcqvaFeatureMapField_setData(AcqvaFeatureMapField_t *self, long nbins, long nrays, void *data, RaveDataType type)
Sets a data field with specified data, geometry and type.
Definition acqvafeaturemap.c:1321
int AcqvaFeatureMapField_setElangle(AcqvaFeatureMapField_t *self, double elangle)
Sets the elevation angle for this field.
Definition acqvafeaturemap.c:1204
double AcqvaFeatureMapField_getRscale(AcqvaFeatureMapField_t *self)
Gets the rscale for this field.
Definition acqvafeaturemap.c:1224
Defines the functions available when working with polar scans.
struct _PolarScan_t PolarScan_t
Defines a Polar Scan.
Definition polarscan.h:41
Object for managing date and time.
Generic field that only provides a 2-dim data field and a number of dynamic attributes.
struct _RaveField_t RaveField_t
Defines a Rave field.
Definition rave_field.h:38
Generic implementation of an object that is used within rave.
struct _raveobjecttype RaveCoreObjectType
The rave object type definition.
Type definitions for RAVE.
RaveDataType
Different data types that are supported during transformation.
Definition rave_types.h:130
A value object that can represent standard types like int, double, .
struct _RaveValue_t RaveValue_t
Defines a rave value.
Definition rave_value.h:47
Implementation of a rave object list that ensures that the objects contained within the list are rele...
Definition acqvafeaturemap.c:48
Definition acqvafeaturemap.c:54
double beamwidth
the beamwidth in radians
Definition acqvafeaturemap.c:60
double elangle
the elangle
Definition acqvafeaturemap.c:57
double rscale
the scale of the bins
Definition acqvafeaturemap.c:58
long nrays
the number of rays
Definition acqvafeaturemap.c:62
RAVE_OBJECT_HEAD RaveData2D_t * data
Always on top.
Definition acqvafeaturemap.c:56
long nbins
the number of bins
Definition acqvafeaturemap.c:61
double rstart
the rstart of the bins
Definition acqvafeaturemap.c:59
Definition acqvafeaturemap.c:36