1 /*============================================================================
2 WCSLIB 7.7 - an implementation of the FITS WCS standard.
3 Copyright (C) 1995-2021, Mark Calabretta
4
5 This file is part of WCSLIB.
6
7 WCSLIB is free software: you can redistribute it and/or modify it under the
8 terms of the GNU Lesser General Public License as published by the Free
9 Software Foundation, either version 3 of the License, or (at your option)
10 any later version.
11
12 WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
15 more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with WCSLIB. If not, see http://www.gnu.org/licenses.
19
20 Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
21 http://www.atnf.csiro.au/people/Mark.Calabretta
22 $Id: tspcaips.c,v 7.7 2021/07/12 06:36:49 mcalabre Exp $
23 *=============================================================================
24 *
25 * tspcaips does a quick test of spcaips(). Not part of the official test
26 * suite.
27 *
28 *---------------------------------------------------------------------------*/
29
30 #include <stdio.h>
31 #include <spc.h>
32
main()33 int main()
34
35 {
36 const char *(ctypes[]) = {"FREQ", "VELO", "FELO"};
37 const char *(frames[]) = {"-LSR", "-HEL", "-OBS", " "};
38
39 char ctype[9], ctypeA[9], specsys[9];
40 int i, j, status, v1, v2, velref;
41
42 for (i = 0; i < 3; i++) {
43 for (j = 0; j < 4; j++) {
44 sprintf(ctypeA, "%s%s", ctypes[i], frames[j]);
45
46 for (v1 = 0; v1 <= 8; v1++) {
47 velref = v1;
48 for (v2 = 0; v2 < 3; v2++) {
49 status = spcaips(ctypeA, velref, ctype, specsys);
50 printf("'%s' %3d %2d '%s' '%s'\n", ctypeA, velref,
51 status, ctype, specsys);
52 velref += 256;
53 }
54 }
55
56 printf("\n");
57 }
58 }
59
60 return 0;
61 }
62