63 #define MAX_RESULTS 200
64 #define SPL 0.299792458
65 #define MAX_DECON_SIZE 1024
67 #define MAX_GOOD_SOURCES 5
68 char *
good_sources[] = {
"Mercury",
"Venus",
"Mars",
"Saturn",
"Jupiter"};
112 token = strtok(edit,
" \n\t");
116 token = strtok(NULL,
" \n\t");
125 double lambda, theta, hm, dish_size, taper;
143 st_report(
"fwhm(): Using Non Standard Dish Size: %.2f M", dish_size);
149 st_report(
"fwhm(): Using Non Standard Taper: %.2f", taper);
152 st_report(
"fwhm(): Dish Size = %5.2f M", dish_size);
153 st_report(
"fwhm(): Taper Factor = %5.2f", taper);
156 theta = taper * (lambda / dish_size);
157 hm = theta * (180.0 / M_PI) * 1800.0;
159 st_report(
"fwhm(): lambda = %5.2f mm", lambda * 1000.0);
170 int yr, curyea, curmon, curday;
171 double ven_d, mar_d, jup_d, sat_d;
173 char tbuf[256], ename[256];
181 if((fp = fopen(ename,
"r")) == NULL)
183 st_fail(
"Can't Open Ephemeris File: %s", ename);
196 while(fgets(tbuf,
sizeof(tbuf), fp) != NULL)
206 if(yr == curyea && mon == curmon && day == curday)
220 st_report(
"Venus = %.2f, Mars = %.2f, Jup = %.2f, Sat = %.2f",
221 ven_d, mar_d, jup_d, sat_d);
228 if(!
strcmp(name,
"Jupiter"))
233 if(!
strcmp(name,
"Venus"))
238 if(!
strcmp(name,
"Saturn"))
251 void convolve(
const double Signal[],
size_t SignalLen,
252 const double Kernel[],
size_t KernelLen,
257 for (n = 0; n < SignalLen + KernelLen - 1; n++)
259 size_t kmin, kmax, k;
263 kmin = (n >= KernelLen - 1) ? n - (KernelLen - 1) : 0;
264 kmax = (n < SignalLen - 1) ? n : SignalLen - 1;
266 for (k = kmin; k <= kmax; k++)
268 Result[n] += Signal[k] * Kernel[n - k];
296 double beam_width, half_obj;
297 double a[4], dyda[4], y, maxg=0.0;
299 static double obj_width;
301 st_report(
"convol(): Object = %s", source);
302 st_report(
"convol(): Freq = %10.6f GHz", freq);
304 beam_width =
fwhm(freq) * 2.0;
307 st_report(
"convol(): FWHM = %5.2f arcsecs", beam_width);
311 st_report(
"convol(): Skipping %s", source);
312 st_report(
"convol(): Setting planet_hp to %.2f", 3600.0 * beam_width / 2.0);
322 *source_size = obj_width;
329 st_report(
"convol(): Object Width = %5.2f arcsecs", obj_width);
331 half_obj = obj_width / 2.0;
339 for(i=-100;i<100;i++, p++)
341 fgauss((
double)i, a, &y, dyda);
346 if(i < (
int)-half_obj || i > (
int)half_obj)
420 st_fail(
"gauss_fit() returned failure");
424 st_report(
"convol(): GaussFit = %.2f %.2f %.2f", a[1], a[2], a[3]);
435 double freq, fw, source_size, beam_size;
439 bzero((
char *)&
dcs,
sizeof(
dcs));
441 st_report(
"initDeConStruct(): Initializing Convole Table for %s on planet: %s",
483 if((fp = fopen(
"convol.table",
"w")) == NULL)
485 st_fail(
"initDeConStruct(): Can't Open Convol Table File: %s",
"convol.table");
492 fprintf(fp,
"%10.5f %10.6f %10.6f %10.6f\n",
507 double formula_bs, source_size2, con2;
520 st_report(
"doDeConvol(): Found @ Table Index: = %d", next);
525 st_fail(
"doDeConvol(): Decon Function ran off end of table");
533 formula_bs = sqrt(con2 - (log(2.0) / 2.0) * source_size2);
534 st_report(
"doDeConvol(): Decon Formula Result = %.2f", formula_bs);
561 for(i=0;i<no-1 && xtab[i+1]<x;i++)
573 for(i=0;i>0 && xtab[i]>x;i--)
586 return(ytab[i] + (ytab[i+1] - ytab[i]) * (x - xtab[i]) /
587 (xtab[i+1] - xtab[i]));
struct LP_IMAGE_INFO * h0
struct RESULTS results[MAX_BKNDS][MAX_BKNDS]
double y_array[MAX_RESULTS]
double bs_array[MAX_DECON_SIZE]
double r_array[MAX_RESULTS]
char convol_tok[MAX_TOKENS][MAX_TOKENS]
double restFreq(struct HEADER *h)
int convol_get_tok(char *edit)
double interpl8(double *xtab, double *ytab, int no, double x, int *next)
double s_array[MAX_RESULTS]
double fw_array[MAX_DECON_SIZE]
struct DECONVOL_STRUCT dcs
void convolve(const double Signal[], size_t SignalLen, const double Kernel[], size_t KernelLen, double Result[])
double x_array[MAX_RESULTS]
double findObj(char *name)
double freq_array[MAX_DECON_SIZE]
double b_array[MAX_RESULTS]
int convol(char *source, int first, double freq, double *fw, double *source_size, double *beam_size)