aboutsummaryrefslogtreecommitdiff
path: root/noao/astcat/src/attools/atset.x
blob: 882fe13aa1239919c5a96d87ace1341773642c8b (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
507
508
509
include "../../lib/astromdef.h"
include "../../lib/astrom.h"
include "../../lib/aimparsdef.h"
include "../../lib/aimpars.h"

# AT_SETI -- Set the value of an astrom integer parameter.

procedure at_seti (at, parameter, value)

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

pointer	fcp, fsp, wcp
string	iestring "AT_SETI: Cannot set 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
                AT_RCRAUNITS(fcp) = value
        case RCDECUNITS:
	    if (fcp == NULL)
	        call error (0, iestring)
	    else
                AT_RCDECUNITS(fcp) = value


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

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

	default:
	    call error (0, iestring)
	}
end


# AT_SETP -- Set the value of an astrom pointer parameter.

procedure at_setp (at, parameter, value)

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

pointer	fcp, wcp, ipp
string	pestring "AT_SETP: Cannot set undefined pointer parameter"

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

	switch (parameter) {
	case PIO:
	    AT_PIO(at) = value
        case PRCENTER:
            AT_PRCENTER(at) = value
        case PFILTER:
            AT_PFILTER(at) = value
        case PWCS:
            AT_PWCS(at) = value
        case PIMPARS:
            AT_PIMPARS(at) = value

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

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

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

	default:
	    call error (0, pestring)
	}
end


# AT_SETR -- Set the value of an astrom real parameter.

procedure at_setr (at, parameter, value)

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

pointer	fcp, ipp
string	restring "AT_SETR: Cannot set undefined real parameter"	

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

	switch (parameter) {

        case ESITEALT:
	    if (ipp == NULL)
	        call error (0, restring)
	    else
                AT_ESITEALT(ipp) = value
        case ESITETZ:
	    if (ipp == NULL)
	        call error (0, restring)
	    else
                AT_ESITETZ(ipp) = value
        case EDATAMIN:
	    if (ipp == NULL)
	        call error (0, restring)
	    else
                AT_EDATAMIN(ipp) = value
        case EDATAMAX:
	    if (ipp == NULL)
	        call error (0, restring)
	    else
                AT_EDATAMAX(ipp) = value
        case EGAIN:
	    if (ipp == NULL)
	        call error (0, restring)
	    else
                AT_EGAIN(ipp) = value
        case ERDNOISE:
	    if (ipp == NULL)
	        call error (0, restring)
	    else
                AT_ERDNOISE(ipp) = value
        case EWAVLEN:
	    if (ipp == NULL)
	        call error (0, restring)
	    else
                AT_EWAVLEN(ipp) = value
        case ETEMP:
	    if (ipp == NULL)
	        call error (0, restring)
	    else
                AT_ETEMP(ipp) = value
        case EPRESS:
	    if (ipp == NULL)
	        call error (0, restring)
	    else
                AT_EPRESS(ipp) = value

	default:
	    call error (0, restring)
	}
end


# AT_SETD -- Set the value of an astrom double parameter.

procedure at_setd (at, parameter, value)

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

pointer	fcp, wcp, ipp
string	destring "AT_SETD: Cannot set 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
                AT_RCRA(fcp) = value
        case RCDEC:
	    if (fcp == NULL)
	        call error (0, destring)
	    else
                AT_RCDEC(fcp) = value
        case RCRAWIDTH:
	    if (fcp == NULL)
	        call error (0, destring)
	    else
                AT_RCRAWIDTH(fcp) = value
        case RCDECWIDTH:
	    if (fcp == NULL)
	        call error (0, destring)
	    else
                AT_RCDECWIDTH(fcp) = value

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

        case ESITELNG:
	    if (ipp == NULL)
	        call error (0, destring)
	    else
                AT_ESITELNG(ipp) = value
        case ESITELAT:
	    if (ipp == NULL)
	        call error (0, destring)
	    else
                AT_ESITELAT(ipp) = value
        case EMJDOBS:
	    if (ipp == NULL)
	        call error (0, destring)
	    else
                AT_EMJDOBS(ipp) = value
        #case UT:
	    #if (ipp == NULL)
	        #call error (0,
		    #"AT_SETD: Cannot set undefined double parameter")
	    #else
                #AT_UT(ipp) = value

	default:
	    call error (0, destring)
	}
end


# AT_SETS -- Set the value of an astrom string parameter.

procedure at_sets (at, parameter, value)

pointer at                      #I the pointer to the main astrom structure
int     parameter               #I the parameter to be set
char    value[ARB]              #I the value of the parameter to be set

pointer	fcp, iop, fsp, wcp, ipp
string	sestring "AT_SETS: Cannot set 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 (value, AT_CATALOGS(iop), SZ_FNAME)
	case SURVEYS:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (value, AT_SURVEYS(iop), SZ_FNAME)
	case IMAGES:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (value, AT_IMAGES(iop), SZ_FNAME)
	case INPUT:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (value, AT_INPUT(iop), SZ_FNAME)
	case OUTPUT:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (value, AT_OUTPUT(iop), SZ_FNAME)
	case CATNAME:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (value, AT_CATNAME(iop), SZ_FNAME)
	case SVNAME:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (value, AT_SVNAME(iop), SZ_FNAME)
	case IMNAME:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (value, AT_IMNAME(iop), SZ_FNAME)
	case INFNAME:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (value, AT_INFNAME(iop), SZ_FNAME)
	case OUTFNAME:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (value, AT_OUTFNAME(iop), SZ_FNAME)
	case CATDB:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (value, AT_CATDB(iop), SZ_FNAME)
	case IMDB:
	    if (iop == NULL)
	        call error (0, sestring)
	    else
	        call strcpy (value, AT_IMDB(iop), SZ_FNAME)

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


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

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

	case OBSERVAT:
	    if (ipp == NULL)
	        call error (0, sestring)
	    else
		call strcpy (value, AT_OBSERVAT(ipp), SZ_FNAME) 

	default:
	    call error (0, sestring)
	}
end