5 * Cannot compile if the hash table is static in volume.c. For
6 * testing we make it globally known.
14 extern int RSL_max_sweeps; /* Initial allocation for sweep_list.
15 * RSL_new_sweep will allocate the space first
18 extern int RSL_nsweep_addr; /* A count of sweeps in the table. */
19 extern Sweep_list *RSL_sweep_list;
20 extern int RSL_nextents;
23 void print_link_list(Azimuth_hash *list)
29 printf("ray# %d azim %f |", list->ray->h.ray_num, list->ray->h.azimuth);
30 print_link_list(list->next);
34 void print_hash_table (Sweep *s)
42 if (s == NULL) return;
43 sweep_index = SWEEP_INDEX(s);
44 res = 360.0/RSL_sweep_list[sweep_index].hash->nindexes;
45 printf("Azimuth resolution = %f for %d bins.\n", res, RSL_sweep_list[sweep_index].hash->nindexes);
46 for (i=0; i<RSL_sweep_list[sweep_index].hash->nindexes; i++) {
47 index = RSL_sweep_list[sweep_index].hash->indexes[i];
49 printf("RSL_sweep_list[%d].hash->indexes[%d] = ", sweep_index, i);
54 print_link_list(index);
58 Sweep * get_sector(Sweep *s, float lo_azimuth, float hi_azimuth)
64 if (s == NULL) return NULL;
66 if ((new_sweep = RSL_new_sweep(s->h.nrays)) == NULL)
70 for (i = 0,j = 0; i < s->h.nrays; i++) {
71 if (s->ray[i] == NULL) continue;
72 if (s->ray[i]->h.azimuth >= lo_azimuth &&
73 s->ray[i]->h.azimuth < hi_azimuth) {
76 new_sweep->ray[j] =RSL_copy_ray(s->ray[i]);
87 void main(int argc, char **argv)
92 if (argc != 3) {fprintf(stderr, "Usage: %s infile callid_or_firstfile\n", argv[0]); exit(-1);}
93 RSL_radar_verbose_on();
94 radar = RSL_wsr88d_to_radar(argv[1], argv[2]);
95 if (radar == NULL) exit(-1);
97 RSL_load_refl_color_table();
99 sector = get_sector(radar->v[DZ_INDEX]->sweep[0], 0.0, 90.0);
101 /* sector = RSL_copy_sweep(radar->v[DZ_INDEX]->sweep[0]);
104 print_hash_table(sector);
106 RSL_sweep_to_gif(sector, "dz_sector.gif", 400, 400, 200.0);