]> Pileus Git - ~andy/rsl/blob - examples/wsr88d_to_gif.c
Initial import
[~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 "rsl.h"
18
19 void main(int argc, char **argv)
20 {
21   Radar *radar;
22
23 /*
24  * Pass bitwise or of DZ_MASK, VR_MASK, SW_MASK
25  */
26   RSL_radar_verbose_on(); /* Not needed; on a slow network it bides the time. */
27   radar = RSL_wsr88d_to_radar(argv[1], argv[2]);
28   if (radar == NULL) exit(-1);
29
30 /*  RSL_sort_radar(radar); */
31   
32 /***********************************************************************/
33 /*                                                                     */
34 /*            You now have a pointer to Radar.                         */
35 /*            Now use *radar all you like.                             */
36 /*                                                                     */
37 /***********************************************************************/
38
39 /* Use radar->v[DZ_INDEX] for REFELECTIVITY
40  *     radar->v[VR_INDEX] for VELOCITY
41  *     radar->v[SW_INDEX] for SPECTRUM_WIDTH
42  */
43
44   RSL_load_refl_color_table();
45   RSL_volume_to_gif(radar->v[DZ_INDEX], "dz_sweep", 400, 400, 200.0);
46
47   RSL_load_vel_color_table();
48   RSL_rebin_velocity_volume(radar->v[VR_INDEX]); /* Modifies v[i]. */
49   RSL_volume_to_gif(radar->v[VR_INDEX], "vr_sweep", 400, 400, 200.0);
50
51   RSL_load_sw_color_table();
52   RSL_volume_to_gif(radar->v[SW_INDEX], "sw_sweep", 400, 400, 200.0);
53
54   exit(0);
55
56 }
57
58
59