68 st_fail(
"No Focus Scans Loaded yet");
85 st_report(
"Focus Struct send to Xgraphic");
112 if(p1->tamb < p2->tamb)
117 if(p1->tamb > p2->tamb)
131 if(p1->scan < p2->scan)
136 if(p1->scan > p2->scan)
177 int i, j, ret, good, oc;
222 if(strncmp(p->
obsmode,
"CONTNSFC", 8))
235 if(strncmp(p->
obsmode,
"CONTEWFC", 8))
247 if(strncmp(p->
obsmode,
"CONTFOC", 7))
314 st_report(
"Rejecting scan %.2f for being too weak", p->
scan);
324 if(cnterr < env->focus_cnterr_limit)
332 st_report(
"Rejecting scan %.2f for being too noisy", p->
scan);
355 st_report(
"Rejecting scan %.2f for Fit being too diff", p->
scan);
372 e->
el = (float)p->
el;
420 st_report(
"findLoadFocuses(): Wrote %d records to: focus_send", j);
436 char tbuf[256], cmdBuf[512];
437 char formulaBuf[256], form[256];
442 st_report(
"doFocusGracefit(): Fitting a %d order LSQ to Loaded Focus Scans",
env->
nfit);
446 st_fail(
"Little or No Focus Scans Loaded");
450 bzero((
char *)xd,
sizeof(xd));
451 bzero((
char *)yd,
sizeof(yd));
452 bzero((
char *)coeff,
sizeof(coeff));
471 st_report(
"doFocusGracefit(): AVERAGE: %f", avg);
516 st_print(
"a%d = %.4e ", k, coeff[k]);
524 strcpy(formulaBuf,
"(");
530 case 0: sprintf(form,
"%e ", coeff[k]);
break;
531 case 1: sprintf(form,
"+ (%e * el) ", coeff[k]);
break;
532 case 2: sprintf(form,
"+ (%e * (el * el)) ", coeff[k]);
break;
533 case 3: sprintf(form,
"+ (%e * (el * el * el)) ", coeff[k]);
break;
534 case 4: sprintf(form,
"+ (%e * (el * el * el * el)) ", coeff[k]);
break;
537 strcat(formulaBuf, form);
540 strcat(formulaBuf,
")");
546 sprintf(cmdBuf,
"formula /d /%d %s",
env->
nfit, formulaBuf);
554 for(i=0;i<n;i++,e++,f++)
577 sprintf(tbuf,
"a%d = %.4e ", k, coeff[k]);
602 st_print(
"Num Source Scan Freq Elev Peak F0 Fit Diff Center-Err Tamb Scaling\n");
619 st_fail(
"No Focus Scans Loaded yet");
633 sprintf(tbuf,
"%3d: %16.16s %9.2f %9.3f %9.2f %9.2f %9.3f %9.3f %9.3f %10.6f %7.1f %7.3f",
675 if(strncmp(p->
obsmode,
"CONTFOC", 7) && strncmp(p->
obsmode,
"CONTNSFC", 8) )
718 st_fail(
"No numeric flag passed to 'focus /c'");
722 sprintf(cmdBuf,
"double tmp");
733 st_fail(
"No Focus Scans Loaded yet");
744 sprintf(cmdBuf,
"get %.2f /q", p->
scan);
747 sprintf(cmdBuf,
"tmp = %s /q", f->
formula);
755 st_report(
"Formula %d, not defined; removing correction", n);
780 st_report(
"No Function Flag; removing correction");
795 st_report(
"doFocus(): Reading in Focus Scans");
823 st_report(
"doFocus(): Listing Available Focus Scans in file");
832 st_report(
"doFocus(): Listing Loaded Focus Scans");
struct LP_IMAGE_INFO * h0
#define FOCUS_SORTED_ELEV
int sock_write(struct SOCK *s, char *message, int l)
char * strcmprs(char *str)
int incrementBogusTsys(void)
int incrementBogusData(void)
#define FOCUS_SCALE_MULTI
int focusSortEl(struct FOCUS_HISTORY_ELEM *p1, struct FOCUS_HISTORY_ELEM *p2)
double focus_cnterr_limit
#define FOCUS_SORTED_SCAN
int focusSortTemp(struct FOCUS_HISTORY_ELEM *p1, struct FOCUS_HISTORY_ELEM *p2)
int incrementRejIgnored(void)
struct FOCUS_HISTORY_SEND focus_send
char blabels[MAX_FOCUS_LABELS][256]
#define MAX_FOCUS_HISTORY
int resetRejections(void)
int fitcurve(double *x, double *y, int n, int ideg, double *coeff)
double leasev(double *c, int degree, double x)
int meetsCritiria(struct HEADER *p, int mask)
int getLabelPos(char *msg)
#define FOCUS_SORTED_TAMB
int isScanIgnored(double scan)
float bplot[MAX_FOCUS_HISTORY]
int incrementRejMode(void)
int printScan(struct HEADER *p, int nsave)
#define FOCUS_SCALE_DIVIDE
int focusSortScan(struct FOCUS_HISTORY_ELEM *p1, struct FOCUS_HISTORY_ELEM *p2)
int incrementRejFreq(void)
struct FOCUS_HISTORY_ELEM focuses[MAX_FOCUS_HISTORY]