00001 /*============================================================================ 00002 00003 WCSLIB 4.4 - an implementation of the FITS WCS standard. 00004 Copyright (C) 1995-2009, Mark Calabretta 00005 00006 This file is part of WCSLIB. 00007 00008 WCSLIB is free software: you can redistribute it and/or modify it under the 00009 terms of the GNU Lesser General Public License as published by the Free 00010 Software Foundation, either version 3 of the License, or (at your option) 00011 any later version. 00012 00013 WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY 00014 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00015 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 00016 more details. 00017 00018 You should have received a copy of the GNU Lesser General Public License 00019 along with WCSLIB. If not, see <http://www.gnu.org/licenses/>. 00020 00021 Correspondence concerning WCSLIB may be directed to: 00022 Internet email: mcalabre@atnf.csiro.au 00023 Postal address: Dr. Mark Calabretta 00024 Australia Telescope National Facility, CSIRO 00025 PO Box 76 00026 Epping NSW 1710 00027 AUSTRALIA 00028 00029 Author: Mark Calabretta, Australia Telescope National Facility 00030 http://www.atnf.csiro.au/~mcalabre/index.html 00031 $Id: log_8h-source.html,v 1.1 2009/09/14 20:25:23 irby Exp $ 00032 *============================================================================= 00033 * 00034 * WCSLIB 4.4 - C routines that implement logarithmic coordinate systems as 00035 * defined by the FITS World Coordinate System (WCS) standard. Refer to 00036 * 00037 * "Representations of world coordinates in FITS", 00038 * Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (Paper I) 00039 * 00040 * "Representations of spectral coordinates in FITS", 00041 * Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L. 00042 * 2006, A&A, 446, 747 (Paper III) 00043 * 00044 * Refer to the README file provided with WCSLIB for an overview of the 00045 * library. 00046 * 00047 * 00048 * Summary of the log routines 00049 * --------------------------- 00050 * These routines implement the part of the FITS WCS standard that deals with 00051 * logarithmic coordinates. They define methods to be used for computing 00052 * logarithmic world coordinates from intermediate world coordinates (a linear 00053 * transformation of image pixel coordinates), and vice versa. 00054 * 00055 * logx2s() and logs2x() implement the WCS logarithmic coordinate 00056 * transformations. 00057 * 00058 * Argument checking: 00059 * ------------------ 00060 * The input log-coordinate values are only checked for values that would 00061 * result in floating point exceptions and the same is true for the 00062 * log-coordinate reference value. 00063 * 00064 * Accuracy: 00065 * --------- 00066 * No warranty is given for the accuracy of these routines (refer to the 00067 * copyright notice); intending users must satisfy for themselves their 00068 * adequacy for the intended purpose. However, closure effectively to within 00069 * double precision rounding error was demonstrated by test routine tlog.c 00070 * which accompanies this software. 00071 * 00072 * 00073 * logx2s() - Transform to logarithmic coordinates 00074 * ----------------------------------------------- 00075 * logx2s() transforms intermediate world coordinates to logarithmic 00076 * coordinates. 00077 * 00078 * Given and returned: 00079 * crval double Log-coordinate reference value (CRVALia). 00080 * 00081 * Given: 00082 * nx int Vector length. 00083 * sx int Vector stride. 00084 * slogc int Vector stride. 00085 * x const double[] 00086 * Intermediate world coordinates, in SI units. 00087 * 00088 * Returned: 00089 * logc double[] Logarithmic coordinates, in SI units. 00090 * stat int[] Status return value status for each vector element: 00091 * 0: Success. 00092 * 1: Invalid value of x. 00093 * 00094 * Function return value: 00095 * int Status return value: 00096 * 0: Success. 00097 * 2: Invalid log-coordinate reference value. 00098 * 3: One or more of the x coordinates were invalid, 00099 * as indicated by the stat vector. 00100 * 00101 * 00102 * logs2x() - Transform logarithmic coordinates 00103 * -------------------------------------------- 00104 * logs2x() transforms logarithmic world coordinates to intermediate world 00105 * coordinates. 00106 * 00107 * Given and returned: 00108 * crval double Log-coordinate reference value (CRVALia). 00109 * 00110 * Given: 00111 * nlogc int Vector length. 00112 * slogc int Vector stride. 00113 * sx int Vector stride. 00114 * logc const double[] 00115 * Logarithmic coordinates, in SI units. 00116 * 00117 * Returned: 00118 * x double[] Intermediate world coordinates, in SI units. 00119 * stat int[] Status return value status for each vector element: 00120 * 0: Success. 00121 * 1: Invalid value of logc. 00122 * 00123 * Function return value: 00124 * int Status return value: 00125 * 0: Success. 00126 * 2: Invalid log-coordinate reference value. 00127 * 00128 * 00129 * Global variable: const char *log_errmsg[] - Status return messages 00130 * ------------------------------------------------------------------ 00131 * Error messages to match the status value returned from each function. 00132 * 00133 *===========================================================================*/ 00134 00135 #ifndef WCSLIB_LOG 00136 #define WCSLIB_LOG 00137 00138 #ifdef __cplusplus 00139 extern "C" { 00140 #endif 00141 00142 00143 extern const char *log_errmsg[]; 00144 00145 00146 int logx2s(double crval, int nx, int sx, int slogc, const double x[], 00147 double logc[], int stat[]); 00148 00149 int logs2x(double crval, int nlogc, int slogc, int sx, const double logc[], 00150 double x[], int stat[]); 00151 00152 00153 #ifdef __cplusplus 00154 } 00155 #endif 00156 00157 #endif /* WCSLIB_LOG */