Loading...
Searching...
No Matches
wcslib.h
Go to the documentation of this file.
/*============================================================================
WCSLIB 8.2 - an implementation of the FITS WCS standard.
Copyright (C) 1995-2023, Mark Calabretta
This file is part of WCSLIB.
WCSLIB is free software: you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
more details.
You should have received a copy of the GNU Lesser General Public License
along with WCSLIB. If not, see http://www.gnu.org/licenses.
Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
http://www.atnf.csiro.au/people/Mark.Calabretta
$Id: wcslib.h,v 8.2.1.1 2023/11/16 10:05:57 mcalabre Exp mcalabre $
*=============================================================================
*
* WCSLIB 8.2 - C routines that implement the FITS World Coordinate System
* (WCS) standard. Refer to the README file provided with WCSLIB for an
* overview of the library.
*
* Summary of wcslib.h
* -------------------
* This header file is provided purely for convenience. Use it to include all
* of the separate WCSLIB headers.
*
*===========================================================================*/
#ifndef WCSLIB_WCSLIB
#define WCSLIB_WCSLIB
#include "cel.h"
#include "dis.h"
#include "fitshdr.h"
#include "lin.h"
#include "log.h"
#include "prj.h"
#include "spc.h"
#include "sph.h"
#include "spx.h"
#include "tab.h"
#include "wcs.h"
#include "wcserr.h"
#include "wcsfix.h"
#include "wcshdr.h"
#include "wcsmath.h"
#include "wcsprintf.h"
#include "wcstrig.h"
#include "wcsunits.h"
#include "wcsutil.h"
#include "wtbarr.h"
#endif // WCSLIB_WCSLIB
wcserr_enable(1);
wcsprintf_set(stderr);
...
if (wcsset(&wcs) {
wcsperr(&wcs);
return wcs.err->status;
}
@endverbatim
In this example, if an error was generated in one of the prjset() functions,
wcsperr() would print an error traceback starting with wcsset(), then
celset(), and finally the particular projection-setting function that
generated the error. For each of them it would print the status return value,
function name, source file, line number, and an error message which may be
more specific and informative than the general error messages reported in the
first example. For example, in response to a deliberately generated error,
the @c twcs test program, which tests wcserr among other things, produces a
traceback similar to this:
@verbatim
ERROR 5 in wcsset() at line 1564 of file wcs.c:
Invalid parameter value.
ERROR 2 in celset() at line 196 of file cel.c:
Invalid projection parameters.
ERROR 2 in bonset() at line 5727 of file prj.c:
Invalid parameters for Bonne's projection.
@endverbatim
Each of the @ref structs "structs" in @ref overview "WCSLIB" includes a
pointer, called @a err, to a wcserr struct. When an error occurs, a struct is
allocated and error information stored in it. The wcserr pointers and the
@ref memory "memory" allocated for them are managed by the routines that
manage the various structs such as wcsinit() and wcsfree().
wcserr messaging is an opt-in system enabled via wcserr_enable(), as in the
example above. If enabled, when an error occurs it is the user's
responsibility to free the memory allocated for the error message using
wcsfree(), celfree(), prjfree(), etc. Failure to do so before the struct goes
out of scope will result in memory leaks (if execution continues beyond the
error).
*/
cel.h
celfree
int celfree(struct celprm *cel)
Destructor for the celprm struct.
celset
int celset(struct celprm *cel)
Setup routine for the celprm struct.
dis.h
fitshdr.h
lin.h
log.h
prj.h
prjfree
int prjfree(struct prjprm *prj)
Destructor for the prjprm struct.
bonset
int bonset(struct prjprm *prj)
Set up a prjprm struct for Bonne's (BON) projection.
prjset
int prjset(struct prjprm *prj)
Generic setup routine for the prjprm struct.
spc.h
sph.h
spx.h
wcserr
Error message handling.
Definition wcserr.h:243
tab.h
wcs.h
wcsfree
int wcsfree(struct wcsprm *wcs)
Destructor for the wcsprm struct.
wcsperr
int wcsperr(const struct wcsprm *wcs, const char *prefix)
Print error messages from a wcsprm struct.
wcsinit
int wcsinit(int alloc, int naxis, struct wcsprm *wcs, int npvmax, int npsmax, int ndpmax)
Default constructor for the wcsprm struct.
wcsset
int wcsset(struct wcsprm *wcs)
Setup routine for the wcsprm struct.
wcserr.h
wcserr_enable
int wcserr_enable(int enable)
Enable/disable error messaging.
wcsfix.h
wcshdr.h
wcsmath.h
wcsprintf.h
wcsprintf_set
int wcsprintf_set(FILE *wcsout)
Set output disposition for wcsprintf() and wcsfprintf().
wcstrig.h
wcsunits.h
wcsutil.h
wtbarr.h