WCSLIB 4.25.1

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

log.h
Go to the documentation of this file.
1 /*============================================================================
2
3 WCSLIB 4.25 - an implementation of the FITS WCS standard.
4 Copyright (C) 1995-2015, Mark Calabretta
5
6 This file is part of WCSLIB.
7
8 WCSLIB is free software: you can redistribute it and/or modify it under the
9 terms of the GNU Lesser General Public License as published by the Free
10 Software Foundation, either version 3 of the License, or (at your option)
11 any later version.
12
13 WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
16 more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with WCSLIB. If not, see http://www.gnu.org/licenses.
20
21 Direct correspondence concerning WCSLIB to mark@calabretta.id.au
22
23 Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
24 http://www.atnf.csiro.au/people/Mark.Calabretta
25 $Id: log.h,v 4.25.1.2 2015/01/06 01:01:06 mcalabre Exp mcalabre $
26 *=============================================================================
27 *
28 * WCSLIB 4.25 - C routines that implement logarithmic coordinate systems as
29 * defined by the FITS World Coordinate System (WCS) standard. Refer to
30 *
31 * "Representations of world coordinates in FITS",
32 * Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (Paper I)
33 *
34 * "Representations of spectral coordinates in FITS",
35 * Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L.
36 * 2006, A&A, 446, 747 (Paper III)
37 *
38 * Refer to the README file provided with WCSLIB for an overview of the
39 * library.
40 *
41 *
42 * Summary of the log routines
43 * ---------------------------
44 * These routines implement the part of the FITS WCS standard that deals with
45 * logarithmic coordinates. They define methods to be used for computing
46 * logarithmic world coordinates from intermediate world coordinates (a linear
47 * transformation of image pixel coordinates), and vice versa.
48 *
49 * logx2s() and logs2x() implement the WCS logarithmic coordinate
50 * transformations.
51 *
52 * Argument checking:
53 * ------------------
54 * The input log-coordinate values are only checked for values that would
55 * result in floating point exceptions and the same is true for the
56 * log-coordinate reference value.
57 *
58 * Accuracy:
59 * ---------
60 * No warranty is given for the accuracy of these routines (refer to the
61 * copyright notice); intending users must satisfy for themselves their
62 * adequacy for the intended purpose. However, closure effectively to within
63 * double precision rounding error was demonstrated by test routine tlog.c
64 * which accompanies this software.
65 *
66 *
67 * logx2s() - Transform to logarithmic coordinates
68 * -----------------------------------------------
69 * logx2s() transforms intermediate world coordinates to logarithmic
70 * coordinates.
71 *
72 * Given and returned:
73 * crval double Log-coordinate reference value (CRVALia).
74 *
75 * Given:
76 * nx int Vector length.
77 *
78 * sx int Vector stride.
79 *
80 * slogc int Vector stride.
81 *
82 * x const double[]
83 * Intermediate world coordinates, in SI units.
84 *
85 * Returned:
86 * logc double[] Logarithmic coordinates, in SI units.
87 *
88 * stat int[] Status return value status for each vector element:
89 * 0: Success.
90 *
91 * Function return value:
92 * int Status return value:
93 * 0: Success.
94 * 2: Invalid log-coordinate reference value.
95 *
96 *
97 * logs2x() - Transform logarithmic coordinates
98 * --------------------------------------------
99 * logs2x() transforms logarithmic world coordinates to intermediate world
100 * coordinates.
101 *
102 * Given and returned:
103 * crval double Log-coordinate reference value (CRVALia).
104 *
105 * Given:
106 * nlogc int Vector length.
107 *
108 * slogc int Vector stride.
109 *
110 * sx int Vector stride.
111 *
112 * logc const double[]
113 * Logarithmic coordinates, in SI units.
114 *
115 * Returned:
116 * x double[] Intermediate world coordinates, in SI units.
117 *
118 * stat int[] Status return value status for each vector element:
119 * 0: Success.
120 * 1: Invalid value of logc.
121 *
122 * Function return value:
123 * int Status return value:
124 * 0: Success.
125 * 2: Invalid log-coordinate reference value.
126 * 4: One or more of the world-coordinate values
127 * are incorrect, as indicated by the stat vector.
128 *
129 *
130 * Global variable: const char *log_errmsg[] - Status return messages
131 * ------------------------------------------------------------------
132 * Error messages to match the status value returned from each function.
133 *
134 *===========================================================================*/
135
136 #ifndef WCSLIB_LOG
137 #define WCSLIB_LOG
138
139 #ifdef __cplusplus
140 extern "C" {
141 #endif
142
143 extern const char *log_errmsg[];
144
145 enum log_errmsg_enum {
146 LOGERR_SUCCESS = 0, /* Success. */
147 LOGERR_NULL_POINTER = 1, /* Null pointer passed. */
148 LOGERR_BAD_LOG_REF_VAL = 2, /* Invalid log-coordinate reference value. */
149 LOGERR_BAD_X = 3, /* One or more of the x coordinates were
150 invalid. */
151 LOGERR_BAD_WORLD = 4 /* One or more of the world coordinates were
152 invalid. */
153 };
154
155 int logx2s(double crval, int nx, int sx, int slogc, const double x[],
156 double logc[], int stat[]);
157
158 int logs2x(double crval, int nlogc, int slogc, int sx, const double logc[],
159 double x[], int stat[]);
160
161
162 #ifdef __cplusplus
163 }
164 #endif
165
166 #endif /* WCSLIB_LOG */
LOGERR_BAD_WORLD
Definition: log.h:151
logx2s
int logx2s(double crval, int nx, int sx, int slogc, const double x[], double logc[], int stat[])
Transform to logarithmic coordinates.
LOGERR_NULL_POINTER
Definition: log.h:147
log_errmsg_enum
log_errmsg_enum
Definition: log.h:145
LOGERR_BAD_LOG_REF_VAL
Definition: log.h:148
logs2x
int logs2x(double crval, int nlogc, int slogc, int sx, const double logc[], double x[], int stat[])
Transform logarithmic coordinates.
log_errmsg
const char * log_errmsg[]
Status return messages.
LOGERR_BAD_X
Definition: log.h:149
LOGERR_SUCCESS
Definition: log.h:146