1 /* zzvalcor.f -- translated by f2c (version 19980913).
2 You must link the resulting object file with the libraries:
3 -lf2c -lm (in that order)
4 */
5
6 #include "f2c.h"
7
8 /* $Procedure ZZVALCOR ( Validate aberration correction ) */
zzvalcor_(char * abcorr,logical * attblk,ftnlen abcorr_len)9 /* Subroutine */ int zzvalcor_(char *abcorr, logical *attblk, ftnlen
10 abcorr_len)
11 {
12 extern /* Subroutine */ int zzprscor_(char *, logical *, ftnlen), chkin_(
13 char *, ftnlen), errch_(char *, char *, ftnlen, ftnlen);
14 extern logical failed_(void);
15 extern /* Subroutine */ int sigerr_(char *, ftnlen), chkout_(char *,
16 ftnlen), setmsg_(char *, ftnlen);
17 extern logical return_(void);
18
19 /* $ Abstract */
20
21 /* SPICE Private routine intended solely for the support of SPICE */
22 /* routines. Users should not call this routine directly due */
23 /* to the volatile nature of this routine. */
24
25 /* Validate an aberration correction string suitable for use by */
26 /* the SPK system; return attributes. */
27
28 /* $ Disclaimer */
29
30 /* THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
31 /* CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
32 /* GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
33 /* ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
34 /* PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
35 /* TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
36 /* WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
37 /* PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
38 /* SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
39 /* SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
40
41 /* IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
42 /* BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
43 /* LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
44 /* INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
45 /* REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
46 /* REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
47
48 /* RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
49 /* THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
50 /* CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
51 /* ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
52
53 /* $ Required_Reading */
54
55 /* None. */
56
57 /* $ Keywords */
58
59 /* ABERRATION */
60 /* PARSING */
61 /* PRIVATE */
62 /* UTILITY */
63
64 /* $ Declarations */
65 /* $ Abstract */
66
67 /* Include file zzabcorr.inc */
68
69 /* SPICE private file intended solely for the support of SPICE */
70 /* routines. Users should not include this file directly due */
71 /* to the volatile nature of this file */
72
73 /* The parameters below define the structure of an aberration */
74 /* correction attribute block. */
75
76 /* $ Disclaimer */
77
78 /* THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
79 /* CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
80 /* GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
81 /* ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
82 /* PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
83 /* TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
84 /* WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
85 /* PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
86 /* SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
87 /* SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
88
89 /* IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
90 /* BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
91 /* LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
92 /* INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
93 /* REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
94 /* REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
95
96 /* RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
97 /* THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
98 /* CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
99 /* ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
100
101 /* $ Parameters */
102
103 /* An aberration correction attribute block is an array of logical */
104 /* flags indicating the attributes of the aberration correction */
105 /* specified by an aberration correction string. The attributes */
106 /* are: */
107
108 /* - Is the correction "geometric"? */
109
110 /* - Is light time correction indicated? */
111
112 /* - Is stellar aberration correction indicated? */
113
114 /* - Is the light time correction of the "converged */
115 /* Newtonian" variety? */
116
117 /* - Is the correction for the transmission case? */
118
119 /* - Is the correction relativistic? */
120
121 /* The parameters defining the structure of the block are as */
122 /* follows: */
123
124 /* NABCOR Number of aberration correction choices. */
125
126 /* ABATSZ Number of elements in the aberration correction */
127 /* block. */
128
129 /* GEOIDX Index in block of geometric correction flag. */
130
131 /* LTIDX Index of light time flag. */
132
133 /* STLIDX Index of stellar aberration flag. */
134
135 /* CNVIDX Index of converged Newtonian flag. */
136
137 /* XMTIDX Index of transmission flag. */
138
139 /* RELIDX Index of relativistic flag. */
140
141 /* The following parameter is not required to define the block */
142 /* structure, but it is convenient to include it here: */
143
144 /* CORLEN The maximum string length required by any aberration */
145 /* correction string */
146
147 /* $ Author_and_Institution */
148
149 /* N.J. Bachman (JPL) */
150
151 /* $ Literature_References */
152
153 /* None. */
154
155 /* $ Version */
156
157 /* - SPICELIB Version 1.0.0, 18-DEC-2004 (NJB) */
158
159 /* -& */
160 /* Number of aberration correction choices: */
161
162
163 /* Aberration correction attribute block size */
164 /* (number of aberration correction attributes): */
165
166
167 /* Indices of attributes within an aberration correction */
168 /* attribute block: */
169
170
171 /* Maximum length of an aberration correction string: */
172
173
174 /* End of include file zzabcorr.inc */
175
176 /* $ Brief_I/O */
177
178 /* VARIABLE I/O DESCRIPTION */
179 /* -------- --- ------------------------------------------------- */
180 /* ABCORR I Aberration correction string. */
181 /* ATTBLK O Aberration correction attribute block. */
182
183 /* $ Detailed_Input */
184
185 /* ABCORR is a string representing a aberration */
186 /* correction. The supported values are: */
187
188 /* 'CN' */
189 /* 'CN+S' */
190 /* 'LT' */
191 /* 'LT+S' */
192 /* 'NONE' */
193 /* 'XCN' */
194 /* 'XCN+S' */
195 /* 'XLT' */
196 /* 'XLT+S' */
197
198 /* Note that some values not supported by the */
199 /* SPICELIB SPK subsystem are supported by */
200 /* the underlying routine ZZPRSCOR: */
201
202 /* - The letter 'R' indicates relativistic */
203 /* corrections. */
204
205 /* - Stellar aberration-only corrections are */
206 /* indicated by the strings */
207
208 /* 'S' */
209 /* 'XS' */
210
211 /* This routine *does not* permit values that */
212 /* the SPK system doesn't handle. */
213
214 /* Case and embedded blanks are not significant in */
215 /* ABCORR. */
216
217 /* If ABCORR contains an unsupported value, this */
218 /* routine will signal an error. */
219
220 /* $ Detailed_Output */
221
222 /* ATTBLK is a block of logical flags indicating the */
223 /* attributes of the aberration correction */
224 /* specified by ABCORR. The attributes are: */
225
226 /* - Is the correction "geometric"? */
227
228 /* - Is light time correction indicated? */
229
230 /* - Is stellar aberration correction indicated? */
231
232 /* - Is the light time correction of the */
233 /* "converged Newtonian" variety? */
234
235 /* - Is the correction for the transmission */
236 /* case? */
237
238 /* - Is the correction relativistic? (This */
239 /* value is always .FALSE. for aberration */
240 /* corrrection specifications allowed by */
241 /* this routine.) */
242
243 /* The structure of ATTBLK is defined in the */
244 /* include file */
245
246 /* zzabcorr.inc */
247
248 /* The size of ATTBLK and the offsets of the */
249 /* component flags are defined there. */
250
251 /* $ Parameters */
252
253 /* See INCLUDE file zzabcorr.inc. */
254
255 /* $ Exceptions */
256
257 /* 1) If the input aberration correction choice is not allowed, */
258 /* the error SPICE(INVALIDOPTION) is signaled. */
259
260 /* $ Files */
261
262 /* None. */
263
264 /* $ Particulars */
265
266 /* This routine is similar to ZZPRSCOR, but stellar aberration-only */
267 /* and relativistic corrections specifications are not allowed */
268 /* by this routine. The allowed values are precisely those allowed */
269 /* by SPKEZR. */
270
271 /* $ Examples */
272
273 /* See ZZGFOCIN. */
274
275 /* $ Restrictions */
276
277 /* 1) This is a SPICE private routine; the routine is subject */
278 /* to change without notice. User applications should not */
279 /* call this routine. */
280
281 /* 2) This routine recognizes some aberration corrections not */
282 /* handled by most SPICELIB routines. Callers should do */
283 /* their own checking to ensure the parsed correction is */
284 /* acceptable. */
285
286 /* $ Literature_References */
287
288 /* None. */
289
290 /* $ Author_and_Institution */
291
292 /* N.J. Bachman (JPL) */
293
294 /* $ Version */
295
296 /* - SPICELIB Version 1.0.0, 11-APR-2008 (NJB) */
297
298 /* -& */
299
300 /* SPICELIB functions */
301
302 if (return_()) {
303 return 0;
304 }
305 chkin_("ZZVALCOR", (ftnlen)8);
306
307 /* Parse the aberration correction string and obtain */
308 /* an attribute block. */
309
310 zzprscor_(abcorr, attblk, abcorr_len);
311 if (failed_()) {
312 chkout_("ZZVALCOR", (ftnlen)8);
313 return 0;
314 }
315
316 /* Check the attribute block. We don't allow relativistic */
317 /* corrections. */
318
319 if (attblk[5]) {
320 setmsg_("Aberration correction specification # calls for relativisti"
321 "c corrections, which are not supported.", (ftnlen)98);
322 errch_("#", abcorr, (ftnlen)1, abcorr_len);
323 sigerr_("SPICE(INVALIDOPTION)", (ftnlen)20);
324 chkout_("ZZVALCOR", (ftnlen)8);
325 return 0;
326 }
327
328 /* Stellar aberration corrections are allowed only if light */
329 /* time corrections are specified as well. */
330
331 if (attblk[2] && ! attblk[1]) {
332 setmsg_("Aberration correction specification # calls for stellar abe"
333 "rration correction without light time correction; this combi"
334 "nation is not supported.", (ftnlen)143);
335 errch_("#", abcorr, (ftnlen)1, abcorr_len);
336 sigerr_("SPICE(INVALIDOPTION)", (ftnlen)20);
337 chkout_("ZZVALCOR", (ftnlen)8);
338 return 0;
339 }
340 chkout_("ZZVALCOR", (ftnlen)8);
341 return 0;
342 } /* zzvalcor_ */
343
344