wcs.h   wcs.h 
/*** File libwcs/wcs.h /*** File libwcs/wcs.h
*** July 25, 2007 *** March 14, 2011
*** By Doug Mink, dmink@cfa.harvard.edu *** By Doug Mink, dmink@cfa.harvard.edu
*** Harvard-Smithsonian Center for Astrophysics *** Harvard-Smithsonian Center for Astrophysics
*** Copyright (C) 1994-2007 *** Copyright (C) 1994-2011
*** Smithsonian Astrophysical Observatory, Cambridge, MA, USA *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
skipping to change at line 83 skipping to change at line 83
double xpix; /* X (RA) coordinate (pixels) */ double xpix; /* X (RA) coordinate (pixels) */
double ypix; /* Y (dec) coordinate (pixels) */ double ypix; /* Y (dec) coordinate (pixels) */
double zpix; /* Z (face) coordinate (pixels) */ double zpix; /* Z (face) coordinate (pixels) */
double xpos; /* X (RA) coordinate (deg) */ double xpos; /* X (RA) coordinate (deg) */
double ypos; /* Y (dec) coordinate (deg) */ double ypos; /* Y (dec) coordinate (deg) */
double crpix[9]; /* Values of CRPIXn keywords */ double crpix[9]; /* Values of CRPIXn keywords */
double crval[9]; /* Values of CRVALn keywords */ double crval[9]; /* Values of CRVALn keywords */
double cdelt[9]; /* Values of CDELTn keywords */ double cdelt[9]; /* Values of CDELTn keywords */
double pc[81]; /* Values of PCiiijjj keywords */ double pc[81]; /* Values of PCiiijjj keywords */
double projp[10]; /* Constants for various projections */ double projp[10]; /* Constants for various projections */
int pvfail; /* If non-zero, significant inaccuracy likel
y to occur in projection */
double projppv[2*MAXPV]; /* SCAMP constants for the PV coordinates
*/
struct poly *inv_x; /* SCAMP projection correction polynom in x
*/
struct poly *inv_y; /* SCAMP projection correction polynom in y
*/
double longpole; /* Longitude of North Pole in degrees */ double longpole; /* Longitude of North Pole in degrees */
double latpole; /* Latitude of North Pole in degrees */ double latpole; /* Latitude of North Pole in degrees */
double rodeg; /* Radius of the projection generating spher e */ double rodeg; /* Radius of the projection generating spher e */
double imrot; /* Rotation angle of north pole */ double imrot; /* Rotation angle of north pole */
double pa_north; /* Position angle of north (0=horizontal) */ double pa_north; /* Position angle of north (0=horizontal) */
double pa_east; /* Position angle of east (0=horizontal) */ double pa_east; /* Position angle of east (0=horizontal) */
double radvel; /* Radial velocity (km/sec away from observe r)*/ double radvel; /* Radial velocity (km/sec away from observe r)*/
double zvel; /* Radial velocity (v/c away from observer)* / double zvel; /* Radial velocity (v/c away from observer)* /
double zpzd; /* Colat of FIP (degs) */
double zpr; /* Radius of FIP (degs) */
int imflip; /* If not 0, image is reflected around axis */ int imflip; /* If not 0, image is reflected around axis */
int prjcode; /* projection code (-1-32) */ int prjcode; /* projection code (-1-32) */
int latbase; /* Latitude base 90 (NPA), 0 (LAT), -90 (SPA ) */ int latbase; /* Latitude base 90 (NPA), 0 (LAT), -90 (SPA ) */
int ncoeff1; /* Number of x-axis plate fit coefficients * / int ncoeff1; /* Number of x-axis plate fit coefficients * /
int ncoeff2; /* Number of y-axis plate fit coefficients * / int ncoeff2; /* Number of y-axis plate fit coefficients * /
int zpnp; /* ZP polynomial order (0-9) */
int changesys; /* 1 for FK4->FK5, 2 for FK5->FK4 */ int changesys; /* 1 for FK4->FK5, 2 for FK5->FK4 */
/* 3 for FK4->galactic, 4 for FK5->galactic */ /* 3 for FK4->galactic, 4 for FK5->galactic */
int printsys; /* 1 to print coordinate system, else 0 */ int printsys; /* 1 to print coordinate system, else 0 */
int ndec; /* Number of decimal places in PIX2WCST */ int ndec; /* Number of decimal places in PIX2WCST */
int degout; /* 1 to always print degrees in PIX2WCST */ int degout; /* 1 to always print degrees in PIX2WCST */
int tabsys; /* 1 to put tab between RA & Dec, else 0 */ int tabsys; /* 1 to put tab between RA & Dec, else 0 */
int rotmat; /* 0 if CDELT, CROTA; 1 if CD */ int rotmat; /* 0 if CDELT, CROTA; 1 if CD */
int coorflip; /* 0 if x=RA, y=Dec; 1 if x=Dec, y=RA */ int coorflip; /* 0 if x=RA, y=Dec; 1 if x=Dec, y=RA */
int offscl; /* 0 if OK, 1 if offscale */ int offscl; /* 0 if OK, 1 if offscale */
int wcson; /* 1 if WCS is set, else 0 */ int wcson; /* 1 if WCS is set, else 0 */
skipping to change at line 191 skipping to change at line 198
#define WCS_AIT 22 /* Hammer-Aitoff */ #define WCS_AIT 22 /* Hammer-Aitoff */
#define WCS_MOL 23 /* Mollweide */ #define WCS_MOL 23 /* Mollweide */
#define WCS_CSC 24 /* COBE quadrilateralized Spherical Cube */ #define WCS_CSC 24 /* COBE quadrilateralized Spherical Cube */
#define WCS_QSC 25 /* Quadrilateralized Spherical Cube */ #define WCS_QSC 25 /* Quadrilateralized Spherical Cube */
#define WCS_TSC 26 /* Tangential Spherical Cube */ #define WCS_TSC 26 /* Tangential Spherical Cube */
#define WCS_NCP 27 /* Special case of SIN */ #define WCS_NCP 27 /* Special case of SIN */
#define WCS_GLS 28 /* Same as SFL */ #define WCS_GLS 28 /* Same as SFL */
#define WCS_DSS 29 /* Digitized Sky Survey plate solution */ #define WCS_DSS 29 /* Digitized Sky Survey plate solution */
#define WCS_PLT 30 /* Plate fit polynomials (SAO) */ #define WCS_PLT 30 /* Plate fit polynomials (SAO) */
#define WCS_TNX 31 /* Gnomonic = Tangent Plane (NOAO with corrections) */ #define WCS_TNX 31 /* Gnomonic = Tangent Plane (NOAO with corrections) */
#define WCS_ZPX 32 /* Gnomonic = Tangent Plane (NOAO with corrections)
*/
#define NWCSTYPE 33 /* Number of WCS types (-1 really means no WCS)
/* Coordinate systems */ /* Coordinate systems */
#define WCS_J2000 1 /* J2000(FK5) right ascension and declinatio n */ #define WCS_J2000 1 /* J2000(FK5) right ascension and declinatio n */
#define WCS_B1950 2 /* B1950(FK4) right ascension and declinatio n */ #define WCS_B1950 2 /* B1950(FK4) right ascension and declinatio n */
#define WCS_GALACTIC 3 /* Galactic longitude and latitude */ #define WCS_GALACTIC 3 /* Galactic longitude and latitude */
#define WCS_ECLIPTIC 4 /* Ecliptic longitude and latitude */ #define WCS_ECLIPTIC 4 /* Ecliptic longitude and latitude */
#define WCS_ALTAZ 5 /* Azimuth and altitude/elevation */ #define WCS_ALTAZ 5 /* Azimuth and altitude/elevation */
#define WCS_LINEAR 6 /* Linear with optional units */ #define WCS_LINEAR 6 /* Linear with optional units */
#define WCS_NPOLE 7 /* Longitude and north polar angle */ #define WCS_NPOLE 7 /* Longitude and north polar angle */
#define WCS_SPA 8 /* Longitude and south polar angle * / #define WCS_SPA 8 /* Longitude and south polar angle * /
skipping to change at line 231 skipping to change at line 240
/* Conversions among hours of RA, degrees and radians. */ /* Conversions among hours of RA, degrees and radians. */
#define degrad(x) ((x)*PI/180.) #define degrad(x) ((x)*PI/180.)
#define raddeg(x) ((x)*180./PI) #define raddeg(x) ((x)*180./PI)
#define hrdeg(x) ((x)*15.) #define hrdeg(x) ((x)*15.)
#define deghr(x) ((x)/15.) #define deghr(x) ((x)/15.)
#define hrrad(x) degrad(hrdeg(x)) #define hrrad(x) degrad(hrdeg(x))
#define radhr(x) deghr(raddeg(x)) #define radhr(x) deghr(raddeg(x))
#define secrad(x) ((x)*AS2R) #define secrad(x) ((x)*AS2R)
/* TNX surface fitting structure and flags */ /* TNX/ZPX surface fitting structure and flags */
struct IRAFsurface { struct IRAFsurface {
double xrange; /* 2. / (xmax - xmin), polynomials */ double xrange; /* 2. / (xmax - xmin), polynomials */
double xmaxmin; /* - (xmax + xmin) / 2., polynomials */ double xmaxmin; /* - (xmax + xmin) / 2., polynomials */
double yrange; /* 2. / (ymax - ymin), polynomials */ double yrange; /* 2. / (ymax - ymin), polynomials */
double ymaxmin; /* - (ymax + ymin) / 2., polynomials */ double ymaxmin; /* - (ymax + ymin) / 2., polynomials */
int type; /* type of curve to be fitted */ int type; /* type of curve to be fitted */
int xorder; /* order of the fit in x */ int xorder; /* order of the fit in x */
int yorder; /* order of the fit in y */ int yorder; /* order of the fit in y */
int xterms; /* cross terms for polynomials */ int xterms; /* cross terms for polynomials */
int ncoeff; /* total number of coefficients */ int ncoeff; /* total number of coefficients */
double *coeff; /* pointer to coefficient vector */ double *coeff; /* pointer to coefficient vector */
double *xbasis; /* pointer to basis functions (all x) */ double *xbasis; /* pointer to basis functions (all x) */
double *ybasis; /* pointer to basis functions (all y) */ double *ybasis; /* pointer to basis functions (all y) */
}; };
/* TNX permitted types of surfaces */ /* TNX/ZPX permitted types of surfaces */
#define TNX_CHEBYSHEV 1 #define TNX_CHEBYSHEV 1
#define TNX_LEGENDRE 2 #define TNX_LEGENDRE 2
#define TNX_POLYNOMIAL 3 #define TNX_POLYNOMIAL 3
/* TNX cross-terms flags */ /* TNX/ZPX cross-terms flags */
#define TNX_XNONE 0 /* no x-terms (old no) */ #define TNX_XNONE 0 /* no x-terms (old no) */
#define TNX_XFULL 1 /* full x-terms (new yes) */ #define TNX_XFULL 1 /* full x-terms (new yes) */
#define TNX_XHALF 2 /* half x-terms (new) */ #define TNX_XHALF 2 /* half x-terms (new) */
#ifdef __cplusplus /* C++ prototypes */ #ifdef __cplusplus /* C++ prototypes */
extern "C" { extern "C" {
#endif #endif
#ifdef __STDC__ /* Full ANSI prototypes */ #ifdef __STDC__ /* Full ANSI prototypes */
skipping to change at line 340 skipping to change at line 349
double *xpix, /* Image horizontal coordinate in pixels (returned) */ double *xpix, /* Image horizontal coordinate in pixels (returned) */
double *ypix, /* Image vertical coordinate in pixels (returned) */ double *ypix, /* Image vertical coordinate in pixels (returned) */
int *offscl); int *offscl);
double wcsdist( /* Compute angular distance between 2 sky positions */ double wcsdist( /* Compute angular distance between 2 sky positions */
double ra1, /* First longitude/right ascension in degrees */ double ra1, /* First longitude/right ascension in degrees */
double dec1, /* First latitude/declination in degrees */ double dec1, /* First latitude/declination in degrees */
double ra2, /* Second longitude/right ascension in degrees */ double ra2, /* Second longitude/right ascension in degrees */
double dec2); /* Second latitude/declination in degrees */ double dec2); /* Second latitude/declination in degrees */
double wcsdist1( /* Compute angular distance between 2 sky positions
*/
double ra1, /* First longitude/right ascension in degrees */
double dec1, /* First latitude/declination in degrees */
double ra2, /* Second longitude/right ascension in degrees */
double dec2); /* Second latitude/declination in degrees */
double wcsdiff( /* Compute angular distance between 2 sky positions */ double wcsdiff( /* Compute angular distance between 2 sky positions */
double ra1, /* First longitude/right ascension in degrees */ double ra1, /* First longitude/right ascension in degrees */
double dec1, /* First latitude/declination in degrees */ double dec1, /* First latitude/declination in degrees */
double ra2, /* Second longitude/right ascension in degrees */ double ra2, /* Second longitude/right ascension in degrees */
double dec2); /* Second latitude/declination in degrees */ double dec2); /* Second latitude/declination in degrees */
struct WorldCoor* wcsxinit( /* set up a WCS structure from arguments */ struct WorldCoor* wcsxinit( /* set up a WCS structure from arguments */
double cra, /* Center right ascension in degrees */ double cra, /* Center right ascension in degrees */
double cdec, /* Center declination in degrees */ double cdec, /* Center declination in degrees */
double secpix, /* Number of arcseconds per pixel */ double secpix, /* Number of arcseconds per pixel */
skipping to change at line 694 skipping to change at line 709
struct WorldCoor *wcs, /* pointer to WCS descriptor */ struct WorldCoor *wcs, /* pointer to WCS descriptor */
double *xpos, /* Right ascension (returned) */ double *xpos, /* Right ascension (returned) */
double *ypos); /* Declination (returned) */ double *ypos); /* Declination (returned) */
int tnxpix ( /* Inverse transform (world to physical) gnomonic pr ojection */ int tnxpix ( /* Inverse transform (world to physical) gnomonic pr ojection */
double xpos, /* Right ascension */ double xpos, /* Right ascension */
double ypos, /* Declination */ double ypos, /* Declination */
struct WorldCoor *wcs, /* Pointer to WCS descriptor */ struct WorldCoor *wcs, /* Pointer to WCS descriptor */
double *xpix, /* Image X coordinate (returned) */ double *xpix, /* Image X coordinate (returned) */
double *ypix); /* Image Y coordinate (returned) */ double *ypix); /* Image Y coordinate (returned) */
/* IRAF ZPN projection with higher order terms (zpxpos.c) */
int zpxinit ( /* initialize the zenithal forward or inverse transf
orm */
const char *header, /* FITS header */
struct WorldCoor *wcs); /* pointer to WCS structure */
int zpxpos ( /* forward transform (physical to world) */
double xpix, /* Image X coordinate */
double ypix, /* Image Y coordinate */
struct WorldCoor *wcs, /* pointer to WCS descriptor */
double *xpos, /* Right ascension (returned) */
double *ypos); /* Declination (returned) */
int zpxpix ( /* Inverse transform (world to physical) */
double xpos, /* Right ascension */
double ypos, /* Declination */
struct WorldCoor *wcs, /* Pointer to WCS descriptor */
double *xpix, /* Image X coordinate (returned) */
double *ypix); /* Image Y coordinate (returned) */
#else /* K&R prototypes */ #else /* K&R prototypes */
/* WCS subroutines in wcs.c */ /* WCS subroutines in wcs.c */
struct WorldCoor *wcsinit(); /* set up a WCS structure from a FITS image he ader */ struct WorldCoor *wcsinit(); /* set up a WCS structure from a FITS image he ader */
struct WorldCoor *wcsninit(); /* set up a WCS structure from a FITS image h eader */ struct WorldCoor *wcsninit(); /* set up a WCS structure from a FITS image h eader */
struct WorldCoor *wcsinitn(); /* set up a WCS structure from a FITS image h eader */ struct WorldCoor *wcsinitn(); /* set up a WCS structure from a FITS image h eader */
struct WorldCoor *wcsninitn(); /* set up a WCS structure from a FITS image header */ struct WorldCoor *wcsninitn(); /* set up a WCS structure from a FITS image header */
struct WorldCoor *wcsinitc(); /* set up a WCS structure from a FITS image h eader */ struct WorldCoor *wcsinitc(); /* set up a WCS structure from a FITS image h eader */
struct WorldCoor *wcsninitc(); /* set up a WCS structure from a FITS image header */ struct WorldCoor *wcsninitc(); /* set up a WCS structure from a FITS image header */
struct WorldCoor *wcsxinit(); /* set up a WCS structure from arguments */ struct WorldCoor *wcsxinit(); /* set up a WCS structure from arguments */
skipping to change at line 718 skipping to change at line 750
void wcsdeltset(); /* set scaling and rotation from CDELTs and CROTA2 * / void wcsdeltset(); /* set scaling and rotation from CDELTs and CROTA2 * /
void wcspcset(); /* set scaling and rotation from CDELTs and PC matri x */ void wcspcset(); /* set scaling and rotation from CDELTs and PC matri x */
int iswcs(); /* Return 1 if WCS structure is filled, else 0 */ int iswcs(); /* Return 1 if WCS structure is filled, else 0 */
int nowcs(); /* Return 0 if WCS structure is filled, else 1 */ int nowcs(); /* Return 0 if WCS structure is filled, else 1 */
void wcsshift(); /* Reset the center of a WCS structure */ void wcsshift(); /* Reset the center of a WCS structure */
void wcscent(); /* Print the image center and size in WCS un its */ void wcscent(); /* Print the image center and size in WCS un its */
void wcssize(); /* Return RA and Dec of image center, size i n RA and Dec */ void wcssize(); /* Return RA and Dec of image center, size i n RA and Dec */
void wcsfull(); /* Return RA and Dec of image center, size i n degrees */ void wcsfull(); /* Return RA and Dec of image center, size i n degrees */
void wcsrange(); /* Return min and max RA and Dec of image in degrees */ void wcsrange(); /* Return min and max RA and Dec of image in degrees */
double wcsdist(); /* Distance in degrees between two sky coordinates * / double wcsdist(); /* Distance in degrees between two sky coordinates * /
double wcsdist1(); /* Compute angular distance between 2 sky positions */
double wcsdiff(); /* Distance in degrees between two sky coordinates * / double wcsdiff(); /* Distance in degrees between two sky coordinates * /
void wcscominit(); /* Initialize catalog search command set by -wcscom */ void wcscominit(); /* Initialize catalog search command set by -wcscom */
void wcscom(); /* Execute catalog search command set by -wcscom */ void wcscom(); /* Execute catalog search command set by -wcscom */
char *getradecsys(); /* Return current value of coordinate system */ char *getradecsys(); /* Return current value of coordinate system */
void wcsoutinit(); /* Initialize WCS output coordinate system for use b y pix2wcs */ void wcsoutinit(); /* Initialize WCS output coordinate system for use b y pix2wcs */
char *getwcsout(); /* Return current value of WCS output coordinate sys tem */ char *getwcsout(); /* Return current value of WCS output coordinate sys tem */
void wcsininit(); /* Initialize WCS input coordinate system for use by wcs2pix */ void wcsininit(); /* Initialize WCS input coordinate system for use by wcs2pix */
char *getwcsin(); /* Return current value of WCS input coordinate syst em */ char *getwcsin(); /* Return current value of WCS input coordinate syst em */
int setwcsdeg(); /* Set WCS output in degrees (1) or hh:mm:ss dd:mm:s s (0) */ int setwcsdeg(); /* Set WCS output in degrees (1) or hh:mm:ss dd:mm:s s (0) */
int wcsndec(); /* Set or get number of output decimal places */ int wcsndec(); /* Set or get number of output decimal places */
int wcsreset(); /* Change WCS using arguments */ int wcsreset(); /* Change WCS using arguments */
void wcseqset(); /* Change equinox of reference pixel coordinates in WCS */ void wcseqset(); /* Change equinox of reference pixel coordinates in WCS */
void wcscstr(); /* Return system string from system code, eq uinox, epoch */ void wcscstr(); /* Return system string from system code, eq uinox, epoch */
void setwcslin(); /* Set output string mode for LINEAR coordinates */ void setwcslin(); /* Set output string mode for LINEAR coordinates */
int pix2wcst(); /* Convert pixel coordinates to World Coordi nate string */ int pix2wcst(); /* Convert pixel coordinates to World Coordi nate string */
void pix2wcs(); /* Convert pixel coordinates to World Coordi nates */ void pix2wcs(); /* Convert pixel coordinates to World Coordi nates */
void wcsc2pix(); /* Convert World Coordinates to pixel coordinates */ void wcsc2pix(); /* Convert World Coordinates to pixel coordinates */
void wcs2pix(); /* Convert World Coordinates to pixel coordi nates */ void wcs2pix(); /* Convert World Coordinates to pixel coordi nates */
void setdefwcs(); /* Call to use AIPS classic WCS (also not PLT or TNX */ void setdefwcs(); /* Call to use AIPS classic WCS (also not PLT/TNX/ZP X */
int getdefwcs(); /* Call to get flag for AIPS classic WCS */ int getdefwcs(); /* Call to get flag for AIPS classic WCS */
int wcszin(); /* Set coordinate in third dimension (face) */ int wcszin(); /* Set coordinate in third dimension (face) */
int wcszout(); /* Return coordinate in third dimension */ int wcszout(); /* Return coordinate in third dimension */
void wcserr(); /* Print WCS error message to stderr */ void wcserr(); /* Print WCS error message to stderr */
void setwcserr(); /* Set WCS error message for later printing */ void setwcserr(); /* Set WCS error message for later printing */
void savewcscoor(); /* Save output coordinate system */ void savewcscoor(); /* Save output coordinate system */
char *getwcscoor(); /* Return output coordinate system */ char *getwcscoor(); /* Return output coordinate system */
void savewcscom(); /* Save WCS shell command */ void savewcscom(); /* Save WCS shell command */
char *getwcscom(); /* Return WCS shell command */ char *getwcscom(); /* Return WCS shell command */
void setwcscom(); /* Set WCS shell commands from stored values */ void setwcscom(); /* Set WCS shell commands from stored values */
skipping to change at line 794 skipping to change at line 827
extern int platepix(); /* Convert from RA,Dec to pixel location */ extern int platepix(); /* Convert from RA,Dec to pixel location */
extern void SetFITSPlate(); /* Set FITS header plate fit coefficients from structure */ extern void SetFITSPlate(); /* Set FITS header plate fit coefficients from structure */
extern int SetPlate(); /* Set plate fit coefficients in structure from argu ments */ extern int SetPlate(); /* Set plate fit coefficients in structure from argu ments */
extern int GetPlate(); /* Return plate fit coefficients from structure in a rguments */ extern int GetPlate(); /* Return plate fit coefficients from structure in a rguments */
/* IRAF TAN projection with higher order terms (tnxpos.c) */ /* IRAF TAN projection with higher order terms (tnxpos.c) */
extern int tnxinit(); /* initialize the gnomonic forward or inverse transf orm */ extern int tnxinit(); /* initialize the gnomonic forward or inverse transf orm */
extern int tnxpos(); /* forward transform (physical to world) gnomonic pr ojection. */ extern int tnxpos(); /* forward transform (physical to world) gnomonic pr ojection. */
extern int tnxpix(); /* Inverse transform (world to physical) gnomonic pr ojection */ extern int tnxpix(); /* Inverse transform (world to physical) gnomonic pr ojection */
/* IRAF ZPN projection with higher order terms (zpxpos.c) */
extern int zpxinit(); /* initialize the gnomonic forward or inverse transf
orm */
extern int zpxpos(); /* forward transform (physical to world) gnomonic pr
ojection. */
extern int zpxpix(); /* Inverse transform (world to physical) gnomonic pr
ojection */
#endif /* __STDC__ */ #endif /* __STDC__ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _wcs_h_ */ #endif /* _wcs_h_ */
/* Oct 26 1994 New file /* Oct 26 1994 New file
* Dec 21 1994 Add rotation matrix * Dec 21 1994 Add rotation matrix
skipping to change at line 916 skipping to change at line 954
* Nov 29 2006 Drop semicolon at end of C++ ifdef * Nov 29 2006 Drop semicolon at end of C++ ifdef
* Dec 21 2006 Add cpwcs() * Dec 21 2006 Add cpwcs()
* *
* Jan 4 2007 Drop extra declaration of wcscstr() * Jan 4 2007 Drop extra declaration of wcscstr()
* Jan 4 2007 Fix declarations so ANSI prototypes are not just for C++ * Jan 4 2007 Fix declarations so ANSI prototypes are not just for C++
* Jan 9 2007 Add fk425e() and fk524e() subroutines * Jan 9 2007 Add fk425e() and fk524e() subroutines
* Jan 9 2007 Add worldpos.c, dsspos.c, platepos.c, and tnxpos.c subroutin es * Jan 9 2007 Add worldpos.c, dsspos.c, platepos.c, and tnxpos.c subroutin es
* Jan 10 2007 Add ANSI prototypes for all subroutines * Jan 10 2007 Add ANSI prototypes for all subroutines
* Feb 1 2007 Add wcs.wcslog for log wavelength * Feb 1 2007 Add wcs.wcslog for log wavelength
* Jul 25 2007 Add v2s3(), s2v3(), d2v3(), v2d3() for coordinate-vector con version * Jul 25 2007 Add v2s3(), s2v3(), d2v3(), v2d3() for coordinate-vector con version
*
* Mar 31 2010 Add wcsdist1(), an alternate method
* Apr 07 2010 Add NWCSTYPE to keep it aligned with actual number of WCS ty
pes
*
* Mar 11 2011 Add NOAO ZPX projection parameters and subroutines (Frank Va
ldes)
* Mar 14 2011 Add SCAMP polynomial projection coefficients
*/ */
 End of changes. 15 change blocks. 
6 lines changed or deleted 62 lines changed or added


 wcscat.h   wcscat.h 
/*** File libwcs/wcscat.h /*** File libwcs/wcscat.h
*** November 2, 2009 *** April 06, 2010
*** By Doug Mink, dmink@cfa.harvard.edu *** By Doug Mink, dmink@cfa.harvard.edu
*** Copyright (C) 1998-2009 *** Copyright (C) 1998-2010
*** Smithsonian Astrophysical Observatory, Cambridge, MA, USA *** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
skipping to change at line 1333 skipping to change at line 1333
int *ival); /* Integer value, returned */ int *ival); /* Integer value, returned */
int agetr8( /* Extract double value from keyword= value in string */ int agetr8( /* Extract double value from keyword= value in string */
char *string, /* character string containing <keyword>= <value> */ char *string, /* character string containing <keyword>= <value> */
char *keyword, /* character string containing the name of the keywo rd */ char *keyword, /* character string containing the name of the keywo rd */
double *dval); /* Double value, returned */ double *dval); /* Double value, returned */
int agets( /* Extract value from keyword= value in string */ int agets( /* Extract value from keyword= value in string */
char *string, /* character string containing <keyword>= <value> */ char *string, /* character string containing <keyword>= <value> */
char *keyword, /* character string containing the name of the keywo rd */ char *keyword, /* character string containing the name of the keywo rd */
int lval, /* Size of value in characters int lval, /* Size of value in characters
* If negative, value ends at end of line */ * If negative, value ends at end of line */
int fillblank, /* If 0, leave blanks, strip trailing blanks
if non-zero, replace blanks with underscores */
char *value); /* String (returned) */ char *value); /* String (returned) */
int tmcid( /* Return 1 if string is 2MASS ID, else 0 */ int tmcid( /* Return 1 if string is 2MASS ID, else 0 */
char *string, /* Character string to check */ char *string, /* Character string to check */
double *ra, /* Right ascension (returned) */ double *ra, /* Right ascension (returned) */
double *dec); /* Declination (returned) */ double *dec); /* Declination (returned) */
/* Subroutines for VOTable output */ /* Subroutines for VOTable output */
int vothead( /* Print heading for VOTable SCAT output */ int vothead( /* Print heading for VOTable SCAT output */
int refcat, /* Catalog code */ int refcat, /* Catalog code */
skipping to change at line 1685 skipping to change at line 1687
* *
* Jan 10 2006 Add ANSI C function prototypes * Jan 10 2006 Add ANSI C function prototypes
* Jan 11 2007 Move token access subroutines to fileutil.c/fitsfile.h * Jan 11 2007 Move token access subroutines to fileutil.c/fitsfile.h
* Mar 13 2007 Add gsc2c2t() to convert CSV GSC2 buffer to TSV table * Mar 13 2007 Add gsc2c2t() to convert CSV GSC2 buffer to TSV table
* Mar 13 2007 Add gobj object name to gsc2read() * Mar 13 2007 Add gobj object name to gsc2read()
* Jul 5 2007 Add SKYBOT=31 to catalog list * Jul 5 2007 Add SKYBOT=31 to catalog list
* Jul 13 2007 Add skybotread() and skybot2tab() * Jul 13 2007 Add skybotread() and skybot2tab()
* Jul 18 2007 Add tabccol() and PM_ARCSECHR for SkyBot * Jul 18 2007 Add tabccol() and PM_ARCSECHR for SkyBot
* Nov 28 2007 Add moveb() which used to be local to binread() * Nov 28 2007 Add moveb() which used to be local to binread()
* *
* Oct 24 2008 Add gsct2t() to clean up tab-separated table from STScI * Oct 24 2008 Add gsct2t() to clean up tab-separated table from STScI CASB
CASB
* *
* Sep 25 2009 Rename moveb() to movebuff() * Sep 25 2009 Rename moveb() to movebuff()
* Sep 25 2009 Add UCAC3 as catalog code 32 * Sep 25 2009 Add UCAC3 as catalog code 32
* Oct 30 2009 Add position and proper motion error to star structure * Oct 30 2009 Add position and proper motion error to star structure
* Nov 2 2009 Add numbers of images and catalogs to star structure * Nov 2 2009 Add numbers of images and catalogs to star structure
* Nov 3 2009 Parameterize as MAXNMAG the maximum number of magnitudes * Nov 3 2009 Parameterize as MAXNMAG the maximum number of magnitudes
*
* Apr 06 2010 Add fillblank argument to agets()
*/ */
 End of changes. 5 change blocks. 
4 lines changed or deleted 7 lines changed or added


 wcslib.h   wcslib.h 
skipping to change at line 45 skipping to change at line 45
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#if !defined(__STDC__) && !defined(__cplusplus) #if !defined(__STDC__) && !defined(__cplusplus)
#ifndef const #ifndef const
#define const #define const
#endif #endif
#endif #endif
#define MAXPV 100
#define WCS_NGRIDPOINTS 12 /* Number of WCS grid points / axis
*/
#define WCS_NGRIDPOINTS2 (WCS_NGRIDPOINTS*WCS_NGRIDPOINTS)
#define WCS_INVMAXDEG 9 /* Maximum inversion polynom degree
*/
#define WCS_INVACCURACY 0.04 /* Maximum inversion error (pixels)
*/
#define WCS_NRANGEPOINTS 32 /* Number of WCS range points / axis
*/
#ifndef PI
#define PI 3.1415926535898 /* never met before? */
#endif
/* DEG/ARCSEC is now D2S and ARCSEC/DEG is S2D */
/* #define DEG (PI/180.0) 1 deg in radians */
/* #define ARCSEC (DEG/3600.0) 1 arcsec in radians */
#define NAXISPV 2
/* poly.h
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%
* Part of: A program using polynomial fits
* Author: E.BERTIN (IAP)
* Contents: Include for poly.c
* Last modified: 03/03/2004
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%
*/
#ifndef _POLY_H_
#define _POLY_H_
/*--------------------------------- constants -----------------------------
--*/
#define POLY_MAXDIM 4 /* Max dimensionality of polynom */
#define POLY_MAXDEGREE 10 /* Max degree of the polynom */
/*---------------------------------- macros -------------------------------
--*/
/*--------------------------- structure definitions -----------------------
--*/
typedef struct poly
{
double *basis; /* Current values of the basis functions */
double *coeff; /* Polynom coefficients */
int ncoeff; /* Number of coefficients */
int *group; /* Groups */
int ndim; /* dimensionality of the polynom */
int *degree; /* Degree in each group */
int ngroup; /* Number of different groups */
} polystruct;
/*---------------------------------- protos -------------------------------
-*/
extern polystruct *poly_init(int *group,int ndim,int *degree,int ngro
up);
extern double poly_func(polystruct *poly, double *pos);
extern int cholsolve(double *a, double *b, int n),
*poly_powers(polystruct *poly);
extern void poly_addcste(polystruct *poly, double *cste),
poly_end(polystruct *poly),
poly_fit(polystruct *poly, double *x, double *y,
double *w, int ndata, double *extbasis),
poly_solve(double *a, double *b, int n),
svdsolve(double *a, double *b, int m, int n,
double *vmat, double *wmat);
#endif
extern int npcode; extern int npcode;
extern char pcodes[26][4]; extern char pcodes[26][4];
struct prjprm { struct prjprm {
char code[4]; char code[4];
int flag; int flag;
double phi0, theta0; double phi0, theta0;
double r0; double r0;
double p[10]; double p[10];
double w[20]; double w[20];
int n; int n;
int npv;
double ppv[2*MAXPV];
struct poly *inv_x;
struct poly *inv_y;
#if __STDC__ || defined(__cplusplus) #if __STDC__ || defined(__cplusplus)
int (*prjfwd)(const double, const double, int (*prjfwd)(const double, const double,
struct prjprm *, struct prjprm *,
double *, double *); double *, double *);
int (*prjrev)(const double, const double, int (*prjrev)(const double, const double,
struct prjprm *, struct prjprm *,
double *, double *); double *, double *);
#else #else
int (*prjfwd)(); int (*prjfwd)();
skipping to change at line 152 skipping to change at line 222
int pcorev(const double, const double, struct prjprm *, double *, double *); int pcorev(const double, const double, struct prjprm *, double *, double *);
int tscset(struct prjprm *); int tscset(struct prjprm *);
int tscfwd(const double, const double, struct prjprm *, double *, double *); int tscfwd(const double, const double, struct prjprm *, double *, double *);
int tscrev(const double, const double, struct prjprm *, double *, double *); int tscrev(const double, const double, struct prjprm *, double *, double *);
int cscset(struct prjprm *); int cscset(struct prjprm *);
int cscfwd(const double, const double, struct prjprm *, double *, double *); int cscfwd(const double, const double, struct prjprm *, double *, double *);
int cscrev(const double, const double, struct prjprm *, double *, double *); int cscrev(const double, const double, struct prjprm *, double *, double *);
int qscset(struct prjprm *); int qscset(struct prjprm *);
int qscfwd(const double, const double, struct prjprm *, double *, double *); int qscfwd(const double, const double, struct prjprm *, double *, double *);
int qscrev(const double, const double, struct prjprm *, double *, double *); int qscrev(const double, const double, struct prjprm *, double *, double *);
int raw_to_pv(struct prjprm *prj, double x, double y, double *xo, double *yo);
#else #else
int prjset(), prjfwd(), prjrev(); int prjset(), prjfwd(), prjrev();
int azpset(), azpfwd(), azprev(); int azpset(), azpfwd(), azprev();
int szpset(), szpfwd(), szprev(); int szpset(), szpfwd(), szprev();
int tanset(), tanfwd(), tanrev(); int tanset(), tanfwd(), tanrev();
int stgset(), stgfwd(), stgrev(); int stgset(), stgfwd(), stgrev();
int sinset(), sinfwd(), sinrev(); int sinset(), sinfwd(), sinrev();
int arcset(), arcfwd(), arcrev(); int arcset(), arcfwd(), arcrev();
int zpnset(), zpnfwd(), zpnrev(); int zpnset(), zpnfwd(), zpnrev();
int zeaset(), zeafwd(), zearev(); int zeaset(), zeafwd(), zearev();
skipping to change at line 180 skipping to change at line 251
int aitset(), aitfwd(), aitrev(); int aitset(), aitfwd(), aitrev();
int copset(), copfwd(), coprev(); int copset(), copfwd(), coprev();
int coeset(), coefwd(), coerev(); int coeset(), coefwd(), coerev();
int codset(), codfwd(), codrev(); int codset(), codfwd(), codrev();
int cooset(), coofwd(), coorev(); int cooset(), coofwd(), coorev();
int bonset(), bonfwd(), bonrev(); int bonset(), bonfwd(), bonrev();
int pcoset(), pcofwd(), pcorev(); int pcoset(), pcofwd(), pcorev();
int tscset(), tscfwd(), tscrev(); int tscset(), tscfwd(), tscrev();
int cscset(), cscfwd(), cscrev(); int cscset(), cscfwd(), cscrev();
int qscset(), qscfwd(), qscrev(); int qscset(), qscfwd(), qscrev();
int raw_to_pv();
#endif #endif
extern const char *prjset_errmsg[]; extern const char *prjset_errmsg[];
extern const char *prjfwd_errmsg[]; extern const char *prjfwd_errmsg[];
extern const char *prjrev_errmsg[]; extern const char *prjrev_errmsg[];
#define PRJSET 137 #define PRJSET 137
struct celprm { struct celprm {
int flag; int flag;
skipping to change at line 341 skipping to change at line 413
#endif #endif
#ifdef SQRT2 #ifdef SQRT2
#undef SQRT2 #undef SQRT2
#endif #endif
#ifdef SQRT2INV #ifdef SQRT2INV
#undef SQRT2INV #undef SQRT2INV
#endif #endif
#define PI 3.141592653589793238462643 #ifdef D2S
#define D2R PI/180.0 #undef D2S
#define R2D 180.0/PI #endif
#define SQRT2 1.4142135623730950488
#ifdef S2D
#undef S2D
#endif
#define PI 3.141592653589793238462643
#define D2R PI/180.0
#define R2D 180.0/PI
#define S2D 1.0/3600.0
#define D2S 3600.0
#define SQRT2 1.4142135623730950488
#define SQRT2INV 1.0/SQRT2 #define SQRT2INV 1.0/SQRT2
#if !defined(__STDC__) && !defined(__cplusplus) #if !defined(__STDC__) && !defined(__cplusplus)
#ifndef const #ifndef const
#define const #define const
#endif #endif
#endif #endif
#if __STDC__ || defined(__cplusplus) #if __STDC__ || defined(__cplusplus)
double cosdeg(const double); double cosdeg(const double);
skipping to change at line 388 skipping to change at line 470
#endif /* wcslib_h_ */ #endif /* wcslib_h_ */
/* Feb 3 2000 Doug Mink - Make cplusplus ifdefs for braces all-inclusive /* Feb 3 2000 Doug Mink - Make cplusplus ifdefs for braces all-inclusive
* *
* Feb 15 2001 Doug Mink - Undefine math constants if already defined * Feb 15 2001 Doug Mink - Undefine math constants if already defined
* Sep 19 2001 Doug Mink - Update for WCSLIB 2.7, especially proj.h and cel .h * Sep 19 2001 Doug Mink - Update for WCSLIB 2.7, especially proj.h and cel .h
* *
* Mar 12 2002 Doug Mink - Update for WCSLIB 2.8.2, especially proj.h * Mar 12 2002 Doug Mink - Update for WCSLIB 2.8.2, especially proj.h
* Nov 29 2006 Doug Mink - Drop semicolon at end of C++ ifdef * Nov 29 2006 Doug Mink - Drop semicolon at end of C++ ifdef
* Jan 4 2007 Doug Mink - Drop extra declarations of SZP subroutines * Jan 4 2007 Doug Mink - Drop extra declarations of SZP subroutines
*
* Mar 30 2011 Doug Mink - Add raw_to_pv() subroutine for SCAMP from Ed Los
*/ */
 End of changes. 6 change blocks. 
4 lines changed or deleted 99 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/