Linuxpops  3.01.04
Spectral Anaysis Package for Single Dish Data
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
params.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 
59 #include "extern.h"
60 
62 {
63  int mode;
64  char execbuf[1024], tbuf[256], fbuf[256], gbuf[256];
65 
66  st_report("Reseting env %d parameters", envNumber);
67 
68  /* Save these */
69  mode = env->mode;
70  strcpy(tbuf, env->title);
71  strcpy(fbuf, env->filename);
72  strcpy(gbuf, env->gfilename);
73 
74  sprintf(args->secondArg, "%d", envNumber);
75  clearEnv();
76 
77  clearBadChan();
78 
79  if(strlen(tbuf))
80  {
81  sprintf(execbuf, "title %s", tbuf);
82  parseCmd(execbuf);
83  }
84 
85  if(strlen(fbuf))
86  {
87  sprintf(execbuf, "file %s", fbuf);
88  parseCmd(execbuf);
89  }
90 
91  if(strlen(gbuf))
92  {
93  sprintf(execbuf, "gfile %s", gbuf);
94  parseCmd(execbuf);
95  }
96 
97  env->mode = mode;
98 
99  env->if_feed = 0;
100  env->bkmatch = 0;
101  env->mapbaselines = 4;
102  env->markers = 16;
104  env->dobadchan = 1;
105  env->bscan = 0.0;
106  env->escan = 50000.0;
107  env->cal_scale = 1.0;
108  env->map_angle[0] = 180.0;
109  env->map_angle[1] = 90.0;
110  env->bm_eff[0] = 0.88;
111  env->bm_eff[1] = 0.88;
112  env->bm_eff[2] = 0.88;
113  env->bm_eff[3] = 0.88;
114  env->rejections[0] = 20.0;
115  env->rejections[1] = 20.0;
116  env->rejections[2] = 20.0;
117  env->rejections[3] = 20.0;
118  env->hwdc = 0.9;
119  env->glength = 15;
120 
121  if(mode == MODE_CONT)
122  {
123  env->dfreq = 0.5;
124  }
125  else
126  {
127  env->dfreq = 0.001;
128  }
129 
130  return(0);
131 }
132 
133 
135 {
136  double fr;
137 
138  fr = atof(args->secondArg);
139 
140  if(lp_fcmp(fr, env->bkres, 0.01))
141  {
142  clearBadChan();
143  }
144 
145  env->bkres = fr;
146 
148 
149  return(0);
150 }
151 
152 /* zenity --list --column="Freq" --column="Qty" --multiple --text="Select a Freq" \
153  "230.538" 25 "220.500" 20 "115.270" 35
154  */
155 
156 
158 {
159  int n, rev, ret, nscans;
160  char rst[256], src[256], *cp;
161  static char cmd[8*4096], tbuf[4*4096];
162  double f;
163 
164  st_report("Starting Interactive Source/Freq Selection");
165 
166  rev = isSet(PF_R_FLAG);
167 
168  n = doSummaryOfFreqs2Buf(env->source, tbuf, rev);
169 
170  if(n)
171  {
172  sprintf(cmd, "--list --height=400 --width=400 --column='Source' --column='Freq' --column='Qty' --multiple --print-column='ALL' --text='Select a Source and Freq' %s", tbuf);
173 
174  if(isSet(PF_V_FLAG))
175  {
176  st_print("pickSourceFreq(): %s\n", cmd);
177  }
178 
179  ret = doZenity(cmd, rst);
180 
181  if(strlen(rst) < 8) /* Cancelled */
182  {
183  return(1);
184  }
185 
186  if(!ret)
187  {
188  if(isSet(PF_V_FLAG))
189  {
190  st_print("pickSourceFreq(): Got %s back from doZenity()\n", rst);
191  }
192 
193  for(cp=rst;*cp;cp++)
194  {
195  if(*cp == '|')
196  {
197  *cp = ' ';
198  }
199  }
200 
201  strcmprs(rst);
202 
203  if(isSet(PF_V_FLAG))
204  {
205  st_print("pickSourceFreq(): Results is now: %s\n", rst);
206  }
207 
208  n = sscanf(rst, "%s %lf %d", src, &f, &nscans);
209 
210  if(isSet(PF_V_FLAG))
211  {
212  st_print("pickSourceFreq(): Parsed %d tokens\n", n);
213  }
214 
215  if(n == 3)
216  {
217  if(isSet(PF_V_FLAG))
218  {
219  st_print("pickSourceFreq(): Good Parse\n");
220  }
221 
222  subArgs(2, src);
223  args->ntokens = 2;
224  setSource();
225 
226  subArgs(2, "%f", f);
227  args->ntokens = 2;
228  setFreq();
229  }
230  else
231  {
232  st_print("pickSourceFreq(): Bad Parse\n");
233  }
234  }
235  }
236  else
237  {
238  st_fail("pickSourceFreq(): No Source/Freq's in file");
239  }
240 
241  return(0);
242 }
243 
244 int setFreq()
245 {
246  if(args->ntokens < 2)
247  {
248  pickSourceFreq();
249  }
250  else
251  if(!strncasecmp(args->secondArg, "*", strlen(args->secondArg)))
252  {
253  env->check_freq = 0;
254  env->freq = 0.0;
255  }
256  else
257  {
258  env->freq = atof(args->secondArg);
259  env->check_freq = 1;
260  }
261 
262  return(0);
263 }
264 
265 
266 
267 int setDfreq()
268 {
269  if(!strncasecmp(args->secondArg, "*", strlen(args->secondArg)))
270  {
271  if(env->mode == MODE_CONT)
272  {
273  env->dfreq = 0.5;
274  }
275  else
276  {
277  env->dfreq = 0.001;
278  }
279  }
280  else
281  {
282  env->dfreq = atof(args->secondArg);
283  }
284 
285  return(0);
286 }
287 
288 
289 int setTau0()
290 {
291  if(!strncasecmp(args->secondArg, "*", strlen(args->secondArg)))
292  {
293  env->mantau0 = 0.0;
294  }
295  else
296  {
297  env->mantau0 = atof(args->secondArg);
298  }
299 
300  return(0);
301 }
302 
303 
304 int setPTime()
305 {
306  if(!strncasecmp(args->secondArg, "*", strlen(args->secondArg)))
307  {
308  env->ptime = 0.0;
309  }
310  else
311  {
312  env->ptime = atof(args->secondArg);
313  }
314 
315  return(0);
316 }
317 
318 
319 
320 int setDate()
321 {
322  if(isSet(PF_A_FLAG))
323  {
324  env->date = h0->head.utdate;
325 
326  st_report("Setting date to %.4f from header", env->date);
327 
328  return(0);
329  }
330 
331  if(strlen(args->secondArg))
332  {
333  if(!strncasecmp(args->secondArg, "*", strlen(args->secondArg)))
334  {
335  env->check_date = 0;
336  env->date = 0.0;
337  }
338  else
339  {
340  env->date = atof(args->secondArg);
341  env->check_date = 1;
342  st_report("Setting date to %.4f", env->date);
343  }
344  }
345  else
346  {
347  st_report("Date set to: %.4f", env->date);
348  }
349 
350  return(0);
351 }
352 
353 
355 {
356  env->if_feed = atof(args->secondArg) / 100.0;
358  env->bkres = 0.0;
359 
360  return(0);
361 }
362 
363 
364 int setScale()
365 {
366  if(env->mode == MODE_SPEC)
367  {
368  line_setScale();
369 
370  return(0);
371  }
372  else
373  if(!strncasecmp(args->secondArg, "*", strlen(args->secondArg)))
374  {
375  env->cal_scale = 1.0;
376  }
377  else
378  {
379  env->cal_scale = atof(args->secondArg);
380  }
381 
382  return(0);
383 }
384 
385 
386 int setBscan()
387 {
388  if(!strncasecmp(args->secondArg, "*", strlen(args->secondArg)))
389  {
390  env->check_scans = 0;
391  env->bscan = 0.0;
392  }
393  else
394  {
395  env->bscan = atof(args->secondArg);
396  env->check_scans = 1;
397  }
398 
399  return(0);
400 }
401 
402 
403 int setEscan()
404 {
405  if(!strncasecmp(args->secondArg, "*", strlen(args->secondArg)))
406  {
407  env->check_scans = 0;
408  env->escan = 50000.0;
409  }
410  else
411  {
412  env->escan = atof(args->secondArg);
413  env->check_scans = 1;
414  }
415 
416  return(0);
417 }
418 
419 
421 {
422  int i, nscans=0;
423  char source[64];
424  struct HEADER *p;
425 
426  /* TOMMIE: Not sure why I did this, but it messing up the beff procs */
427 // env->bscan = 0;
428 // env->escan = 50000;
429 
430  if(isSet(PF_A_FLAG))
431  {
432  strncpy(env->source, h0->head.object, 16);
433  env->source[16] = '\0';
434 
435  strcmprs(env->source);
436 
437  st_report("Setting source to %s from header", env->source);
438 
439  return(0);
440  }
441 
442  if(args->ntokens < 2)
443  {
444  pickSourceFreq();
445  }
446  else
447  if(!strncasecmp(args->secondArg, "*", strlen(args->secondArg)))
448  {
449  env->check_source = 0;
450  strcpy(env->source, " ");
451  }
452  else
453  {
454  strcpy(env->source, args->secondArg);
455  env->check_source = 1;
456 
457  if(!env->numofscans) /* No file loaded yet */
458  {
459  st_warn("No Datafile Loaded yet to check for Source %s", env->source);
460  return(0);
461  }
462 
463  p = &sa[0];
464  for(i=0;i<env->numofscans;i++,p++)
465  {
466  strncpy(source, p->object, 16);
467  source[16] = '\0';
468  strcmprs(source);
469 
470  if(!strcasecmp(source, env->source))
471  {
472  nscans++;
473  }
474  }
475 
476  if(nscans)
477  {
478  st_report("Source: %s, Found in %d times in %s", env->source, nscans, env->filename);
479  }
480  else
481  {
482  st_warn("Source: %s, Not Found in %s", env->source, env->filename);
483  }
484  }
485 
486  return(0);
487 }
488 
489 
491 {
492  if(strlen(args->secondArg))
493  {
494  strcpy(env->backend, args->secondArg);
495 
496  env->bkmatch = BKMATCH_NAME; /* Turn off feed checking */
497  env->bkres = 0.0;
498 
499  st_report("Setting Backend Name to %s", env->backend);
500  }
501  else
502  {
503  st_report("Backend Name: %s", env->backend);
504  }
505 
506  return(0);
507 }
508 
510 {
511  double fr;
512 
513  if(args->ntokens == 3)
514  {
515  if(strlen(args->secondArg))
516  {
517  strcpy(env->backend, args->secondArg);
518 
519 
520  st_report("Setting Backend Name to %s", env->backend);
521  }
522 
523  if(strlen(args->thirdArg))
524  {
525  fr = atof(args->thirdArg);
526 
527  if(lp_fcmp(fr, env->bkres, 0.01))
528  {
529  clearBadChan();
530  }
531 
532  env->bkres = fr;
533  st_report("Setting Backend Resolution to %.2f", env->bkres);
534  }
535 
537  }
538  else
539  {
540  printH_FlagHelp("bknameres");
541  }
542 
543  return(0);
544 }
545 
546 
547 
548 
550 {
551  int len;
552 
553  if((len = strlen(args->secondArg)))
554  {
555  if(!strncasecmp(args->secondArg, "none", 4))
556  {
558  st_report("Setting Cal Mode to: %s", calmodeStrs[env->calmode]);
559  }
560  else
561  if(!strncasecmp(args->secondArg, "scale", 5))
562  {
564  st_report("Setting Cal Mode to: %s", calmodeStrs[env->calmode]);
565  }
566  else
567  if(!strncasecmp(args->secondArg, "beam", 4))
568  {
570  st_report("Setting Cal Mode to: %s", calmodeStrs[env->calmode]);
571  }
572  else
573  if(!strncasecmp(args->secondArg, "eff", 3))
574  {
576  st_report("Setting Cal Mode to: %s", calmodeStrs[env->calmode]);
577  }
578  else
579  {
580  st_warn("Unknown Cal Mode %s", args->secondArg);
581  }
582  }
583  else
584  {
585  st_report("Current Cal Mode: %s", calmodeStrs[env->calmode]);
586  }
587 
588  return(0);
589 }
590 
591 
593 {
594  if(env->mode == MODE_CONT)
595  {
596  if(strlen(args->secondArg))
597  {
598  if(!strcmp(args->secondArg, "1"))
599  {
600  env->invert = 1;
601  st_report("Setting Invert to Inverted");
602  }
603  else
604  {
605  env->invert = 0;
606  st_report("Setting Invert to Normal");
607  }
608  }
609  else
610  {
611  if(env->invert)
612  {
613  st_report("Invert is Inverted");
614  }
615  else
616  {
617  st_report("Invert is Normal");
618  }
619  }
620  }
621  else
622  {
623  doSpecInvert();
624  }
625 
626  return(0);
627 }
628 
629 
630 
631 int setSplit()
632 {
633  if(strlen(args->secondArg))
634  {
635  if(!strcmp(args->secondArg, "1"))
636  {
637  env->split_phases = 1;
638  st_report("Setting Split to Active");
639  }
640  else
641  {
642  env->split_phases = 0;
643  st_report("Setting Split to Normal");
644  }
645  }
646  else
647  {
648  if(env->split_phases)
649  {
650  st_report("Split is Active");
651  }
652  else
653  {
654  st_report("Split is Normal");
655  }
656  }
657 
658  return(0);
659 }
660 
661 
663 {
664  st_report("");
665 
666  st_report("Environment Index: %2d", envNumber);
667 
668  if(strlen(env->title) == 0)
669  {
670  st_report("No Title Set");
671  }
672  else
673  {
674  st_report("Title: %24.24s", env->title);
675  }
676 
677  st_report("Mode: %4.4s", modeStrs[env->mode]);
678 
679  if(strlen(env->filename) == 0)
680  {
681  st_report("No Datafile Selected");
682  }
683  else
684  {
685  st_report("Data File: %16.16s", basename(env->filename));
686 
687  if(env->issmt)
688  {
689  st_report("Datafile is type: SMT");
690  }
691  else
692  {
693  st_report("Datafile is type: 12M");
694  }
695  }
696 
697  if(env->mode != MODE_CONT) /* No gains for continuum */
698  {
699  if(strlen(env->gfilename) == 0)
700  {
701  st_report("No Gains Datafile Set");
702  }
703  else
704  {
705  st_report("Gains File: %s", basename(env->gfilename));
706 
707  if(env->issmt)
708  {
709  st_report("Datafile is type: SMT");
710  }
711  else
712  {
713  st_report("Datafile is type: 12M");
714  }
715  }
716  }
717 
718  st_report("Data File Contains Scans: %6d", env->numofscans);
719 
720  st_report("Beginning Scan #: %8.2f", env->bscan);
721  st_report("Ending Scan #: %8.2f", env->escan);
722 
723  if(env->check_freq)
724  {
725  st_report("Frequency to Analyze: %10.6f", env->freq);
726  st_report("Delta Frequency Tol: %10.6f", env->dfreq);
727  }
728  else
729  {
730  st_report("Frequency to Analyze: All");
731  }
732 
733  if(env->check_source)
734  {
735  st_report("Source to Analyze: %13.13s", env->source);
736  }
737  else
738  {
739  st_report("Source to Analyze: All");
740  }
741 
742  if(env->mode == MODE_CONT)
743  {
744  st_report("Calibration Scale: %.3f", env->cal_scale);
745  st_report("Calibration Mode: %9.9s", calmodeStrs[env->calmode]);
746  }
747 
748  if(env->check_date)
749  {
750  st_report("Show Scans Taken on: %.4f", env->date);
751  }
752  else
753  {
754  st_report("Show scans taken on: All");
755  }
756 
757  if(env->tsyslimit > 0.0)
758  {
759  st_report("Show Scans /w Tsys < : %7.1f", env->tsyslimit);
760  }
761 
762  if(env->mode != MODE_CONT)
763  {
764  switch(env->bkmatch)
765  {
766  case BKMATCH_FEED:
767  st_report("Backend Matching: IF#");
768  st_report("IF to Analyze: %.2f", env->if_feed);
769 
770  break;
771 
772  case BKMATCH_RESOLUTION:
773  st_report("Backend Matching: Resolution");
774  st_report("Backend Resolution: %6.3f", env->bkres);
775 
776  break;
777 
778  case BKMATCH_NAME:
779  st_report("Backend Matching: Name");
780  st_report("Backend: %24.24s", env->backend);
781 
782  break;
783 
784  case BKMATCH_NAMERES:
785  st_report("Backend Matching: NameRes");
786  st_report("Backend: %24.24s", env->backend);
787  st_report("Backend Resolution: %6.3f", env->bkres);
788 
789  break;
790  }
791  }
792 
793  if(env->mode == MODE_CONT)
794  {
795  if(env->invert)
796  {
797  st_report("Invert the Phases: Inverted");
798  }
799  else
800  {
801  st_report("Invert the Phases: Normal");
802  }
803 
804  if(env->autotau)
805  {
806  st_report("Auto Application of SPTIP's: True");
807  }
808  else
809  {
810  st_report("Auto Application of SPTIP's: False");
811  }
812 
813  if(env->ons)
814  {
815  st_report("Display 'Ons': True");
816  }
817  else
818  {
819  st_report("Display 'Ons': False");
820  }
821 
822  if(env->split_phases)
823  {
824  st_report("Split Phases: Active");
825  }
826  else
827  {
828  st_report("Split Phases: Normal");
829  }
830 
831  st_report("Planet Flux time: %5.2f", env->ptime);
832  st_report("Current Manual Tau0: %5.3f", env->mantau0);
833  st_report("Last Fitted Tau0: %5.3f", env->fittedtau);
834 
835  st_report("Map Baseline Samples: %d", env->mapbaselines);
836  st_report("Grid Map Angle: %6.1f %6.1f", env->map_angle[0], env->map_angle[1]);
837  }
838  else
839  {
840  tellBaselines();
841  }
842 
843  st_report("Beam Eff's: %.2f %.2f %.2f %.2f", env->bm_eff[0], env->bm_eff[1],
844  env->bm_eff[2], env->bm_eff[3]);
845 
846  st_report("Current Rej: %4.1f %4.1f %4.1f %4.1f", env->rejections[0], env->rejections[1],
847  env->rejections[2], env->rejections[3]);
848 
849  tellIgnored();
850 
851  if(env->mode == MODE_SPEC)
852  {
853  tellBadChan();
854  }
855 
856  st_report("");
857 
858  return(0);
859 }
860 
861 
862 
864 FILE *fp;
865 {
866  int i;
867 
868  fprintf(fp, "switch %d\n", envNumber);
869 
870  if(strlen(env->filename))
871  {
872  fprintf(fp, "file %s\n", env->filename);
873  }
874 
875  if(strlen(env->title))
876  {
877  fprintf(fp, "name %s\n", env->title);
878  }
879 
880  fprintf(fp, "mode %4.4s\n", modeStrs[env->mode]);
881 
882  if(strlen(env->gfilename))
883  {
884  fprintf(fp, "gfile %s\n", env->gfilename);
885  }
886 
887  fprintf(fp, "bscan %8.2f\n", env->bscan);
888  fprintf(fp, "escan %8.2f\n", env->escan);
889 
890  if(env->check_freq)
891  {
892  fprintf(fp, "freq %10.6f\n", env->freq);
893  }
894  else
895  {
896  fprintf(fp, "freq -\n");
897  }
898 
899  fprintf(fp, "delfreq %10.6f\n", env->dfreq);
900 
901  if(env->check_source)
902  {
903  fprintf(fp, "source %s\n", env->source);
904  }
905  else
906  {
907  fprintf(fp, "source -\n");
908  }
909 
910  fprintf(fp, "scale %.3f\n", env->cal_scale);
911 
912  fprintf(fp, "calmode %s\n", calmodeStrs[env->calmode]);
913 
914  if(env->check_date)
915  {
916  fprintf(fp, "date %.4f\n", env->date);
917  }
918  else
919  {
920  fprintf(fp, "date -\n");
921  }
922 
923  fprintf(fp, "invert %d\n", env->invert);
924  fprintf(fp, "split %d\n", env->split_phases );
925  fprintf(fp, "autotau %d\n", env->autotau);
926 
927  fprintf(fp, "ptime %.2f\n", env->ptime);
928  fprintf(fp, "tau0 %.3f\n", env->mantau0);
929 
930  fprintf(fp, "beameff %.3f %.3f %.3f %.3f\n", env->bm_eff[0], env->bm_eff[1],
931  env->bm_eff[2], env->bm_eff[3]);
932 
933  fprintf(fp, "rejection %.3f %.3f %.3f %.3f\n",
934  env->rejections[0], env->rejections[1],
935  env->rejections[2], env->rejections[3]);
936 
937  fprintf(fp, "nbase %d\n", env->mapbaselines);
938  fprintf(fp, "mapangle %f %f\n", env->map_angle[0], env->map_angle[1]);
939 
940  switch(env->bkmatch)
941  {
942  case BKMATCH_FEED:
943  fprintf(fp, "feed %d\n", (int)(env->if_feed * 100.0));
944  break;
945 
946  case BKMATCH_RESOLUTION:
947  fprintf(fp, "bkres %f\n", env->bkres);
948  break;
949 
950  case BKMATCH_NAME:
951  fprintf(fp, "backend %s\n", env->backend);
952  break;
953 
954  case BKMATCH_NAMERES:
955  fprintf(fp, "bknameres %s %f\n", env->backend, env->bkres);
956  break;
957  }
958 
959  /* Ignored Scans */
960  fprintf(fp, "ignore ");
961  for(i=0;i<MAX_IGNORED;i++)
962  {
963  if(env->ignoredscans[i])
964  {
965  fprintf(fp, "%.2f ", env->ignoredscans[i]);
966  }
967  }
968  fprintf(fp, "\n");
969 
970  if(env->x2mode == XMODE_CHAN && env->x1mode == XMODE_CHAN)
971  {
972  fprintf(fp, "cc\n");
973  }
974  else
975  if(env->x2mode == XMODE_CHAN && env->x1mode == XMODE_VEL)
976  {
977  fprintf(fp, "cf\n");
978  }
979  else
980  if(env->x2mode == XMODE_CHAN && env->x1mode == XMODE_FREQ)
981  {
982  fprintf(fp, "cv\n");
983  }
984  else
985  if(env->x2mode == XMODE_FREQ && env->x1mode == XMODE_CHAN)
986  {
987  fprintf(fp, "fc\n");
988  }
989  else
990  if(env->x2mode == XMODE_FREQ && env->x1mode == XMODE_VEL)
991  {
992  fprintf(fp, "fv\n");
993  }
994  else
995  if(env->x2mode == XMODE_FREQ && env->x1mode == XMODE_FREQ)
996  {
997  fprintf(fp, "ff\n");
998  }
999  else
1000  if(env->x2mode == XMODE_VEL && env->x1mode == XMODE_CHAN)
1001  {
1002  fprintf(fp, "vc\n");
1003  }
1004  else
1005  if(env->x2mode == XMODE_VEL && env->x1mode == XMODE_VEL)
1006  {
1007  fprintf(fp, "vv\n");
1008  }
1009  else
1010  if(env->x2mode == XMODE_VEL && env->x1mode == XMODE_FREQ)
1011  {
1012  fprintf(fp, "vf\n");
1013  }
1014 
1016  {
1017  fprintf(fp, "histo\n");
1018  }
1019  else
1021  {
1022  fprintf(fp, "lines\n");
1023  }
1024  else
1026  {
1027  fprintf(fp, "points\n");
1028  }
1029  else
1031  {
1032  fprintf(fp, "linepts\n");
1033  }
1034 
1035  fprintf(fp, "\n");
1036 
1037  return(0);
1038 }
1039 
1040 
1041 
1042 int setMode()
1043 {
1044  int len;
1045 
1046  if((len = strlen(args->secondArg)))
1047  {
1048  if(!strncasecmp(args->secondArg, "cont", 4) || !strncmp(args->secondArg, "1", 1))
1049  {
1050  env->mode = MODE_CONT;
1051  st_report("Setting Mode to: %s", modeStrs[env->mode]);
1052  }
1053  else
1054  if(!strncasecmp(args->secondArg, "spec", 5) || !strncmp(args->secondArg, "2", 1))
1055  {
1056  env->mode = MODE_SPEC;
1057  st_report("Setting Mode to: %s", modeStrs[env->mode]);
1058  }
1059  else
1060  if(!strncasecmp(args->secondArg, "otf", 4) || !strncmp(args->secondArg, "3", 1))
1061  {
1062  env->mode = MODE_OTF;
1063  st_report("Setting Mode to: %s", modeStrs[env->mode]);
1064  }
1065  else
1066  {
1067  st_warn("Unknown Mode %s", args->secondArg);
1068  }
1069  }
1070  else
1071  {
1072  st_report("Current Mode: %s", modeStrs[env->mode]);
1073  }
1074 
1075  return( reloadFile() );
1076 }
struct LP_IMAGE_INFO * h0
Definition: image.c:74
int setDfreq()
Definition: params.c:267
int autotau
Definition: env.h:25
#define BKMATCH_RESOLUTION
Definition: defines.h:122
int setIFfeed()
Definition: params.c:354
int ons
Definition: env.h:87
double dfreq
Definition: env.h:183
char * strcmprs(char *str)
int doBkNameRes()
Definition: params.c:509
#define MODE_OTF
Definition: defines.h:88
int params_writeParams(FILE *fp)
Definition: params.c:863
int doSummaryOfFreqs2Buf()
int resetParams()
Definition: params.c:61
struct PARSE_STACK * args
Definition: parse.h:196
#define CALMODE_TELE_EFF
Definition: defines.h:52
int x1mode
Definition: env.h:145
double cal_scale
Definition: env.h:175
double rejections[MAX_BEAMS]
Definition: env.h:261
double utdate
Definition: header.h:61
Definition: parse.h:8
int setCalMode()
Definition: params.c:549
int lp_fcmp(double first, double second, double delta)
Definition: linuxpops.c:2768
char source[SRCLEN+1]
Definition: dataserv.c:52
int glength
Definition: env.h:57
#define PLOT_STYLE_LINES
Definition: defines.h:101
int check_scans
Definition: env.h:43
double ptime
Definition: env.h:258
int setTau0()
Definition: params.c:289
#define CALMODE_BEAMEFF
Definition: defines.h:51
#define MODE_CONT
Definition: defines.h:86
int invert
Definition: env.h:62
int setScale()
Definition: params.c:364
FILE * fp
Definition: linuxpops.c:70
Definition: header.h:13
int printH_FlagHelp(char *cmd)
Definition: help.c:430
char gfilename[256]
Definition: env.h:10
char title[80]
Definition: env.h:8
int envNumber
Definition: env.c:71
struct HEADER * sa
Definition: linuxpops.c:72
#define BKMATCH_NAME
Definition: defines.h:123
int issmt
Definition: env.h:63
int check_freq
Definition: env.h:42
int setMode()
Definition: params.c:1042
int markers
Definition: env.h:72
#define MAX_IGNORED
Definition: defines.h:39
int nscans
Definition: beam.h:4
int setInvert()
Definition: params.c:592
#define PLOT_STYLE_POINTS
Definition: defines.h:102
double ignoredscans[MAX_IGNORED]
Definition: env.h:209
double date
Definition: env.h:182
int clearEnv()
Definition: env.c:159
int doSpecInvert()
Definition: line.c:1773
#define XMODE_CHAN
Definition: defines.h:97
struct ENVIRONMENT * env
Definition: linuxpops.c:71
char * thirdArg
Definition: parse.h:182
char source[64]
Definition: env.h:11
#define BKMATCH_NAMERES
Definition: defines.h:124
int setSource()
Definition: params.c:420
int check_source
Definition: env.h:44
char * modeStrs[]
Definition: strings.c:90
double hwdc
Definition: env.h:205
int isSet(int flag)
Definition: parse.c:646
int doZenity(char *cmd, char *rst)
Definition: io.c:86
#define PLOT_STYLE_LINEPTS
Definition: defines.h:103
struct HEADER head
Definition: image.h:104
int setDate()
Definition: params.c:320
int tellBadChan()
Definition: badchan.c:351
int reloadFile()
Definition: io.c:392
int setEscan()
Definition: params.c:403
void st_warn()
int setSplit()
Definition: params.c:631
double bkres
Definition: env.h:170
void st_fail()
int strcmp()
int showParams()
Definition: params.c:662
int line_setScale()
Definition: line.c:2198
int setFreq()
Definition: params.c:244
int tellBaselines()
Definition: baseline.c:358
int setFreqRes()
Definition: params.c:134
int doBackEnd()
Definition: params.c:490
#define CALMODE_NONE
Definition: defines.h:49
int dobadchan
Definition: env.h:47
int setBscan()
Definition: params.c:386
int mode
Definition: env.h:75
#define XMODE_FREQ
Definition: defines.h:95
#define MODE_SPEC
Definition: defines.h:87
int split_phases
Definition: env.h:136
void st_report()
#define BKMATCH_FEED
Definition: defines.h:121
double if_feed
Definition: env.h:208
int numofscans
Definition: env.h:85
int mapbaselines
Definition: env.h:71
#define CALMODE_CALSCALE
Definition: defines.h:50
double bscan
Definition: env.h:173
char backend[16]
Definition: env.h:12
double freq
Definition: env.h:197
int bkmatch
Definition: env.h:32
void subArgs(int wt, const char *fmt,...)
Definition: parse.c:430
int clearBadChan()
Definition: badchan.c:396
int plotstyle
Definition: env.h:127
double bm_eff[MAX_BEAMS]
Definition: env.h:171
int setPTime()
Definition: params.c:304
double mantau0
Definition: env.h:224
char * secondArg
Definition: parse.h:181
char * calmodeStrs[]
Definition: strings.c:84
void st_print()
int ntokens
Definition: parse.h:173
double map_angle[2]
Definition: env.h:225
double escan
Definition: env.h:186
int check_date
Definition: env.h:40
#define PLOT_STYLE_HISTO
Definition: defines.h:100
char object[16]
Definition: header.h:40
int parseCmd(char *buf)
Definition: parse.c:2090
#define XMODE_VEL
Definition: defines.h:96
int x2mode
Definition: env.h:146
int pickSourceFreq()
Definition: params.c:157
char filename[256]
Definition: env.h:9
double fittedtau
Definition: env.h:194
double tsyslimit
Definition: env.h:275
int calmode
Definition: env.h:38
int tellIgnored()
Definition: ignore.c:156