WCSLIB: log.h Source File

WCSLIB 7.1

log.h
Go to the documentation of this file.
1 /*============================================================================
2
3 WCSLIB 7.1 - an implementation of the FITS WCS standard.
4 Copyright (C) 1995-2020, 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 7.1 2019/12/31 13:25:19 mcalabre Exp $
26 *=============================================================================
27 *
28 * WCSLIB 7.1 - C routines that implement the FITS World Coordinate System
29 * (WCS) standard. Refer to the README file provided with WCSLIB for an
30 * overview of the library.
31 *
32 *
33 * Summary of the log routines
34 * ---------------------------
35 * Routines in this suite implement the part of the FITS World Coordinate
36 * System (WCS) standard that deals with logarithmic coordinates, as described
37 * in
38 *
39 * "Representations of world coordinates in FITS",
40 * Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I)
41 *
42 * "Representations of spectral coordinates in FITS",
43 * Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L.
44 * 2006, A&A, 446, 747 (WCS Paper III)
45 *
46 * These routines define methods to be used for computing logarithmic world
47 * coordinates from intermediate world coordinates (a linear transformation of
48 * image pixel coordinates), and vice versa.
49 *
50 * logx2s() and logs2x() implement the WCS logarithmic coordinate
51 * transformations.
52 *
53 * Argument checking:
54 * ------------------
55 * The input log-coordinate values are only checked for values that would
56 * result in floating point exceptions and the same is true for the
57 * log-coordinate reference value.
58 *
59 * Accuracy:
60 * ---------
61 * No warranty is given for the accuracy of these routines (refer to the
62 * copyright notice); intending users must satisfy for themselves their
63 * adequacy for the intended purpose. However, closure effectively to within
64 * double precision rounding error was demonstrated by test routine tlog.c
65 * which accompanies this software.
66 *
67 *
68 * logx2s() - Transform to logarithmic coordinates
69 * -----------------------------------------------
70 * logx2s() transforms intermediate world coordinates to logarithmic
71 * coordinates.
72 *
73 * Given and returned:
74 * crval double Log-coordinate reference value (CRVALia).
75 *
76 * Given:
77 * nx int Vector length.
78 *
79 * sx int Vector stride.
80 *
81 * slogc int Vector stride.
82 *
83 * x const double[]
84 * Intermediate world coordinates, in SI units.
85 *
86 * Returned:
87 * logc double[] Logarithmic coordinates, in SI units.
88 *
89 * stat int[] Status return value status for each vector element:
90 * 0: Success.
91 *
92 * Function return value:
93 * int Status return value:
94 * 0: Success.
95 * 2: Invalid log-coordinate reference value.
96 *
97 *
98 * logs2x() - Transform logarithmic coordinates
99 * --------------------------------------------
100 * logs2x() transforms logarithmic world coordinates to intermediate world
101 * coordinates.
102 *
103 * Given and returned:
104 * crval double Log-coordinate reference value (CRVALia).
105 *
106 * Given:
107 * nlogc int Vector length.
108 *
109 * slogc int Vector stride.
110 *
111 * sx int Vector stride.
112 *
113 * logc const double[]
114 * Logarithmic coordinates, in SI units.
115 *
116 * Returned:
117 * x double[] Intermediate world coordinates, in SI units.
118 *
119 * stat int[] Status return value status for each vector element:
120 * 0: Success.
121 * 1: Invalid value of logc.
122 *
123 * Function return value:
124 * int Status return value:
125 * 0: Success.
126 * 2: Invalid log-coordinate reference value.
127 * 4: One or more of the world-coordinate values
128 * are incorrect, as indicated by the stat vector.
129 *
130 *
131 * Global variable: const char *log_errmsg[] - Status return messages
132 * ------------------------------------------------------------------
133 * Error messages to match the status value returned from each function.
134 *
135 *===========================================================================*/
136
137 #ifndef WCSLIB_LOG
138 #define WCSLIB_LOG
139
140 #ifdef __cplusplus
141 extern "C" {
142 #endif
143
144 extern const char *log_errmsg[];
145
146 enum log_errmsg_enum {
147 LOGERR_SUCCESS = 0, /* Success. */
148 LOGERR_NULL_POINTER = 1, /* Null pointer passed. */
149 LOGERR_BAD_LOG_REF_VAL = 2, /* Invalid log-coordinate reference value. */
150 LOGERR_BAD_X = 3, /* One or more of the x coordinates were
151 invalid. */
152 LOGERR_BAD_WORLD = 4 /* One or more of the world coordinates were
153 invalid. */
154 };
155
156 int logx2s(double crval, int nx, int sx, int slogc, const double x[],
157 double logc[], int stat[]);
158
159 int logs2x(double crval, int nlogc, int slogc, int sx, const double logc[],
160 double x[], int stat[]);
161
162
163 #ifdef __cplusplus
164 }
165 #endif
166
167 #endif /* WCSLIB_LOG */
LOGERR_NULL_POINTER
@ LOGERR_NULL_POINTER
Definition: log.h:148
logx2s
int logx2s(double crval, int nx, int sx, int slogc, const double x[], double logc[], int stat[])
Transform to logarithmic coordinates.
LOGERR_BAD_WORLD
@ LOGERR_BAD_WORLD
Definition: log.h:152
LOGERR_BAD_LOG_REF_VAL
@ LOGERR_BAD_LOG_REF_VAL
Definition: log.h:149
log_errmsg_enum
log_errmsg_enum
Definition: log.h:146
LOGERR_SUCCESS
@ LOGERR_SUCCESS
Definition: log.h:147
LOGERR_BAD_X
@ LOGERR_BAD_X
Definition: log.h:150
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.