| 1 |
< |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
| 1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
|
static char SCCSid[] = "$SunId$ SGI"; |
| 212 |
|
double frac; |
| 213 |
|
int i; |
| 214 |
|
register int j, k; |
| 215 |
< |
/* free old list */ |
| 216 |
< |
if (complen > 0) |
| 215 |
> |
/* free old list and empty queue */ |
| 216 |
> |
if (complen > 0) { |
| 217 |
|
free((char *)complist); |
| 218 |
+ |
done_packets(flush_queue()); |
| 219 |
+ |
} |
| 220 |
|
/* allocate beam list */ |
| 221 |
|
complen = 0; |
| 222 |
|
for (j = 0; hdlist[j] != NULL; j++) |
| 227 |
|
/* compute beam weights */ |
| 228 |
|
k = 0; |
| 229 |
|
for (j = 0; hdlist[j] != NULL; j++) { |
| 230 |
< |
frac = 512. * hdlist[j]->wg[0] * |
| 231 |
< |
hdlist[j]->wg[1] * hdlist[j]->wg[2]; |
| 232 |
< |
if (frac < 0.) frac = -frac; |
| 230 |
> |
frac = 512. * VLEN(hdlist[j]->wg[0]) * |
| 231 |
> |
VLEN(hdlist[j]->wg[1]) * |
| 232 |
> |
VLEN(hdlist[j]->wg[2]); |
| 233 |
|
for (i = nbeams(hdlist[j]); i > 0; i--) { |
| 234 |
|
complist[k].hd = j; |
| 235 |
|
complist[k].bi = i; |
| 236 |
|
complist[k].nr = frac*beamvolume(hdlist[j], i) + 0.5; |
| 237 |
+ |
complist[k].nc = bnrays(hdlist[j], i); |
| 238 |
|
wtotal += complist[k++].nr; |
| 239 |
|
} |
| 240 |
|
} |