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
|
include "autoid.h"
define AIDSET "|reflist|refspec|crval|cdelt|crpix|crquad|crsearch|cdsearch\
|cddir|ntarget|nreference|aidord|maxnl|nbins|nneighbors\
|npattern|sigma|nfound|rms|fmatch|ftmatch|minratio|ndmax\
|debug|nbest|wrms|wfmatch|wftmatch|"
# AID_SETS -- Set AID parameters by name.
# If the first word of the value field is "CL" or "ENV" then the second
# word is the CL parameter name or environment variable name to use
# for the value.
procedure aid_sets (aid, param, value)
pointer aid #I AID object
char param[ARB] #I Parameter name
char value[ARB] #I Value
int i, j, strdic(), strncmp(), envfind(), nowhite(), ctoi(), ctor(), ctod()
pointer sp, str
begin
call smark (sp)
call salloc (str, SZ_LINE, TY_CHAR)
i = strdic (param, Memc[str], SZ_LINE, AIDSET)
if (strncmp ("CL ", value, 3) == 0)
call clgstr (value[4], Memc[str], SZ_LINE)
else if (strncmp ("ENV ", value, 4) == 0) {
if (envfind (value[5], Memc[str], SZ_LINE) <= 0)
Memc[str] = EOS
} else
call strcpy (value, Memc[str], SZ_LINE)
j = nowhite (Memc[str], Memc[str], SZ_LINE)
j = 1
switch (i) {
case 1:
call strcpy (Memc[str], AID_REFLIST(aid), AID_SZLINE)
case 2:
call strcpy (Memc[str], AID_REFSPEC(aid), AID_SZLINE)
case 3:
call strcpy (Memc[str], AID_CR(aid), AID_SZLINE)
case 4:
call strcpy (Memc[str], AID_CD(aid), AID_SZLINE)
case 5:
call strcpy (Memc[str], AID_CP(aid), AID_SZLINE)
case 6:
i = ctod (Memc[str], j, AID_CRQUAD(aid))
case 7:
call strcpy (Memc[str], AID_CRS(aid), AID_SZLINE)
case 8:
call strcpy (Memc[str], AID_CDS(aid), AID_SZLINE)
case 9:
AID_CDDIR(aid) = strdic (Memc[str], Memc[str], SZ_LINE, CDDIR)
if (AID_CDDIR(aid) == 0)
AID_CDDIR(aid) = CDUNKNOWN
case 10:
i = ctoi (Memc[str], j, AID_NTMAX(aid))
case 11:
i = ctoi (Memc[str], j, AID_NRMAX(aid))
case 12:
i = ctoi (Memc[str], j, AID_ORD(aid))
call ic_puti (AID_IC1(aid), "order", AID_ORD(aid))
case 13:
i = ctor (Memc[str], j, AID_MAXNL(aid))
case 14:
i = ctoi (Memc[str], j, AID_NB(aid))
case 15:
i = ctoi (Memc[str], j, AID_NN(aid))
case 16:
i = ctoi (Memc[str], j, AID_NP(aid))
case 17:
i = ctor (Memc[str], j, AID_SIG(aid))
case 18:
i = ctoi (Memc[str], j, AID_NFOUND(aid))
case 19:
i = ctor (Memc[str], j, AID_RMSG(aid))
case 20:
i = ctor (Memc[str], j, AID_FMATCHG(aid))
case 21:
i = ctor (Memc[str], j, AID_FTMATCHG(aid))
case 22:
i = ctor (Memc[str], j, AID_MINRATIO(aid))
case 23:
i = ctoi (Memc[str], j, AID_NDMAX(aid))
case 24:
call strcpy (Memc[str], AID_DEBUG(aid,1), AID_SZLINE)
case 25:
i = ctoi (Memc[str], j, AID_NBEST(aid))
case 26:
i = ctor (Memc[str], j, AID_WRMS(aid))
case 27:
i = ctor (Memc[str], j, AID_WFMATCH(aid))
case 28:
i = ctor (Memc[str], j, AID_WFTMATCH(aid))
}
call sfree (sp)
end
# AID_SETI -- Set integer AID parameters.
procedure aid_seti (aid, param, ival)
pointer aid #I AID object
char param[ARB] #I Parameter name
int ival #I Value
pointer sp, str
begin
call smark (sp)
call salloc (str, SZ_FNAME, TY_CHAR)
call sprintf (Memc[str], SZ_FNAME, "%d")
call pargi (ival)
call aid_sets (aid, param, Memc[str])
call sfree (sp)
end
# AID_SETR -- Set real AID parameters.
procedure aid_setr (aid, param, rval)
pointer aid #I AID object
char param[ARB] #I Parameter name
real rval #I Value
pointer sp, str
begin
call smark (sp)
call salloc (str, SZ_FNAME, TY_CHAR)
call sprintf (Memc[str], SZ_FNAME, "%g")
call pargr (rval)
call aid_sets (aid, param, Memc[str])
call sfree (sp)
end
# AID_SETD -- Set double AID parameters.
procedure aid_setd (aid, param, dval)
pointer aid #I AID object
char param[ARB] #I Parameter name
double dval #I Value
pointer sp, str
begin
call smark (sp)
call salloc (str, SZ_FNAME, TY_CHAR)
call sprintf (Memc[str], SZ_FNAME, "%g")
call pargd (dval)
call aid_sets (aid, param, Memc[str])
call sfree (sp)
end
|