6 * Cannot compile if the hash table is static in volume.c. For
7 * testing we make it globally known.
15 extern int RSL_max_sweeps; /* Initial allocation for sweep_list.
16 * RSL_new_sweep will allocate the space first
19 extern int RSL_nsweep_addr; /* A count of sweeps in the table. */
20 extern Sweep_list *RSL_sweep_list;
21 extern int RSL_nextents;
24 void print_link_list(Azimuth_hash *list)
30 printf("ray# %d azim %f |", list->ray->h.ray_num, list->ray->h.azimuth);
31 print_link_list(list->next);
35 void print_hash_table (Sweep *s)
43 if (s == NULL) return;
44 sweep_index = SWEEP_INDEX(s);
45 res = 360.0/RSL_sweep_list[sweep_index].hash->nindexes;
46 printf("Azimuth resolution = %f for %d bins.\n", res, RSL_sweep_list[sweep_index].hash->nindexes);
47 for (i=0; i<RSL_sweep_list[sweep_index].hash->nindexes; i++) {
48 index = RSL_sweep_list[sweep_index].hash->indexes[i];
50 printf("RSL_sweep_list[%d].hash->indexes[%d] = ", sweep_index, i);
55 print_link_list(index);
59 Sweep * get_sector(Sweep *s, float lo_azimuth, float hi_azimuth)
65 if (s == NULL) return NULL;
67 if ((new_sweep = RSL_new_sweep(s->h.nrays)) == NULL)
71 for (i = 0,j = 0; i < s->h.nrays; i++) {
72 if (s->ray[i] == NULL) continue;
73 if (s->ray[i]->h.azimuth >= lo_azimuth &&
74 s->ray[i]->h.azimuth < hi_azimuth) {
77 new_sweep->ray[j] =RSL_copy_ray(s->ray[i]);
88 int main(int argc, char **argv)
93 if (argc != 3) {fprintf(stderr, "Usage: %s infile callid_or_firstfile\n", argv[0]); exit(-1);}
94 RSL_radar_verbose_on();
95 radar = RSL_wsr88d_to_radar(argv[1], argv[2]);
96 if (radar == NULL) exit(-1);
98 RSL_load_refl_color_table();
100 sector = get_sector(radar->v[DZ_INDEX]->sweep[0], 0.0, 90.0);
102 /* sector = RSL_copy_sweep(radar->v[DZ_INDEX]->sweep[0]);
105 print_hash_table(sector);
107 RSL_sweep_to_gif(sector, "dz_sector.gif", 400, 400, 200.0);