aboutsummaryrefslogtreecommitdiff
path: root/noao/astcat/src/attools/atstat.x
blob: 7deb2e87233a163fc7d18e656851361c25c14563 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
include "../../lib/astromdef.h"
include "../../lib/astrom.h"
include "../../lib/aimparsdef.h"
include "../../lib/aimpars.h"


# AT_STATI -- Get the value of an astrom integer parameter.

int procedure at_stati (at, parameter)

pointer at                      #I the pointer to the main astrom structure
int     parameter               #I the parameter to be set

pointer fcp, fsp, wcp
string	iestring "T_STATI: Cannot fetch undefined integer parameter"

begin
	fcp = AT_PRCENTER(at)
	fsp = AT_PFILTER(at)
	wcp = AT_PWCS(at)

	switch (parameter) {

	case RCRAUNITS:
	    if (fcp == NULL)
	        call error (0, iestring)
	    else
	        return (AT_RCRAUNITS(fcp))
	case RCDECUNITS:
	    if (fcp == NULL)
	        call error (0, iestring)
	    else
	        return (AT_RCDECUNITS(fcp))

	case FREVERSE:
	    if (fsp == NULL)
	        call error (0, iestring)
	    else
	        return (AT_FREVERSE(fsp))
	case FREPLACE:
	    if (fsp == NULL)
	        call error (0, iestring)
	    else
	        return (AT_FREPLACE(fsp))
	case FORAUNITS:
	    if (fsp == NULL)
	        call error (0, iestring)
	    else
	        return (AT_FORAUNITS(fsp))
	case FODECUNITS:
	    if (fsp == NULL)
	        call error (0, iestring)
	    else
	        return (AT_FODECUNITS(fsp))

	case WRAUNITS:
	    if (wcp == NULL)
	        call error (0, iestring)
	    else
	        return (AT_WRAUNITS(wcp))
	case WDECUNITS:
	    if (wcp == NULL)
	        call error (0, iestring)
	    else
	        return (AT_WDECUNITS(wcp))

	default:
	    call error (0, "AT_STATI: Cannot fetch unknown integer parameter")
	}
end


# AT_STATP -- Get the value of an astrom pointer parameter.

pointer procedure at_statp (at, parameter)

pointer at                      #I the pointer to the main astrom structure
int     parameter               #I the parameter to be set

pointer fcp, fsp, wcp, ipp
string	pestring "AT_STATP: Cannot fetch undefined pointer parameter"

begin
	fcp = AT_PRCENTER(at)
	fsp = AT_PFILTER(at)
	wcp = AT_PWCS(at)
	ipp = AT_PIMPARS(at)

	switch (parameter) {

	case PIO:
	    return (AT_PIO(at))
	case PRCENTER:
	    return (AT_PRCENTER(at))
	case PFILTER:
	    return (AT_PFILTER(at))
	case PWCS:
	    return (AT_PWCS(at))
	case PIMPARS:
	    return (AT_PIMPARS(at))

	#case RCCC:
	    #return (AT_RCCC(fcp))
	case RCST:
	    if (fcp == NULL)
	        call error (0, pestring)
	    else
	        return (AT_RCST(fcp))

	case WCST:
	    if (wcp == NULL)
		call error (0, pestring)
	    else
		return (AT_WCST(wcp))

	case IMST:
	    if (ipp == NULL)
		call error (0, pestring)
	    else
		return (AT_IMST(ipp))

	default:
	    call error (0,  pestring)
	}
end


# AT_STATR -- Get the value of an astrom real parameter.

real procedure at_statr (at, parameter)

pointer at                      #I the pointer to the main astrom structure
int     parameter               #I the parameter to be set

pointer fcp, ipp
string	restring "AT_STATR: Cannot fetch undefined real parameter"

begin
	fcp = AT_PRCENTER(at)
	ipp = AT_PIMPARS(at)

	switch (parameter) {

	case ESITEALT:
	    if (ipp == NULL)
		call error (0, restring)
	    else
		return (AT_ESITEALT(ipp))
	case ESITETZ:
	    if (ipp == NULL)
		call error (0, restring)
	    else
		return (AT_ESITETZ(ipp))
	#case EXPOSURE:
	    #if (ipp == NULL)
		#call error (0,
		    #"AT_STATR: Cannot fetch undefined real parameter")
	    #else
		#return (AT_EXPOSURE(ipp))
	case EDATAMIN:
	    if (ipp == NULL)
		call error (0, restring)
	    else
		return (AT_EDATAMIN(ipp))
	case EDATAMAX:
	    if (ipp == NULL)
		call error (0, restring)
	    else
		return (AT_EDATAMAX(ipp))
	case EGAIN:
	    if (ipp == NULL)
		call error (0, restring)
	    else
		return (AT_EGAIN(ipp))
	case ERDNOISE:
	    if (ipp == NULL)
		call error (0, restring)
	    else
		return (AT_ERDNOISE(ipp))
	case EWAVLEN:
	    if (ipp == NULL)
		call error (0, restring)
	    else
		return (AT_EWAVLEN(ipp))
	case ETEMP:
	    if (ipp == NULL)
		call error (0, restring)
	    else
		return (AT_ETEMP(ipp))
	case EPRESS:
	    if (ipp == NULL)
		call error (0, restring)
	    else
		return (AT_EPRESS(ipp))

	default:
	    call error (0, restring)
	}
end


# AT_STATD -- Get the value of an astrom double parameter.

double procedure at_statd (at, parameter)

pointer at                      #I the pointer to the main astrom structure
int     parameter               #I the parameter to be set

pointer fcp, wcp, ipp
string	destring "AT_STATD: Cannot fetch undefined double parameter"

begin
	fcp = AT_PRCENTER(at)
	wcp = AT_PWCS(at)
	ipp = AT_PIMPARS(at)

	switch (parameter) {

	case RCRA:
	    if (fcp == NULL)
	        call error (0, destring)
	    else
	        return (AT_RCRA(fcp))
	case RCDEC:
	    if (fcp == NULL)
	        call error (0, destring)
	    else
	        return (AT_RCDEC(fcp))
	case RCRAWIDTH:
	    if (fcp == NULL)
	        call error (0, destring)
	    else
	        return (AT_RCRAWIDTH(fcp))
	case RCDECWIDTH:
	    if (fcp == NULL)
	        call error (0, destring)
	    else
	        return (AT_RCDECWIDTH(fcp))

	case WXREF:
	    if (wcp == NULL)
	        call error (0, destring)
	    else
	        return (AT_WXREF(wcp))
	case WYREF:
	    if (wcp == NULL)
	        call error (0, destring)
	    else
	        return (AT_WYREF(wcp))
	case WXMAG:
	    if (wcp == NULL)
	        call error (0, destring)
	    else
	        return (AT_WXMAG(wcp))
	case WYMAG:
	    if (wcp == NULL)
	        call error (0, destring)
	    else
	        return (AT_WXMAG(wcp))
	case WXROT:
	    if (wcp == NULL)
	        call error (0, destring)
	    else
	        return (AT_WXROT(wcp))
	case WYROT:
	    if (wcp == NULL)
	        call error (0, destring)
	    else
	        return (AT_WYROT(wcp))
	case WRAREF:
	    if (wcp == NULL)
	        call error (0, destring)
	    else
	        return (AT_WRAREF(wcp))
	case WDECREF:
	    if (wcp == NULL)
	        call error (0, destring)
	    else
	        return (AT_WDECREF(wcp))

	case ESITELNG:
	    if (ipp == NULL)
	        call error (0, destring)
	    else
	        return (AT_ESITELNG(ipp))
	case ESITELAT:
	    if (ipp == NULL)
	        call error (0, destring)
	    else
	        return (AT_ESITELAT(ipp))
	case EMJDOBS:
	    if (ipp == NULL)
	        call error (0, destring)
	    else
	        return (AT_EMJDOBS(ipp))

	default:
	    call error (0, destring)
	}
end


# AT_STATS -- Get the value of an astrom string parameter.

procedure at_stats (at, parameter, value, maxch)

pointer at                      #I the pointer to the main astrom structure
int     parameter               #I the parameter to be set
char    value[ARB]              #O the value of the parameter to be set
int     maxch                   #I the maximum number of characters

pointer	fcp, iop, fsp, wcp, ipp
string sestring "AT_STATS: Cannot fetch undefined string parameter"

begin
	iop = AT_PIO(at)
	fcp = AT_PRCENTER(at)
	fsp = AT_PFILTER(at)
	wcp = AT_PWCS(at)
	ipp = AT_PIMPARS(at)

	switch (parameter) {

	case CATALOGS:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_CATALOGS(iop), value, maxch)
	case SURVEYS:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_SURVEYS(iop), value, maxch)
	case IMAGES:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_IMAGES(iop), value, maxch)
	case INPUT:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_INPUT(iop), value, maxch)
	case OUTPUT:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_OUTPUT(iop), value, maxch)
	case CATNAME:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_CATNAME(iop), value, maxch)
	case SVNAME:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_SVNAME(iop), value, maxch)
	case IMNAME:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_IMNAME(iop), value, maxch)
	case INFNAME:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_INFNAME(iop), value, maxch)
	case OUTFNAME:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_OUTFNAME(iop), value, maxch)
	case CATDB:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_CATDB(iop), value, maxch)
	case IMDB:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_IMDB(iop), value, maxch)

	case RCSYSTEM:
	    if (fcp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_RCSYSTEM(fcp), value, maxch)
	case RCSOURCE:
	    if (fcp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_RCSOURCE(fcp), value, maxch)

	case FSORT:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FSORT(fsp), value, maxch)
	case FOSYSTEM:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FOSYSTEM(fsp), value, maxch)
	case FIRA:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FIRA(fsp), value, maxch)
	case FIDEC:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FIDEC(fsp), value, maxch)
	case FORAFORMAT:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FORAFORMAT(fsp), value, maxch)
	case FODECFORMAT:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FODECFORMAT(fsp), value, maxch)
	case FIXP:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FIXP(fsp), value, maxch)
	case FIYP:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FIYP(fsp), value, maxch)
	case FIXC:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FIXC(fsp), value, maxch)
	case FIYC:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FIYC(fsp), value, maxch)
	case FOXFORMAT:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FOXFORMAT(fsp), value, maxch)
	case FOYFORMAT:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FOYFORMAT(fsp), value, maxch)
	case FIELDS:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FIELDS(fsp), value, maxch)
	case FEXPR:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FEXPR(fsp), value, maxch)
	case FNAMES:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FNAMES(fsp), value, maxch)
	case FNTYPES:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FNTYPES(fsp), value, maxch)
	case FNUNITS:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FNUNITS(fsp), value, maxch)
	case FNFORMATS:
	    if (fsp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_FNFORMATS(fsp), value, maxch)

	case WPROJ:
	    if (wcp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_WPROJ(wcp), value, maxch)
	case WSYSTEM:
	    if (wcp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_WSYSTEM(wcp), value, maxch)

	case OBSERVAT:
	    if (ipp == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (AT_OBSERVAT(ipp), value, maxch)
	default:
	    call error (0, sestring)
	}
end