]> Pileus Git - ~andy/rsl/blob - examples/wsr88d_to_gif.c
RSL v1.41
[~andy/rsl] / examples / wsr88d_to_gif.c
1 /*
2  * Ingest NEXRAD (wsr88d) data and output 3 gif images representing
3  * Reflectivity, Velocity and Spectrum width.
4  *
5  * This example is the most minimum of coding that you need to do
6  * to achieve good results from using the RSL code.
7  *
8  * This is short and sweet to demonstrate the simplicity of use for
9  * the RSL.
10  *
11  * CAN READ STDIN.
12  *
13  * wsr88d_to_gif < file
14  * wsr88d_to_gif file [tape_header_file]
15  */
16
17 #include <stdlib.h>
18 #include "rsl.h"
19
20 int main(int argc, char **argv)
21 {
22   Radar *radar;
23
24 /*
25  * Pass bitwise or of DZ_MASK, VR_MASK, SW_MASK
26  */
27   RSL_radar_verbose_on(); /* Not needed; on a slow network it bides the time. */
28   radar = RSL_wsr88d_to_radar(argv[1], argv[2]);
29   if (radar == NULL) exit(-1);
30
31 /*  RSL_sort_radar(radar); */
32   
33 /***********************************************************************/
34 /*                                                                     */
35 /*            You now have a pointer to Radar.                         */
36 /*            Now use *radar all you like.                             */
37 /*                                                                     */
38 /***********************************************************************/
39
40 /* Use radar->v[DZ_INDEX] for REFELECTIVITY
41  *     radar->v[VR_INDEX] for VELOCITY
42  *     radar->v[SW_INDEX] for SPECTRUM_WIDTH
43  */
44
45   RSL_load_refl_color_table();
46   RSL_volume_to_gif(radar->v[DZ_INDEX], "dz_sweep", 400, 400, 200.0);
47
48   RSL_load_vel_color_table();
49   RSL_rebin_velocity_volume(radar->v[VR_INDEX]); /* Modifies v[i]. */
50   RSL_volume_to_gif(radar->v[VR_INDEX], "vr_sweep", 400, 400, 200.0);
51
52   RSL_load_sw_color_table();
53   RSL_volume_to_gif(radar->v[SW_INDEX], "sw_sweep", 400, 400, 200.0);
54
55   exit(0);
56
57 }
58
59
60