ROPO
Loading...
Searching...
No Matches
fmi_radar_image.h
1
25#ifndef __FMI_RADAR_IMAGE__
26#define __FMI_RADAR_IMAGE__
27#define FMI_RADAR_IMAGE_VER "fmi_radar_image\t v2.3\t Jan 2002 (c) Markus.Peura@fmi.fi"
28
29typedef signed char Dbz;
30
31#include "fmi_image.h"
32#include "fmi_radar_codes.h"
33
34
35#define FMI_RADAR_SWEEP_COUNT 20 /* ACTUALLY: MAXIMUM 2009 */
36
37extern float fmi_radar_sweep_angles[FMI_RADAR_SWEEP_COUNT];
38
39/* defaults */
40#define FMI_RADAR_BIN_DEPTH 500.0 /* 500m */
41#define FMI_RADAR_BIN_COUNT 500 /* 500 pixels */
42/*#define FMI_RADAR_RAY_COUNT 360 */
43
44#define EARTH_RADIUS43 (EARTH_RADIUS*4/3) /* 500m */
45
46/* Context */
47extern float fmi_radar_bin_depth;
48void setup_context(FmiImage * source);
49
50void dump_sweep_info(void);
51
52/* TRANSFORMS */
53/* intensity transforms */
54int abs_dbz_to_byte(Dbz);
55int rel_dbz_to_byte(Dbz);
56int abs_dbz_to_int(Dbz);
57int rel_dbz_to_int(Dbz);
58
59int byte_to_abs_dbz(Byte);
60int byte_to_rel_dbz(Byte);
61/* geometric transforms */
62int bin_to_metre(int bin);
63int metre_to_bin(int metres);
64
65int bin_to_altitude(int sweep_bin,float sweep_angle); /* metres */
66int altitude_to_bin(int metres,float sweep_angle);
67
68int sweep_to_ground(int sweep_bin,float sweep_angle);
69int ground_to_bin(int ground_metres,float sweep_angle);
70
71int bin_to_bin(int sweep_bin,float sweep_angle,float target_sweep_angle);
72
73int bin_altitude(int sweep_bin,float sweep_angle);
74int altitude_to_altitude(int altitude,float sweep_angle);
75
76void xy_to_polar(int i,int j,int *theta,int *radius);
77
78void volume_to_cappi(FmiImage *volume,int altitude,FmiImage *cappi); /* metres */
79
80/*void detect_ground_echo(FmiImage *source,int ppi_count,FmiImage *prob,int intensity_diff,int half_altitude); */
81void detect_ground_echo_mingrad(FmiImage *source,int ppi_count,FmiImage *prob,int intensity_diff,int half_altitude);
82void detect_ground_echo_minnetgrad(FmiImage *source,int ppi_count,FmiImage *prob,int intensity_diff,int half_altitude);
83
84void detect_emitters(FmiImage *source,FmiImage *trace,int min_intensity,int min_length);
85void detect_emitters2(FmiImage *source,FmiImage *trace,int min_intensity,int min_length,int max_width);
86
87void detect_emitters2old(FmiImage *source,FmiImage *trace,int min_intensity,int min_length,int max_width);
88
89/*void detect_emitters4(FmiImage *source,FmiImage *trace,int min_intensity,int min_length,int max_width); */
90
91/*void detect_emitters5(FmiImage *source,FmiImage *trace,int min_intensity,int min_length,int max_width); */
92
93void enhance_horz_lines2(FmiImage *trace,int weight);
94void enhance_vert_lines(FmiImage *trace,int weight);
95
96
97void initialize_histogram(FmiImage *source,Histogram histogram,
98 int hrad,int vrad,int i,int j,int (* hist_func)(Histogram));
99
100/* ANOMALIA FILTERING */
101/* delete segments with maxtop < intensity */
102void detect_ships(FmiImage *source,FmiImage *prob,int min_intensity,int min_area);
103/*void remove_ships2(FmiImage *source,int min_intensity,int min_area); */
104
105/* geom. correction */
106/*void compensate_radially(FmiImage *image,int slope); */
107void distance_compensation_mul(FmiImage *image,int slope);
108void distance_compensation_div(FmiImage *image,int slope);
109
110
111/* remove distant emitter/solar disturbance lines */
112void remove_thin_horz_lines(FmiImage *target,int min_elevation,int weight);
113void remove_horz_lines(FmiImage *target,int min_length,int min_elevation,int weight);
114/*void remove_thin_horz_lines(FmiImage *target,int min_elevation,int weight); */
115
116void detect_insect_band(FmiImage *source,FmiImage *prob,int start_intensity,int radius,int weight);
117
118void detect_biomet(FmiImage *source,FmiImage *prob,int intensity_max,int intensity_delta,int altitude_max,int altitude_delta);
119
120/*void detect_sun(FmiImage *source,FmiImage *trace,int min_intensity,int typical_width); */
121void detect_sun(FmiImage *source,FmiImage *trace,int min_intensity,int min_length,int typical_width);
122
123void detect_sun2(FmiImage *source,FmiImage *trace,int min_intensity,int min_length,int typical_width,int azimuth,int elevation);
124
125void detect_too_warm(FmiImage *source,FmiImage *prob,FmiImage *meteosat,Celsius c50,Celsius c75,int min_intensity,int min_size);
126
127void detect_doppler_anomaly(FmiImage *source,FmiImage *target,int width, int height,int threshold);
128
129
130
131/* CONVERSIONS */
132
133
134/* display and visualization */
135/*int byte_to_rgb(FmiImage *source,FmiImage *target); */
136void pgm_to_ppm_radar(FmiImage *source,FmiImage *target);
137void pgm_to_ppm_radar_iris(FmiImage *source,FmiImage *target);
138void pgm_to_redgreen(FmiImage *source,FmiImage *target);
139void pgm_to_pgm_print(FmiImage *source,FmiImage *target);
140void pgm_to_pgm_print2(FmiImage *source,FmiImage *target);
141
142
143/* ODDITIES */
144int histogram_dominate_anaprop(Histogram h);
145void virtual_rhi(FmiImage *volume);
146void gradient_rgb(FmiImage *volume);
147
148#endif