Linuxpops  3.01.04
Spectral Anaysis Package for Single Dish Data
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
focus.c
Go to the documentation of this file.
1 /*
2 Copyright 2021 Arizona Board of Regents on behalf of the University of Arizona.
3 
4 For commercial uses, to obtain a license to sell and or sublicense copies of
5 the Software please contact the University of Arizona at Tech Launch Arizona:
6 lewish@tla.arizona.edu.
7 
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction for non-commercial use educational and
11 research purposes, including without limitation the rights to use, copy,
12 modify, merge, publish, distribute, and to permit persons to whom the Software
13 is furnished to do so, subject to the following conditions:
14 
15 The entire above copyright notice and this permission notice shall be included
16 in all copies or substantial portions of the Software.
17 
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 SOFTWARE.
25 
26 1. Additional Required Provisions
27 
28 1.1. Arbitration. The parties agree that if a dispute arises between them
29 concerning this Agreement, the parties may be required to submit the matter to
30 arbitration pursuant to Arizona law.
31 
32 1.2. Applicable Law and Venue. This Agreement shall be interpreted pursuant
33 to the laws of the State of Arizona. Any arbitration or litigation between the
34 Parties shall be conducted in Pima County, ARIZONA, and LICENSEE hereby
35 submits to venue and jurisdiction in Pima County, ARIZONA.
36 
37 1.3. Non-Discrimination. The Parties agree to be bound by state and federal
38 laws and regulations governing equal opportunity and non-discrimination and
39 immigration.
40 
41 1.4. Appropriation of Funds. The Parties recognize that performance by
42 ARIZONA may depend upon appropriation of funds by the State Legislature of
43 ARIZONA. If the Legislature fails to appropriate the necessary funds, or if
44 ARIZONA’S appropriation is reduced during the fiscal year, ARIZONA may cancel
45 this Agreement without further duty or obligation. ARIZONA will notify
46 LICENSEE as soon as reasonably possible after it knows of the loss of funds.
47 
48 1.5. Conflict of Interest. This Agreement is subject to the provisions of
49 A.R.S. 38-511 and other conflict of interest regulations. Within three years
50 of the EFFECTIVE DATE, ARIZONA may cancel this Agreement if any person
51 significantly involved in initiating, negotiating, drafting, securing, or
52 creating this Agreement for or on behalf of ARIZONA becomes an employee or
53 consultant in any capacity of LICENSEE with respect to the subject matter of
54 this Agreement.
55 
56  */
57 
58 #include "extern.h"
59 
61 
63 
64 int sendFocus()
65 {
66  if(!focus_send.nfocs)
67  {
68  st_fail("No Focus Scans Loaded yet");
69  return(1);
70  }
71 
72  strcpy(focus_send.magic, "FOCUS_SEND");
73 
76 
77  if(last_mouse_x != 0.0 && last_mouse_y != 0.0)
78  {
81  }
82 
83  sock_write(xgraphic, (char *)&focus_send, sizeof(focus_send));
84 
85  st_report("Focus Struct send to Xgraphic");
86 
87  return(0);
88 }
89 
90 int focusSortEl(p1, p2)
91 struct FOCUS_HISTORY_ELEM *p1, *p2;
92 {
93  if(p1->el < p2->el)
94  {
95  return(-1);
96  }
97  else
98  if(p1->el > p2->el)
99  {
100  return(1);
101  }
102  else
103  {
104  return(0);
105  }
106 }
107 
108 
109 int focusSortTemp(p1, p2)
110 struct FOCUS_HISTORY_ELEM *p1, *p2;
111 {
112  if(p1->tamb < p2->tamb)
113  {
114  return(-1);
115  }
116  else
117  if(p1->tamb > p2->tamb)
118  {
119  return(1);
120  }
121  else
122  {
123  return(0);
124  }
125 }
126 
127 
128 int focusSortScan(p1, p2)
129 struct FOCUS_HISTORY_ELEM *p1, *p2;
130 {
131  if(p1->scan < p2->scan)
132  {
133  return(-1);
134  }
135  else
136  if(p1->scan > p2->scan)
137  {
138  return(1);
139  }
140  else
141  {
142  return(0);
143  }
144 }
145 
146 
148 {
149 
150  if(isSet(PF_I_FLAG))
151  {
152  st_report("dofocusSort(): Sorting %d records by Scan Number", focus_send.nfocs);
153  qsort(&focus_send.focuses, focus_send.nfocs, sizeof(struct FOCUS_HISTORY_ELEM), (__compar_fn_t)focusSortScan);
155  }
156  else
157  if(isSet(PF_T_FLAG))
158  {
159  st_report("dofocusSort(): Sorting %d records by Ambient Temperature", focus_send.nfocs);
160  qsort(&focus_send.focuses, focus_send.nfocs, sizeof(struct FOCUS_HISTORY_ELEM), (__compar_fn_t)focusSortTemp);
162  }
163  else
164  {
165  st_report("dofocusSort(): Sorting %d records by Elevation", focus_send.nfocs);
166  qsort(&focus_send.focuses, focus_send.nfocs, sizeof(struct FOCUS_HISTORY_ELEM), (__compar_fn_t)focusSortEl);
168  }
169 
170  return(0);
171 }
172 
173 
174 
176 {
177  int i, j, ret, good, oc;
178  double F0;
179  struct HEADER *p;
180  struct FOCUS_HISTORY_ELEM *e;
181 
182  resetRejections();
183  env->last_scan_count = 0;
184 
185  bzero((char *)&focus_send, sizeof(focus_send));
186  strcpy(focus_send.magic, "FOCUS_SEND");
187 
189 
190  j = 0;
191  e = &focus_send.focuses[j];
192  p = &sa[j];
193 
194  clearInterrupt();
195 
196  for(i=j;i<env->numofscans;i++,p++)
197  {
198  if(isInterrupt())
199  {
200  env->last_scan_count = j;
201  focus_send.nfocs = j;
202 
203  if(j > 5)
204  {
205  dofocusSort();
206  }
207 
208  return(1);
209  }
210 
211  good = 0;
212 
213  if(!meetsCritiria(p, CHECK_ALL))
214  {
215  continue;
216  }
217 
218  if(isSet(PF_N_FLAG)) /* Load NSFC insteads */
219  {
221 
222  if(strncmp(p->obsmode, "CONTNSFC", 8))
223  {
225  continue;
226  }
227 
228  F0 = p->focusv;
229  }
230  else
231  if(isSet(PF_E_FLAG)) /* Load EWFC insteads */
232  {
234 
235  if(strncmp(p->obsmode, "CONTEWFC", 8))
236  {
238  continue;
239  }
240 
241  F0 = p->focusv;
242  }
243  else
244  {
246 
247  if(strncmp(p->obsmode, "CONTFOC", 7))
248  {
250  continue;
251  }
252 
253  F0 = p->focusr;
254  }
255 
256  if(isScanIgnored(p->scan))
257  {
258  oc = oldColor;
259  setColor(YELLOW);
260  st_report("Ignoring scan %.2f", p->scan);
261  setColor(oc);
262 
264  continue;
265  }
266 
267  /* Check if tsys is bad */
268  if((env->tsyslimit && (fabs(p->stsys) > env->tsyslimit)) || gsl_isnan(p->stsys))
269  {
270  oc = oldColor;
271  setColor(YELLOW);
272  st_report("Rejecting scan %.2f, Tsys Greater then %.1f: %.1f", p->scan, env->tsyslimit, p->stsys);
273  setColor(oc);
274 
276 
277  continue;
278  }
279 
280  if(env->focus_freq_upper != 0.0 && env->focus_freq_lower != 0.0)
281  {
282  if((p->restfreq / 1e3) < env->focus_freq_lower || (p->restfreq / 1e3) > env->focus_freq_upper)
283  {
284  oc = oldColor;
285  setColor(YELLOW);
286  st_report("Rejecting scan %.2f, Out of Band", p->scan);
287  setColor(oc);
288 
290 
291  continue;
292  }
293  }
294 
295  ret = read_scan(p->scan, env->filename, h0->yplot1, &h0->head, 0);
296  env->curScan = p->scan;
297 
298  if(ret > 0.0)
299  {
300  showScan();
301 
302  strncpy(e->source, p->object, 16);
303  strcmprs(e->source);
304 
305  /* Only save if they meet limits */
307  {
308  good++;
309  }
310  else
311  {
312  oc = oldColor;
313  setColor(YELLOW);
314  st_report("Rejecting scan %.2f for being too weak", p->scan);
315  setColor(oc);
316 
318 
319  continue;
320  }
321 
323  {
324  if(cnterr < env->focus_cnterr_limit)
325  {
326  good++;
327  }
328  else
329  {
330  oc = oldColor;
331  setColor(YELLOW);
332  st_report("Rejecting scan %.2f for being too noisy", p->scan);
333  setColor(oc);
334 
336 
337  continue;
338  }
339  }
340  else
341  {
342  good++;
343  }
344 
346  {
347  if(fabs(F0-env->gaussCenter) < env->focus_center_diff)
348  {
349  good++;
350  }
351  else
352  {
353  oc = oldColor;
354  setColor(YELLOW);
355  st_report("Rejecting scan %.2f for Fit being too diff", p->scan);
356  setColor(oc);
357 
359 
360  continue;
361  }
362  }
363  else
364  {
365  good++;
366  }
367 
368  if(good == 3)
369  {
370  e->scan = (float)p->scan;
371  e->freq = (float)p->restfreq / 1000.0;
372  e->el = (float)p->el;
373 
374  if(isSet(PF_N_FLAG)) /* Load NSFC insteads */
375  {
376  e->F0 = (float)p->focusv;
377  }
378  else
379  {
380  e->F0 = (float)p->focusr;
381  }
382  e->fit = (float)env->gaussCenter;
383  e->peak = (float)env->gaussPeak;
384  e->hp = (float)env->gaussHP;
385  e->cnterr = (float)cnterr;
386  e->tamb = (float)p->tamb;
387 
388  j++;
389 
390  if(j >= MAX_FOCUS_HISTORY)
391  {
392  st_report("Max Num of Focuses, %d, Loaded", MAX_FOCUS_HISTORY);
393 
394  break;
395  }
396 
397  e++;
398  }
399 
400  if(notSet(PF_X_FLAG)) /* if /x flag set don't show the plot; goes faster on remote screens */
401  {
402  if(env->xdelay)
403  {
404  usleep(env->xdelay);
405  }
406  else
407  {
408  usleep(100000);
409  }
410  }
411  }
412  }
413 
414  env->last_scan_count = j;
415 
416  focus_send.nfocs = j;
417 
418  dofocusSort();
419 
420  st_report("findLoadFocuses(): Wrote %d records to: focus_send", j);
421 
422  sprintf(focus_send.blabels[0], "Focus Results: %d Scans", focus_send.nfocs);
423  sprintf(focus_send.blabels[1], "Scans: %.2f to %.2f",
424  focus_send.focuses[0].scan,
426 
427  return(0);
428 }
429 
430 
431 
433 {
434  int i, k, n;
435  float *f;
436  char tbuf[256], cmdBuf[512];
437  char formulaBuf[256], form[256];
438  double xd[MAX_FOCUS_HISTORY], yd[MAX_FOCUS_HISTORY], coeff[32], avg;
439  struct FOCUS_HISTORY_SEND *foc;
440  struct FOCUS_HISTORY_ELEM *e;
441 
442  st_report("doFocusGracefit(): Fitting a %d order LSQ to Loaded Focus Scans", env->nfit);
443 
444  if(focus_send.nfocs < 5)
445  {
446  st_fail("Little or No Focus Scans Loaded");
447  return(1);
448  }
449 
450  bzero((char *)xd, sizeof(xd));
451  bzero((char *)yd, sizeof(yd));
452  bzero((char *)coeff, sizeof(coeff));
453 
454 
455  if(env->nfit == 0)
456  {
457  foc = &focus_send;
458  e = &foc->focuses[0];
459 
460  n = foc->nfocs;
461 
462  avg = 0.0;
463 
464  for(i=0;i<n;i++,e++)
465  {
466  avg += e->fit;
467  }
468 
469  avg /= (double)n;
470 
471  st_report("doFocusGracefit(): AVERAGE: %f", avg);
472 
473  f = &foc->bplot[0];
474  for(i=0;i<n;i++,f++)
475  {
476  *f = avg;
477  }
478 
479  sprintf(focus_send.blabels[2], "Focus Fit: Average: %f", avg);
480 
481  foc->bfit = n;
482  }
483  else
484  if(env->nfit > 0 && env->nfit < MAX_NFIT)
485  {
486  foc = &focus_send;
487  e = &foc->focuses[0];
488 
489  n = foc->nfocs;
490 
491  for(i=0;i<n;i++,e++)
492  {
493  if(foc->sort_order == FOCUS_SORTED_SCAN)
494  {
495  xd[i] = e->scan;
496  }
497  else
498  if(foc->sort_order == FOCUS_SORTED_ELEV)
499  {
500  xd[i] = e->el;
501  }
502  else
503  {
504  xd[i] = e->tamb;
505  }
506 
507  yd[i] = e->fit;
508  }
509 
510  fitcurve(xd, yd, n, env->nfit, coeff);
511 
512  st_print("Linuxpops(C) >> # ");
513 
514  for(k=0;k<env->nfit+1;k++)
515  {
516  st_print("a%d = %.4e ", k, coeff[k]);
517  }
518  st_print("\n");
519 
520  /* now make a formula based on fit */
521 
522  if(env->nfit < 5)
523  {
524  strcpy(formulaBuf, "(");
525 
526  for(k=0;k<env->nfit+1;k++)
527  {
528  switch(k)
529  {
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;
535  }
536 
537  strcat(formulaBuf, form);
538  }
539 
540  strcat(formulaBuf, ")");
541 
542  st_report("Formula: %s", formulaBuf);
543 
544  if(isSet(PF_A_FLAG)) /* auto flag; save to 'nfit' formula slot */
545  {
546  sprintf(cmdBuf, "formula /d /%d %s", env->nfit, formulaBuf);
547  parseCmd(cmdBuf);
548  }
549  }
550 
551  f = &foc->bplot[0];
552  e = &foc->focuses[0];
553 
554  for(i=0;i<n;i++,e++,f++)
555  {
556  if(foc->sort_order == FOCUS_SORTED_SCAN)
557  {
558  *f = (float)leasev(coeff, env->nfit, e->scan);
559  }
560  else
561  if(foc->sort_order == FOCUS_SORTED_ELEV)
562  {
563  *f = (float)leasev(coeff, env->nfit, e->el);
564  }
565  else
566  {
567  *f = (float)leasev(coeff, env->nfit, e->tamb);
568  }
569  }
570 
571  if(env->nfit < 12) /* any more and it won't fit in the blabel */
572  {
573  sprintf(focus_send.blabels[2], "Focus Fit: ");
574 
575  for(k=0;k<env->nfit+1;k++)
576  {
577  sprintf(tbuf, "a%d = %.4e ", k, coeff[k]);
578 
579  strcat(focus_send.blabels[2], tbuf);
580  }
581  }
582  else
583  {
584  strcpy(focus_send.blabels[2], "");
585  }
586 
587  foc->bfit = n;
588  }
589  else
590  {
591  st_fail("doFocusGracefit(): Error: nfit out of range: %d, [0 - %d]", env->nfit, MAX_NFIT-1);
592  return(1);
593  }
594 
595  return(0);
596 }
597 
598 
600 {
601  st_print("\n");
602  st_print("Num Source Scan Freq Elev Peak F0 Fit Diff Center-Err Tamb Scaling\n");
603  st_print("\n");
604 
605  return(0);
606 }
607 
608 
610 {
611  int i, n;
612  char tbuf[512];
613  struct FOCUS_HISTORY_ELEM *p;
614 
615  n = focus_send.nfocs;
616 
617  if(!n)
618  {
619  st_fail("No Focus Scans Loaded yet");
620  return(1);
621  }
622 
623 
624  p = &focus_send.focuses[0];
625 
626  for(i=0;i<n;i++,p++)
627  {
628  if(!(i%30))
629  {
631  }
632 
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",
634  i,
635  p->source,
636  p->scan,
637  p->freq,
638  p->el,
639  p->peak,
640  p->F0,
641  p->fit,
642  p->F0-p->fit,
643  p->cnterr,
644  p->tamb,
645  p->scaling);
646 
647  st_print("%s\n", tbuf);
648  }
649 
650  return(0);
651 }
652 
653 
655 {
656  int i;
657  struct HEADER *p;
658 
659  resetRejections();
660  env->last_scan_count = 0;
661 
662  bzero((char *)&focus_send, sizeof(focus_send));
663  strcpy(focus_send.magic, "FOCUS_SEND");
664 
665  st_print("%s\n\n", listHeader);
666 
667  p = &sa[0];
668  for(i=0;i<env->numofscans;i++,p++)
669  { /* If we want to auto reduce tips */
670  if(!meetsCritiria(p, CHECK_ALL))
671  {
672  continue;
673  }
674 
675  if(strncmp(p->obsmode, "CONTFOC", 7) && strncmp(p->obsmode, "CONTNSFC", 8) )
676  {
678  continue;
679  }
680 
681  if(isScanIgnored(p->scan))
682  {
684  continue;
685  }
686 
687  /* Check if tsys is bad */
688  if((env->tsyslimit && (fabs(p->stsys) > env->tsyslimit)) || gsl_isnan(p->stsys))
689  {
690  printf("Scan %.2f Tsys Greater then %.1f: %.1f\n", p->scan, env->tsyslimit, p->stsys);
692 
693  continue;
694  }
695 
696  printScan(p, 0);
697  env->last_scan_count++;
698  }
699 
700  st_report("Found %d Focus scans meeting criteria", env->last_scan_count);
701 
702  return(0);
703 }
704 
705 
706 
708 {
709  int i, n;
710  char cmdBuf[256];
711  struct FORMULA *f;
712  struct FOCUS_HISTORY_ELEM *p;
713 
714  n = getNumericFlag();
715 
716  if(n<0)
717  {
718  st_fail("No numeric flag passed to 'focus /c'");
719  return(0);
720  }
721 
722  sprintf(cmdBuf, "double tmp");
723  parseCmd(cmdBuf);
724 
725  f = &formulas.formulas[n];
726 
727  if(f->used) /* There is a formula here; create a scaling factor for each element */
728  {
729  n = focus_send.nfocs;
730 
731  if(!n)
732  {
733  st_fail("No Focus Scans Loaded yet");
734  return(1);
735  }
736 
737  p = &focus_send.focuses[0];
738 
739  /* Here comes the fun part; in order for the parse to properly
740  substitute header variables in it's normal functions, we need
741  to re-fetch each scan so the header is properly populated */
742  for(i=0;i<n;i++,p++)
743  {
744  sprintf(cmdBuf, "get %.2f /q", p->scan);
745  parseCmd(cmdBuf);
746 
747  sprintf(cmdBuf, "tmp = %s /q", f->formula);
748  parseCmd(cmdBuf);
749 
750  p->scaling = env->rst;
751  }
752  }
753  else
754  {
755  st_report("Formula %d, not defined; removing correction", n);
757  }
758 
759  if(isSet(PF_ADD_FLAG))
760  {
762  }
763  else
764  if(isSet(PF_SUB_FLAG))
765  {
767  }
768  else
769  if(isSet(PF_MUL_FLAG))
770  {
772  }
773  else
774  if(isSet(PF_DIV_FLAG))
775  {
777  }
778  else
779  {
780  st_report("No Function Flag; removing correction");
782  }
783 
784  sendFocus();
785 
786  return(0);
787 }
788 
789 
790 
791 int doFocus()
792 {
793  if(isSet(PF_R_FLAG)) /* Read them In and Analize */
794  {
795  st_report("doFocus(): Reading in Focus Scans");
796 
797  findLoadFocuses();
798 
799  sendFocus();
800 
801  return(0);
802  }
803 
804  if(isSet(PF_C_FLAG))
805  {
806  return(doFocusScaling());
807  }
808 
809  /* the '/n' is used in the '/r' function above, but there
810  is a return so this flag does double duty */
811 
812  if(isSet(PF_N_FLAG)) /* Suppress Lines */
813  {
815  }
816  else
817  {
819  }
820 
821  if(isSet(PF_F_FLAG)) /* Find and List */
822  {
823  st_report("doFocus(): Listing Available Focus Scans in file");
824 
825  listFileFocuses();
826 
827  return(0);
828  }
829 
830  if(isSet(PF_L_FLAG)) /* List */
831  {
832  st_report("doFocus(): Listing Loaded Focus Scans");
833 
835 
836  return(0);
837  }
838 
839  if(isSet(PF_S_FLAG)) /* Sort */
840  {
841  dofocusSort();
842  sendFocus();
843 
844  return(0);
845  }
846 
847  if(isSet(PF_G_FLAG) == 1) /* Fit a Guassian */
848  {
849  doFocusGracefit();
850  sendFocus();
851 
852  return(0);
853  }
854 
855  if(isSet(PF_G_FLAG) == 2) /* Erase any Guassian */
856  {
857  focus_send.bfit = 0;
858  bzero((char *)&focus_send.blabels[0], sizeof(focus_send.blabels));
859 
860  sendFocus();
861 
862  return(0);
863  }
864 
865  if(isSet(PF_D_FLAG)) /* Re-Display Results */
866  {
867  sendFocus();
868  }
869 
870  if(isSet(PF_M_FLAG))
871  {
872  sendFocus(); /* Force a repaint first */
873 
874  getLabelPos("Click Mouse to Place Labels");
875 
878 
879  sendFocus();
880 
881  return(0);
882  }
883 
884  /* Default */
885  sendFocus();
886 
887  return(0);
888 }
struct SOCK * xgraphic
Definition: linuxpops.c:75
float yplot1[MAX_CHANS]
Definition: image.h:110
struct LP_IMAGE_INFO * h0
Definition: image.c:74
double scan
Definition: header.h:35
double curScan
Definition: env.h:178
#define FOCUS_SORTED_ELEV
Definition: focus.h:9
#define YELLOW
Definition: colors.h:7
int listLoadedFocuses()
Definition: focus.c:609
int sock_write(struct SOCK *s, char *message, int l)
int focus_axis
Definition: focus.c:62
char * strcmprs(char *str)
int incrementBogusTsys(void)
Definition: reject.c:217
Definition: parse.h:8
int incrementBogusData(void)
Definition: reject.c:209
double last_mouse_x
Definition: env.c:82
#define MODE_LINES
Definition: object.h:20
#define FOCUS_SCALE_MULTI
Definition: focus.h:15
Definition: formula.h:7
int focusSortEl(struct FOCUS_HISTORY_ELEM *p1, struct FOCUS_HISTORY_ELEM *p2)
Definition: focus.c:90
int read_scan()
int getNumericFlag()
Definition: parse.c:196
int sendFocus()
Definition: focus.c:64
#define FOCUS_AXIS_NS
Definition: focus.h:19
Definition: header.h:13
int isInterrupt()
Definition: interrupt.c:152
double focus_cnterr_limit
Definition: env.h:303
#define MODE_NOLINES
Definition: object.h:19
int doFocusScaling()
Definition: focus.c:707
int xdelay
Definition: env.h:144
float cnterr
Definition: focus.h:33
double focus_freq_upper
Definition: env.h:305
float scaling
Definition: focus.h:36
struct HEADER * sa
Definition: linuxpops.c:72
#define FOCUS_SORTED_SCAN
Definition: focus.h:8
int used
Definition: formula.h:8
int focusSortTemp(struct FOCUS_HISTORY_ELEM *p1, struct FOCUS_HISTORY_ELEM *p2)
Definition: focus.c:109
#define FOCUS_SCALE_SUB
Definition: focus.h:14
int incrementRejIgnored(void)
Definition: reject.c:169
#define FOCUS_AXIS_AX
Definition: focus.h:18
double ylabel
Definition: focus.h:53
int findLoadFocuses()
Definition: focus.c:175
double focus_freq_lower
Definition: env.h:306
struct FOCUS_HISTORY_SEND focus_send
Definition: focus.c:60
int clearInterrupt()
Definition: interrupt.c:144
int notSet(int flag)
Definition: parse.c:669
int last_scan_count
Definition: env.h:66
struct ENVIRONMENT * env
Definition: linuxpops.c:71
int nfit
Definition: env.h:81
int doFocus()
Definition: focus.c:791
char blabels[MAX_FOCUS_LABELS][256]
Definition: focus.h:55
int listFileFocuses()
Definition: focus.c:654
int isSet(int flag)
Definition: parse.c:646
int doFocusGracefit()
Definition: focus.c:432
struct HEADER head
Definition: image.h:104
#define MAX_FOCUS_HISTORY
Definition: focus.h:4
double last_mouse_y
Definition: env.c:84
int resetRejections(void)
Definition: reject.c:233
char * listHeader
Definition: strings.c:130
int fitcurve(double *x, double *y, int n, int ideg, double *coeff)
Definition: grace_fit.c:239
#define MAX_NFIT
Definition: accum.h:6
char obsmode[8]
Definition: header.h:41
double xlabel
Definition: focus.h:52
double leasev(double *c, int degree, double x)
Definition: grace_fit.c:210
void st_fail()
double gaussPeak
Definition: env.h:199
double focus_lower_limit
Definition: env.h:302
int meetsCritiria(struct HEADER *p, int mask)
Definition: observe.c:90
double gaussCenter
Definition: env.h:200
int getLabelPos(char *msg)
Definition: object.c:805
double stsys
Definition: header.h:203
#define FOCUS_SORTED_TAMB
Definition: focus.h:10
int isScanIgnored(double scan)
Definition: ignore.c:181
int oldColor
Definition: parse.c:82
double focusr
Definition: header.h:54
int plotwin
Definition: env.h:129
int setColor(int c)
Definition: parse.c:2644
float bplot[MAX_FOCUS_HISTORY]
Definition: focus.h:57
#define FOCUS_AXIS_EW
Definition: focus.h:20
double cnterr
Definition: gaussfit.c:16
int incrementRejMode(void)
Definition: reject.c:162
void st_report()
#define FOCUS_SCALE_NONE
Definition: focus.h:12
double el
Definition: header.h:83
int printScan(struct HEADER *p, int nsave)
Definition: linuxpops.c:725
int showScan()
Definition: observe.c:1205
double rst
Definition: env.h:263
double gaussHP
Definition: env.h:201
struct FORMULA formulas[MAX_FORMULAS]
Definition: formula.h:18
#define FOCUS_SCALE_DIVIDE
Definition: focus.h:16
int numofscans
Definition: env.h:85
double focus_center_diff
Definition: env.h:308
struct FORMULAS formulas
Definition: formula.c:60
char formula[MAX_FORMULA_LEN]
Definition: formula.h:11
#define FOCUS_SCALE_ADD
Definition: focus.h:13
double avg
Definition: beam.h:5
#define CHECK_ALL
Definition: defines.h:64
double tamb
Definition: header.h:91
int focusSortScan(struct FOCUS_HISTORY_ELEM *p1, struct FOCUS_HISTORY_ELEM *p2)
Definition: focus.c:128
int printFocusHeader()
Definition: focus.c:599
int dofocusSort()
Definition: focus.c:147
void st_print()
char magic[16]
Definition: focus.h:41
int incrementRejFreq(void)
Definition: reject.c:146
double focusv
Definition: header.h:55
char object[16]
Definition: header.h:40
double restfreq
Definition: header.h:198
int parseCmd(char *buf)
Definition: parse.c:2090
char source[32]
Definition: focus.h:23
struct FOCUS_HISTORY_ELEM focuses[MAX_FOCUS_HISTORY]
Definition: focus.h:59
char filename[256]
Definition: env.h:9
double tsyslimit
Definition: env.h:275