- Main Page
- Related Pages
- Data Structures
- Files

# wcslib.h

Go to the documentation of this file.

    00001 /*============================================================================
    00002
    00003   WCSLIB 4.13 - an implementation of the FITS WCS standard.
    00004   Copyright (C) 1995-2012, 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: wcslib.h,v 4.13.1.1 2012/03/14 07:40:37 cal103 Exp cal103 $
    00032 *=============================================================================
    00033 *
    00034 * WCSLIB 4.13 - C routines that implement the FITS World Coordinate System
    00035 * (WCS) standard.
    00036 *
    00037 * Summary of wcslib.h
    00038 * -------------------
    00039 * This header file is provided purely for convenience.  Use it to include all
    00040 * of the separate WCSLIB headers.
    00041 *
    00042 *===========================================================================*/
    00043
    00044 #ifndef WCSLIB_WCSLIB
    00045 #define WCSLIB_WCSLIB
    00046
    00047 #include "cel.h"
    00048 #include "fitshdr.h"
    00049 #include "lin.h"
    00050 #include "log.h"
    00051 #include "prj.h"
    00052 #include "spc.h"
    00053 #include "sph.h"
    00054 #include "spx.h"
    00055 #include "tab.h"
    00056 #include "wcs.h"
    00057 #include "wcserr.h"
    00058 #include "wcsfix.h"
    00059 #include "wcshdr.h"
    00060 #include "wcsmath.h"
    00061 #include "wcsprintf.h"
    00062 #include "wcstrig.h"
    00063 #include "wcsunits.h"
    00064 #include "wcsutil.h"
    00065
    00066 #endif /* WCSLIB_WCSLIB */
    00067
    01936   wcserr_enable(1);
    01937   wcsprintf_set(stderr);
    01938
    01939   ...
    01940
    01941   if (wcsset(&wcs) {
    01942     wcsperr(&wcs);
    01943     return wcs.err->status;
    01944   }
    01945 @endverbatim
    01946 In this example, if an error was generated in one of the prjset() functions,
    01947 wcsperr() would print an error traceback starting with wcsset(), then
    01948 celset(), and finally the particular projection-setting function that
    01949 generated the error.  For each of them it would print the status return value,
    01950 function name, source file, line number, and an error message which may be
    01951 more specific and informative than the general error messages reported in the
    01952 first example.  For example, in response to a deliberately generated error,
    01953 the @c twcs test program, which tests wcserr among other things, produces a
    01954 traceback similar to this:
    01955 @verbatim
    01956 ERROR 5 in wcsset() at line 1564 of file wcs.c:
    01957   Invalid parameter value.
    01958 ERROR 2 in celset() at line 196 of file cel.c:
    01959   Invalid projection parameters.
    01960 ERROR 2 in bonset() at line 5727 of file prj.c:
    01961   Invalid parameters for Bonne's projection.
    01962 @endverbatim
    01963
    01964 Each of the @ref structs "structs" in @ref overview "WCSLIB" includes a
    01965 pointer, called @a err, to a wcserr struct.  When an error occurs, a struct is
    01966 allocated and error information stored in it.  The wcserr pointers and the
    01967 @ref memory "memory" allocated for them are managed by the routines that
    01968 manage the various structs such as wcsini() and wcsfree().
    01969
    01970 wcserr messaging is an opt-in system enabled via wcserr_enable(), as in the
    01971 example above.  If enabled, when an error occurs it is the user's
    01972 responsibility to free the memory allocated for the error message using
    01973 wcsfree(), celfree(), prjfree(), etc.  Failure to do so before the struct goes
    01974 out of scope will result in memory leaks (if execution continues beyond the
    01975 error).
    01976 */
    01977
    01978
    02450 /*
    02451 Author: Mark Calabretta, Australia Telescope National Facility
    02452 http://www.atnf.csiro.au/~mcalabre/index.html
    02453 $Id: mainpage.dox,v 4.13.1.5 2012/04/02 03:27:12 cal103 Exp cal103 $
    02454 */