Linuxpops  3.01.04
Spectral Anaysis Package for Single Dish Data
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
reject.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 
61 /* Revision History:
62  *
63  * Feb 04, 2015: Added Rejection Count sub-system; twf
64  *
65  */
66 
67 struct REJECTIONS {
68  int source;
69  int date;
70  int noint;
71  int freq;
72  int freqres;
73  int bescans;
74  int sb;
75  int bkend;
76  int mode;
77  int ignored;
78  int offset;
79  int ra;
80  int dec;
81  int vel;
85  int fivept;
86 };
88 
89 
91 {
93 
94  return(0);
95 }
96 
97 
99 {
100  rejections.noint++;
101 
102  return(0);
103 }
104 
105 
107 {
108  rejections.offset++;
109 
110  return(0);
111 }
112 
113 
115 {
117 
118  return(0);
119 }
120 
121 
123 {
124  rejections.ra++;
125 
126  return(0);
127 }
128 
129 
131 {
132  rejections.dec++;
133 
134  return(0);
135 }
136 
137 
139 {
140  rejections.sb++;
141 
142  return(0);
143 }
144 
145 
147 {
148  rejections.freq++;
149 
150  return(0);
151 }
152 
153 
155 {
156  rejections.vel++;
157 
158  return(0);
159 }
160 
161 
163 {
164  rejections.mode++;
165 
166  return(0);
167 }
168 
170 {
172 
173  return(0);
174 }
175 
176 
178 {
179  rejections.source++;
180 
181  return(0);
182 }
183 
184 
186 {
188 
189  return(0);
190 }
191 
192 
194 {
195  rejections.date++;
196 
197  return(0);
198 }
199 
200 
202 {
203  rejections.bkend++;
204 
205  return(0);
206 }
207 
208 
210 {
212 
213  return(0);
214 }
215 
216 
218 {
220 
221  return(0);
222 }
223 
224 
226 {
228 
229  return(0);
230 }
231 
232 
234 {
235  bzero((char *)&rejections, sizeof(rejections));
236 
237  return(0);
238 }
239 
240 
242 int n;
243 {
244  if(n)
245  {
246  setColor(RED);
247  }
248  else
249  {
250  setColor(BLACK);
251  }
252 
253  return(n);
254 }
255 
256 
258 {
259  int total;
260 
261  if(rejections.source)
262  {
263  st_report("%5d Scans Rejected for Wrong Source (%s)", setQRcolor(rejections.source), env->source);
264  }
265 
266  if(rejections.ra)
267  {
268  st_report("%5d Scans Rejected for Wrong RA", setQRcolor(rejections.ra));
269  }
270 
271  if(rejections.dec)
272  {
273  st_report("%5d Scans Rejected for Wrong Dec", setQRcolor(rejections.dec));
274  }
275 
276  if(rejections.vel)
277  {
278  st_report("%5d Scans Rejected for Wrong Velocity", setQRcolor(rejections.vel));
279  }
280 
281  if(rejections.noint)
282  {
283  st_report("%5d Scans Rejected for Wrong Noint", setQRcolor(rejections.noint));
284  }
285 
286  if(rejections.date)
287  {
288  st_report("%5d Scans Rejected for Wrong date (%9.4f)", setQRcolor(rejections.date), env->date);
289  }
290 
291  if(rejections.freq)
292  {
293  st_report("%5d Scans Rejected for Wrong Freq (%.6f)", setQRcolor(rejections.freq), env->freq);
294  }
295 
296  if(rejections.freqres)
297  {
298  st_report("%5d Scans Rejected for Wrong Freqres (%.3f)", setQRcolor(rejections.freqres), env->bkres);
299  }
300 
301  if(rejections.sb)
302  {
303  st_report("%5d Scans Rejected for Wrong Sideband", setQRcolor(rejections.sb));
304  }
305 
306  if(rejections.bkend)
307  {
308  st_report("%5d Scans Rejected for Wrong Backend (%s)", setQRcolor(rejections.bkend), env->backend);
309  }
310 
311  if(rejections.mode)
312  {
313  st_report("%5d Scans Rejected for Wrong Mode", setQRcolor(rejections.mode));
314  }
315 
316  if(rejections.offset)
317  {
318  st_report("%5d Scans Rejected for Wrong Map Offset", setQRcolor(rejections.offset));
319  }
320 
321  if(rejections.fivept)
322  {
323  st_report("%5d Scans Rejected for Being FivePt", setQRcolor(rejections.fivept));
324  }
325 
327  {
328  st_report("%5d Scans Rejected for Bogus Data", setQRcolor(rejections.bogus_data));
329  }
330 
332  {
333  st_report("%5d Scans Rejected for Bogus Tsys (> %.1f)", setQRcolor(rejections.bogus_tsys), env->tsyslimit);
334  }
335 
337  {
338  st_report("%5d Scans Rejected for Bogus Tcal (> %.1f)", setQRcolor(rejections.bogus_tcal), env->tcallimit);
339  }
340 
341  if(rejections.bescans)
342  {
343  st_report("%5d Scans Rejected for Out of Scan Range (%.2f - %.2f)",
345  }
346 
347  if(rejections.ignored)
348  {
349  st_report("%5d Scans Rejected for Being Ignored", setQRcolor(rejections.ignored));
350  }
351 
352  setColor(BLACK);
353 
354  total = rejections.source;
355  total += rejections.ra;
356  total += rejections.dec;
357  total += rejections.vel;
358  total += rejections.date;
359  total += rejections.noint;
360  total += rejections.freq;
361  total += rejections.freqres;
362  total += rejections.sb;
363  total += rejections.bkend;
364  total += rejections.mode;
365  total += rejections.offset;
366  total += rejections.bogus_data;
367  total += rejections.bogus_tsys;
368  total += rejections.bogus_tcal;
369 
370  total += rejections.fivept;
371 
372  total += rejections.bescans;
373  total += rejections.ignored;
374 
375  st_report("----------------------------------------------");
376 
377  st_report("%5d Scans out of %d, Rejected", total, env->numofscans);
378  st_report("%5d Scans Accumulated", env->last_scan_count);
379  st_report("%5d Total Accounted For", total+env->last_scan_count);
380 
381  return(0);
382 }
383 
int noint
Definition: reject.c:70
int incrementBogusTsys(void)
Definition: reject.c:217
int incrementBogusData(void)
Definition: reject.c:209
int freqres
Definition: reject.c:72
int bescans
Definition: reject.c:73
int ra
Definition: reject.c:79
int freq
Definition: reject.c:71
#define RED
Definition: colors.h:5
int vel
Definition: reject.c:81
double tcallimit
Definition: env.h:270
int setQRcolor(int n)
Definition: reject.c:241
int incrementRejSb(void)
Definition: reject.c:138
int mode
Definition: reject.c:76
int incrementRejIgnored(void)
Definition: reject.c:169
struct REJECTIONS rejections
Definition: reject.c:87
double date
Definition: env.h:182
int last_scan_count
Definition: env.h:66
struct ENVIRONMENT * env
Definition: linuxpops.c:71
char source[64]
Definition: env.h:11
int bogus_data
Definition: reject.c:82
int incrementRejDates(void)
Definition: reject.c:193
int resetRejections(void)
Definition: reject.c:233
int incrementRejNoint(void)
Definition: reject.c:98
int bkend
Definition: reject.c:75
int incrementRejDec(void)
Definition: reject.c:130
int printRejections(void)
Definition: reject.c:257
double bkres
Definition: env.h:170
int incrementRejOffsets(void)
Definition: reject.c:106
int incrementBogusTcal(void)
Definition: reject.c:225
int dec
Definition: reject.c:80
int bogus_tcal
Definition: reject.c:83
int offset
Definition: reject.c:78
int setColor(int c)
Definition: parse.c:2644
int incrementRejMode(void)
Definition: reject.c:162
void st_report()
int numofscans
Definition: env.h:85
int incrementRejFive(void)
Definition: reject.c:90
double bscan
Definition: env.h:173
char backend[16]
Definition: env.h:12
int sb
Definition: reject.c:74
double freq
Definition: env.h:197
#define BLACK
Definition: colors.h:4
int incrementRejSource(void)
Definition: reject.c:177
int bogus_tsys
Definition: reject.c:84
int incrementRejScans(void)
Definition: reject.c:185
int incrementRejRa(void)
Definition: reject.c:122
int ignored
Definition: reject.c:77
double escan
Definition: env.h:186
int incrementRejFreq(void)
Definition: reject.c:146
int date
Definition: reject.c:69
int incrementRejBackend(void)
Definition: reject.c:201
int incrementRejFreqres(void)
Definition: reject.c:114
int source
Definition: reject.c:68
int fivept
Definition: reject.c:85
double tsyslimit
Definition: env.h:275
int incrementRejVel(void)
Definition: reject.c:154