RAVE
rave_transform.h
Go to the documentation of this file.
1
7#ifndef RAVE_TRANSFORM_H
8#define RAVE_TRANSFORM_H
9
10#include "rave_types.h"
11#include "rave_proj.h"
12
16typedef struct {
17 PJ* inpj;
18 double inxscale;
19 double inyscale;
20 int inxmax;
21 int inymax;
22 UV inUL;
24 double nodata;
25 double noecho;
27 PJ* outpj;
28 double outxscale;
29 double outyscale;
30 UV outUL;
32 double R;
35 unsigned char* data;
40
44typedef struct {
45 int x;
46 int y;
47 double value;
48 double weight;
49 double distance;
51
55typedef struct {
58 double total_wsum;
59 double nodata;
60 double noecho;
63
67typedef struct {
68 unsigned char* src;
70 double elev;
71 int stride;
73
77typedef struct {
78 double beamwidth;
79 double nodata;
80 double noecho;
81 double lon;
82 double lat;
83 double geo_height;
88 double scale;
90 double cressmanxy;
91 double cressmanz;
95 int fieldsn;
98
107double get_array_item_2d(
108 unsigned char* data, int x, int y, RaveDataType type, int stride_xsize);
109
120 unsigned char* data, int x, int y, double v, RaveDataType type, int stride_xsize);
121
130double get_array_item_3d(RavePolarVolume* pvol, int e, int r, int a);
131
140void set_array_item_3d(RavePolarVolume* pvol, int e, int r, int a, double v);
141
147TransformWeight* init_tw(int noi);
148
154void free_tw(TransformWeight* v);
155
164TransformWeight* get_nearest_weights_2d(int x, int y, UV here_s, RaveTransform2D* tw);
165
174TransformWeight* get_bilinear_weights_2d(int x, int y, UV here_s, RaveTransform2D *tw);
175
184TransformWeight* get_cubic_weights_2d(int x, int y, UV here_s, RaveTransform2D *tw);
185
194TransformWeight* get_cressman_weights_2d(int x, int y, UV here_s, RaveTransform2D* tw);
195
205TransformWeight* get_weights_2d(int x, int y, UV here_s, RaveTransform2D* tw);
206
215
216#endif /* RAVE_TRANSFORM_H */
Handles compatibility issues related to PROJ versions and the definitions.
TransformWeight * get_nearest_weights_2d(int x, int y, UV here_s, RaveTransform2D *tw)
Gets the weight for the pixel closest to here_s and .
Definition rave_transform.c:318
double get_array_item_2d(unsigned char *data, int x, int y, RaveDataType type, int stride_xsize)
Gets the value at position x,y from the data field.
Definition rave_transform.c:61
TransformWeight * init_tw(int noi)
Creates a TransformWeight struct with noi number of weights allocated.
Definition rave_transform.c:241
TransformWeight * get_cubic_weights_2d(int x, int y, UV here_s, RaveTransform2D *tw)
Gets the cubic weights for the pixel surrounding here_s.
Definition rave_transform.c:423
void set_array_item_2d(unsigned char *data, int x, int y, double v, RaveDataType type, int stride_xsize)
Sets the value at position x,y in the data field.
Definition rave_transform.c:123
TransformWeight * get_weights_2d(int x, int y, UV here_s, RaveTransform2D *tw)
Gets the appropriate weights for the current algorithm and position.
Definition rave_transform.c:586
TransformWeight * get_cressman_weights_2d(int x, int y, UV here_s, RaveTransform2D *tw)
Gets the cressman weights for the pixel surrounding here_s.
Definition rave_transform.c:488
TransformWeight * get_bilinear_weights_2d(int x, int y, UV here_s, RaveTransform2D *tw)
Gets the bilinear weights for the pixel surrounding here_s.
Definition rave_transform.c:355
void set_array_item_3d(RavePolarVolume *pvol, int e, int r, int a, double v)
Sets a value in a polar volume.
Definition rave_transform.c:235
void free_tw(TransformWeight *v)
Deallocates the whole TransformWeight struct v, including the weights allocated.
Definition rave_transform.c:269
double get_array_item_3d(RavePolarVolume *pvol, int e, int r, int a)
Gets a value from a polar volume.
Definition rave_transform.c:229
double compute_weights_2d(TransformWeight *tw)
Evaluates the weights specified in the TransformWeight struct, the weights will be normalized within ...
Definition rave_transform.c:602
Type definitions for RAVE.
RaveTransformationMethod
Transformation methods.
Definition rave_types.h:148
RaveDataType
Different data types that are supported during transformation.
Definition rave_types.h:130
Defines one field in a volume.
Definition rave_transform.h:67
double elev
The elevation.
Definition rave_transform.h:70
int stride
The stride.
Definition rave_transform.h:71
RaveDataType type
The type of data.
Definition rave_transform.h:69
unsigned char * src
The data array.
Definition rave_transform.h:68
Defines one polar volume.
Definition rave_transform.h:77
int range_uppb
Number of range bins.
Definition rave_transform.h:86
double noecho
No echo.
Definition rave_transform.h:80
int fieldsn
number of fields
Definition rave_transform.h:95
double azimuth_offset
Azimutal difference between two nearby beans.
Definition rave_transform.h:87
int azim_uppb
Number of beans.
Definition rave_transform.h:85
int got_cressmanz
if cressmanz is set
Definition rave_transform.h:93
double geo_height
Height of the radar.
Definition rave_transform.h:83
double lat
Latitude for the radar.
Definition rave_transform.h:82
RavePolarField * fields
The array of fields.
Definition rave_transform.h:96
double nodata
No data.
Definition rave_transform.h:79
int got_cressmanxy
if cressmanxy is set
Definition rave_transform.h:92
double scale
Resolution for the beans.
Definition rave_transform.h:88
double cressmanxy
xy value used in cressman
Definition rave_transform.h:90
double lon
Longitude for the radar.
Definition rave_transform.h:81
double cressmanz
z value used in cressman
Definition rave_transform.h:91
double beamwidth
Beamwidth.
Definition rave_transform.h:78
Data structure when working with 2D projections.
Definition rave_transform.h:16
unsigned char * data
Source data.
Definition rave_transform.h:35
double noecho
No echo value.
Definition rave_transform.h:25
double outyscale
Destination y-scale.
Definition rave_transform.h:29
double outxscale
Destination x-scale.
Definition rave_transform.h:28
int inxmax
Source x-dimension.
Definition rave_transform.h:20
double R
Radius for transformation, used in cressman.
Definition rave_transform.h:32
RaveDataType type
Source data type.
Definition rave_transform.h:36
PJ * inpj
Source projection.
Definition rave_transform.h:17
RaveTransformationMethod method
Transformation method.
Definition rave_transform.h:33
UV outUL
Destination upper-left corner.
Definition rave_transform.h:30
int inymax
Source y-dimension.
Definition rave_transform.h:21
PJ * outpj
Destination projection.
Definition rave_transform.h:27
double inyscale
Source y-scale.
Definition rave_transform.h:19
UV inUL
Source upper-left corner.
Definition rave_transform.h:22
double inxscale
Source x-scale.
Definition rave_transform.h:18
double nodata
No data value.
Definition rave_transform.h:24
int stride_xsize
Source stride for length of one step y-wise, i.e.
Definition rave_transform.h:37
Weight for one item.
Definition rave_transform.h:44
double distance
the distance to the origin
Definition rave_transform.h:49
double weight
the weight
Definition rave_transform.h:48
double value
the value
Definition rave_transform.h:47
int y
the y position
Definition rave_transform.h:46
int x
the x position
Definition rave_transform.h:45
All weights that should be used for calculating a value of a position.
Definition rave_transform.h:55
RaveWeight2D * weights
all weights
Definition rave_transform.h:56
int weightsn
Number of weights.
Definition rave_transform.h:57
double noecho
noecho value
Definition rave_transform.h:60
double nodata
nodata value
Definition rave_transform.h:59
double total_wsum
the total weight sum
Definition rave_transform.h:58
int scale_weights
If the weights should be normalized.
Definition rave_transform.h:61