tnx.h 2.32 KB
Newer Older
Emmanuel Bertin's avatar
Emmanuel Bertin committed
1
/*
2
3
4
5
6
7
8
*				tnx.h
*
* Manage polynomials.
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*
*	This file part of:	AstrOmatic WCS library
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9
*
10
*	Copyright:		(C) 2000-2010 IAP/CNRS/UPMC
Emmanuel Bertin's avatar
Emmanuel Bertin committed
11
*
12
*	Author:			Emmanuel Bertin (IAP)
Emmanuel Bertin's avatar
Emmanuel Bertin committed
13
*
14
*	License:		GNU General Public License
Emmanuel Bertin's avatar
Emmanuel Bertin committed
15
*
16
17
18
19
20
21
22
23
24
25
26
*	AstrOmatic software is free software: you can redistribute it and/or
*	modify it under the terms of the GNU General Public License as
*	published by the Free Software Foundation, either version 3 of the
*	License, or (at your option) any later version.
*	AstrOmatic software 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 General Public License for more details.
*	You should have received a copy of the GNU General Public License
*	along with AstrOmatic software.
*	If not, see <http://www.gnu.org/licenses/>.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
27
*
28
*	Last modified:		10/10/2010
Emmanuel Bertin's avatar
Emmanuel Bertin committed
29
*
30
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
Emmanuel Bertin's avatar
Emmanuel Bertin committed
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75

#ifndef _TNX_H_
#define _TNX_H_

/*-------------------------------- macros -----------------------------------*/

#define		TNX_MAXCHARS	2048	/* Maximum FITS "WAT" string length */

/* TNX permitted types of surfaces */
#define		TNX_CHEBYSHEV	1
#define		TNX_LEGENDRE	2
#define		TNX_POLYNOMIAL	3

/* TNX cross-terms flags */
#define		TNX_XNONE	0	/* no x-terms (old no) */
#define		TNX_XFULL	1	/* full x-terms (new yes) */
#define		TNX_XHALF	2	/* half x-terms (new) */

/*----------------------------- Internal constants --------------------------*/

/*------------------------------- structures --------------------------------*/

typedef struct tnxaxis
  {
  int		type;			/* Projection correction type */
  int		xorder,yorder;		/* Polynomial orders */
  int		xterms;			/* Well... */
  int		ncoeff;			/* Number of polynom coefficients */
  double	xrange,yrange;		/* Coordinate ranges */
  double	xmaxmin,ymaxmin;	/* Well... */
  double	*coeff;			/* Polynom coefficients */
  double	*xbasis,*ybasis;	/* Basis function values */
  }	tnxaxisstruct;

/*------------------------------- functions ---------------------------------*/

tnxaxisstruct	*copy_tnxaxis(tnxaxisstruct *axis),
		*read_tnxaxis(char *tnxstr);

double		raw_to_tnxaxis(tnxaxisstruct *axis, double x, double y);

void		free_tnxaxis(tnxaxisstruct *axis);

#endif