fitsfile.h   fitsfile.h 
/*** File fitsfile.h FITS and IRAF file access subroutines /*** File fitsfile.h FITS and IRAF file access subroutines
*** January 9, 2007 *** January 11, 2007
*** 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) 1996-2007 *** Copyright (C) 1996-2007
*** 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.
skipping to change at line 37 skipping to change at line 37
Cambridge, MA 02138 USA Cambridge, MA 02138 USA
*/ */
#ifndef fitsfile_h_ #ifndef fitsfile_h_
#define fitsfile_h_ #define fitsfile_h_
#include "fitshead.h" #include "fitshead.h"
/* Declarations for subroutines in fitsfile.c, imhfile.c, imio.c, /* Declarations for subroutines in fitsfile.c, imhfile.c, imio.c,
* fileutil.c, and dateutil.c */ * fileutil.c, and dateutil.c */
#define FITSBLOCK 2880
/* FITS table keyword structure */ /* FITS table keyword structure */
struct Keyword { struct Keyword {
char kname[10]; /* Keyword for table entry */ char kname[10]; /* Keyword for table entry */
int lname; /* Length of keyword name */ int lname; /* Length of keyword name */
int kn; /* Index of entry on line */ int kn; /* Index of entry on line */
int kf; /* Index in line of first character of entry */ int kf; /* Index in line of first character of entry */
int kl; /* Length of entry value */ int kl; /* Length of entry value */
}; };
#define FITSBLOCK 2880 /* Structure for access to tokens within a string */
#define MAXTOKENS 1000 /* Maximum number of tokens to parse */
#define MAXWHITE 20 /* Maximum number of different whitespace character
s */
struct Tokens {
char *line; /* Line which has been parsed */
int lline; /* Number of characters in line */
int ntok; /* Number of tokens on line */
int nwhite; /* Number of whitespace characters */
char white[MAXWHITE]; /* Whitespace (separator) characters */
char *tok1[MAXTOKENS]; /* Pointers to start of tokens */
int ltok[MAXTOKENS]; /* Lengths of tokens */
int itok; /* Current token number */
};
#ifdef __cplusplus /* C++ prototypes */ #ifdef __cplusplus /* C++ prototypes */
extern "C" { extern "C" {
#endif #endif
#ifdef __STDC__ /* Full ANSI prototypes */ #ifdef __STDC__ /* Full ANSI prototypes */
/* Declarations for subroutines in fitsfile.c, imhfile.c, imio.c, /* Declarations for subroutines in fitsfile.c, imhfile.c, imio.c,
* fileutil.c, and dateutil.c */ * fileutil.c, and dateutil.c */
skipping to change at line 395 skipping to change at line 409
FILE *diskfile, /* File descriptor for ASCII file */ FILE *diskfile, /* File descriptor for ASCII file */
int ncmax, /* Maximum number of characters returned */ int ncmax, /* Maximum number of characters returned */
char *token); /* First token on next line (returned) */ char *token); /* First token on next line (returned) */
int stc2s ( /* Replace character in string with space */ int stc2s ( /* Replace character in string with space */
char *spchar, /* Character to replace with spaces */ char *spchar, /* Character to replace with spaces */
char *string); /* Character string to process */ char *string); /* Character string to process */
int sts2c ( /* Replace spaces in string with character * / int sts2c ( /* Replace spaces in string with character * /
char *spchar, /* Character with which to replace spaces */ char *spchar, /* Character with which to replace spaces */
char *string); /* Character string to process */ char *string); /* Character string to process */
/* Subroutines for access to tokens within a string from fileutil.c */
int setoken( /* Tokenize a string for easy decoding */
struct Tokens *tokens, /* Token structure returned */
char *string, /* character string to tokenize */
char *cwhite); /* additional whitespace characters
* if = tab, disallow spaces and commas */
int nextoken( /* Get next token from tokenized string */
struct Tokens *tokens, /* Token structure returned */
char *token, /* token (returned) */
int maxchars); /* Maximum length of token */
int getoken( /* Get specified token from tokenized string */
struct Tokens *tokens, /* Token structure returned */
int itok, /* token sequence number of token
* if <0, get whole string after token -itok
* if =0, get whole string */
char *token, /* token (returned) */
int maxchars); /* Maximum length of token */
/* Subroutines for translating dates and times in dateutil.c */ /* Subroutines for translating dates and times in dateutil.c */
/* Subroutines to convert from year and day of year */ /* Subroutines to convert from year and day of year */
void doy2dt( /* Year and day of year to yyyy.mmdd hh.mmss */ void doy2dt( /* Year and day of year to yyyy.mmdd hh.mmss */
int year, /* Year */ int year, /* Year */
double doy, /* Day of year with fraction */ double doy, /* Day of year with fraction */
double *date, /* Date as yyyy.mmdd (returned) */ double *date, /* Date as yyyy.mmdd (returned) */
double *time); /* Time as hh.mmssxxxx (returned) */ double *time); /* Time as hh.mmssxxxx (returned) */
double doy2ep( /* Year and day of year to fractional year (epoch) * / double doy2ep( /* Year and day of year to fractional year (epoch) * /
skipping to change at line 967 skipping to change at line 999
extern int getfilesize(); extern int getfilesize();
extern int isimlist(); extern int isimlist();
extern int isimlistd(); extern int isimlistd();
extern int isfilelist(); extern int isfilelist();
extern int isfile(); extern int isfile();
extern int istiff(); extern int istiff();
extern int isjpeg(); extern int isjpeg();
extern int isgif(); extern int isgif();
extern int first_token(); extern int first_token();
/* Subroutines for access to tokens within a string from fileutil.c */
int setoken(); /* Tokenize a string for easy decoding */
int nextoken(); /* Get next token from tokenized string */
int getoken(); /* Get specified token from tokenized string */
/* Subroutines for translating dates and times in dateutil.c */ /* Subroutines for translating dates and times in dateutil.c */
void doy2dt(); /* year and day of year to yyyy.mmdd hh.mmss */ void doy2dt(); /* year and day of year to yyyy.mmdd hh.mmss */
double doy2ep(); /* year and day of year to fractional year (epoch) */ double doy2ep(); /* year and day of year to fractional year (epoch) */
double doy2epb(); /* year and day of year to Besselian epoch */ double doy2epb(); /* year and day of year to Besselian epoch */
double doy2epj(); /* year and day of year to Julian epoch */ double doy2epj(); /* year and day of year to Julian epoch */
char *doy2fd(); /* year and day of year to FITS date */ char *doy2fd(); /* year and day of year to FITS date */
double doy2jd(); /* year and day of year to Julian date */ double doy2jd(); /* year and day of year to Julian date */
double doy2mjd(); /* year and day of year to modified Julian date */ double doy2mjd(); /* year and day of year to modified Julian date */
double doy2ts(); /* year and day of year to seconds since 1950.0 */ double doy2ts(); /* year and day of year to seconds since 1950.0 */
skipping to change at line 1203 skipping to change at line 1240
* Aug 27 2004 Add fitsheadsize() * Aug 27 2004 Add fitsheadsize()
* *
* Oct 14 2005 Add tsd2fd(), tsd2dt(), epj2ep(), epb2ep(), tsi2dt() * Oct 14 2005 Add tsd2fd(), tsd2dt(), epj2ep(), epb2ep(), tsi2dt()
* *
* Feb 23 2006 Add fitsrtail() to read appended FITS header * Feb 23 2006 Add fitsrtail() to read appended FITS header
* Feb 23 2006 Add istiff(), isjpeg(), isgif() to check TIFF, JPEG, GIF fil es * Feb 23 2006 Add istiff(), isjpeg(), isgif() to check TIFF, JPEG, GIF fil es
* Sep 6 2006 Add heliocentric time conversions * Sep 6 2006 Add heliocentric time conversions
* Oct 5 2006 Add local sidereal time conversions * Oct 5 2006 Add local sidereal time conversions
* *
* Jan 9 2007 Add ANSI prototypes * Jan 9 2007 Add ANSI prototypes
* Jan 11 2007 Add token subroutines from catutil.c/wcscat.h to fileutil.c
*/ */
 End of changes. 6 change blocks. 
2 lines changed or deleted 41 lines changed or added


 imio.h   imio.h 
/*** imio.h memory access subroutines /*** imio.h memory access subroutines
*** January 5, 2007 *** September 27, 1999
*** 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) 1996-2007 *** Copyright (C) 1996-2002
*** 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 34 skipping to change at line 34
Postal address: Doug Mink Postal address: Doug Mink
Smithsonian Astrophysical Observatory Smithsonian Astrophysical Observatory
60 Garden St. 60 Garden St.
Cambridge, MA 02138 USA Cambridge, MA 02138 USA
*/ */
#ifndef imio_h_ #ifndef imio_h_
#define imio_h_ #define imio_h_
/* Image pixel access subroutines in imio.c */ /* Image pixel access subroutines in imio.c */
#ifdef __cplusplus /* C++ prototypes */
extern "C" {
#endif
#ifdef __STDC__ /* Full ANSI prototypes */
/* Image pixel access subroutines in imio.c */
double getpix( /* Read one pixel from any data type 2-D array (0,0)
*/
char *image, /* Image array as 1-D vector */
int bitpix, /* FITS bits per pixel
* 16 = short, -16 = unsigned short, 32 = int
* -32 = float, -64 = double */
int w, /* Image width in pixels */
int h, /* Image height in pixels */
double bzero, /* Zero point for pixel scaling */
double bscale, /* Scale factor for pixel scaling */
int x, /* Zero-based horizontal pixel number */
int y); /* Zero-based vertical pixel number */
double getpix1( /* Read one pixel from any data type 2-D array (1,1)
*/
char *image, /* Image array as 1-D vector */
int bitpix, /* FITS bits per pixel */
int w, /* Image width in pixels */
int h, /* Image height in pixels */
double bzero, /* Zero point for pixel scaling */
double bscale, /* Scale factor for pixel scaling */
int x, /* One-based horizontal pixel number */
int y); /* One-based vertical pixel number */
double maxvec( /* Get maximum value in vector from a image */
char *image, /* Image array from which to extract vector */
int bitpix, /* Number of bits per pixel in image */
double bzero, /* Zero point for pixel scaling */
double bscale, /* Scale factor for pixel scaling */
int pix1, /* Offset of first pixel to extract */
int npix); /* Number of pixels to extract */
void putpix( /* Write one pixel to any data type 2-D array (0,0)*
/
char *image, /* Image array as 1-D vector */
int bitpix, /* FITS bits per pixel */
int w, /* Image width in pixels */
int h, /* Image height in pixels */
double bzero, /* Zero point for pixel scaling */
double bscale, /* Scale factor for pixel scaling */
int x, /* Zero-based horizontal pixel number */
int y, /* Zero-based vertical pixel number */
double dpix); /* Value to put into image pixel */
void putpix1( /* Write one pixel to any data type 2-D array (1,1)
*/
char *image, /* Image array as 1-D vector */
int bitpix, /* FITS bits per pixel */
int w, /* Image width in pixels */
int h, /* Image height in pixels */
double bzero, /* Zero point for pixel scaling */
double bscale, /* Scale factor for pixel scaling */
int x, /* One-based horizontal pixel number */
int y, /* One-based vertical pixel number */
double dpix); /* Value to put into image pixel */
void addpix( /* Add to one pixel in any data type 2-D array (0,0)
*/
char *image, /* Image array as 1-D vector */
int bitpix, /* FITS bits per pixel */
int w, /* Image width in pixels */
int h, /* Image height in pixels */
double bzero, /* Zero point for pixel scaling */
double bscale, /* Scale factor for pixel scaling */
int x, /* Zero-based horizontal pixel number */
int y, /* Zero-based vertical pixel number */
double dpix); /* Value to add to image pixel */
void addpix1( /* Add to one pixel in any data type 2-D array (1,1)
*/
char *image, /* Image array as 1-D vector */
int bitpix, /* FITS bits per pixel */
int w, /* Image width in pixels */
int h, /* Image height in pixels */
double bzero, /* Zero point for pixel scaling */
double bscale, /* Scale factor for pixel scaling */
int x, /* One-based horizontal pixel number */
int y, /* One-based vertical pixel number */
double dpix); /* Value to add to image pixel */
void movepix( /* Move one pixel value between two 2-D arrays (0,0)
*/
char *image1, /* Pointer to first pixel in input image */
int bitpix1, /* Bits per input pixel (FITS codes) */
int w1, /* Number of horizontal pixels in input image */
int x1, /* Zero-based row for input pixel */
int y1, /* Zero-based column for input pixel */
char *image2, /* Pointer to first pixel in output image */
int bitpix2, /* Bits per output pixel (FITS codes) */
int w2, /* Number of horizontal pixels in output image */
int x2, /* Zero-based row for output pixel */
int y2); /* Zero-based column for output pixel */
void movepix1( /* Move one pixel value between two 2-D arrays (1,1)
*/
char *image1, /* Pointer to first pixel in input image */
int bitpix1, /* Bits per input pixel (FITS codes) */
int w1, /* Number of horizontal pixels in input image */
int x1, /* One-based row for input pixel */
int y1, /* One-based column for input pixel */
char *image2, /* Pointer to first pixel in output image */
int bitpix2, /* Bits per output pixel (FITS codes) */
int w2, /* Number of horizontal pixels in output image */
int x2, /* One-based row for output pixel */
int y2); /* One-based column for output pixel */
/* Image vector processing subroutines in imio.c */
void addvec( /* Add constant to vector from 2-D array */
char *image, /* Image array as 1-D vector */
int bitpix, /* FITS bits per pixel */
double bzero, /* Zero point for pixel scaling */
double bscale, /* Scale factor for pixel scaling */
int pix1, /* Offset of first pixel to which to add */
int npix, /* Number of pixels to which to add */
double dpix); /* Value to add to pixels */
void multvec( /* Multiply vector from 2-D array by a constant */
char *image, /* Image array as 1-D vector */
int bitpix, /* FITS bits per pixel */
double bzero, /* Zero point for pixel scaling */
double bscale, /* Scale factor for pixel scaling */
int pix1, /* Offset of first pixel to multiply */
int npix, /* Number of pixels to multiply */
double dpix); /* Value to add to pixels */
void getvec( /* Read vector from 2-D array */
char *image, /* Image array as 1-D vector */
int bitpix, /* FITS bits per pixel */
double bzero, /* Zero point for pixel scaling */
double bscale, /* Scale factor for pixel scaling */
int pix1, /* Offset of first pixel to extract */
int npix, /* Number of pixels to extract */
double *dvec0); /* Vector of pixels (returned) */
void putvec( /* Write vector into 2-D array */
char *image, /* Image array as 1-D vector */
int bitpix, /* FITS bits per pixel */
double bzero, /* Zero point for pixel scaling */
double bscale, /* Scale factor for pixel scaling */
int pix1, /* Offset of first pixel to insert */
int npix, /* Number of pixels to insert */
double *dvec0); /* Vector of pixels to insert */
void fillvec( /* Write constant into a vector */
char *image, /* Image array as 1-D vector */
int bitpix, /* FITS bits per pixel */
double bzero, /* Zero point for pixel scaling */
double bscale, /* Scale factor for pixel scaling */
int pix1, /* Zero-based offset of first pixel to multiply */
int npix, /* Number of pixels to multiply */
double dpix); /* Value to which to set pixels */
void fillvec1( /* Write constant into a vector */
char *image, /* Image array as 1-D vector */
int bitpix, /* FITS bits per pixel */
double bzero, /* Zero point for pixel scaling */
double bscale, /* Scale factor for pixel scaling */
int pix1, /* One-based offset of first pixel to multiply */
int npix, /* Number of pixels to multiply */
double dpix); /* Value to which to set pixels */
/* Image pixel byte-swapping subroutines in imio.c */
void imswap( /* Swap alternating bytes in a vector */
int bitpix, /* Number of bits per pixel */
char *string, /* Address of starting point of bytes to swap */
int nbytes); /* Number of bytes to swap */
void imswap2( /* Swap bytes in a vector of 2-byte (short) integers
*/
char *string, /* Address of starting point of bytes to swap */
int nbytes); /* Number of bytes to swap */
void imswap4( /* Reverse bytes in a vector of 4-byte numbers */
char *string, /* Address of starting point of bytes to swap */
int nbytes); /* Number of bytes to swap */
void imswap8( /* Reverse bytes in a vector of 8-byte numbers */
char *string, /* Address of starting point of bytes to swap */
int nbytes); /* Number of bytes to swap */
int imswapped(); /* Return 1 if machine byte order is not FITS order
*/
#else /* __STDC__ */ /* K&R declarations */
extern double getpix(); /* Read one pixel from any data type 2-D array (0,0 )*/ extern double getpix(); /* Read one pixel from any data type 2-D array (0,0 )*/
extern double getpix1(); /* Read one pixel from any data type 2-D array (1, 1)*/ extern double getpix1(); /* Read one pixel from any data type 2-D array (1, 1)*/
extern void putpix(); /* Write one pixel to any data type 2-D array (0,0) */ extern void putpix(); /* Write one pixel to any data type 2-D array (0,0) */
extern void putpix1(); /* Write one pixel to any data type 2-D array (1,1) */ extern void putpix1(); /* Write one pixel to any data type 2-D array (1,1) */
extern void addpix(); /* Add to one pixel in any data type 2-D array (0,0 )*/ extern void addpix(); /* Add to one pixel in any data type 2-D array (0,0 )*/
extern void addpix1(); /* Add to one pixel in any data type 2-D array (1,1 )*/ extern void addpix1(); /* Add to one pixel in any data type 2-D array (1,1 )*/
extern void movepix(); /* Move one pixel value between two 2-D arrays (0,0 ) */ extern void movepix(); /* Move one pixel value between two 2-D arrays (0,0 ) */
extern void movepix1(); /* Move one pixel value between two 2-D arrays (1,1 ) */ extern void movepix1(); /* Move one pixel value between two 2-D arrays (1,1 ) */
extern void getvec(); /* Read vector from a 2-D array */ extern void getvec(); /* Read vector from a 2-D array */
extern void putvec(); /* Write vector into a 2-D array */ extern void putvec(); /* Write vector into a 2-D array */
extern void fillvec(); /* Write constant into a vector */ extern void fillvec(); /* Write constant into a vector */
extern void fillvec1(); /* Write constant into a vector */ extern void fillvec1(); /* Write constant into a vector */
extern void imswap(); /* Swap alternating bytes in a vector */ extern void imswap(); /* Swap alternating bytes in a vector */
extern void imswap2(); /* Swap bytes in a vector of 2-byte (short) integer s */ extern void imswap2(); /* Swap bytes in a vector of 2-byte (short) integer s */
extern void imswap4(); /* Reverse bytes in a vector of 4-byte numbers */ extern void imswap4(); /* Reverse bytes in a vector of 4-byte numbers */
extern void imswap8(); /* Reverse bytes in a vector of 8-byte numbers */ extern void imswap8(); /* Reverse bytes in a vector of 8-byte numbers */
extern int imswapped(); /* Return 1 if machine byte order is not FITS order */ extern int imswapped(); /* Return 1 if machine byte order is not FITS order */
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* imio_h_ */ #endif /* imio_h_ */
/* May 31 1996 Use stream I/O for reading as well as writing /* May 31 1996 Use stream I/O for reading as well as writing
* Jun 12 1996 Add byte-swapping subroutines * Jun 12 1996 Add byte-swapping subroutines
* Aug 6 1996 Add MOVEPIX, HDEL and HCHANGE declarations * Aug 6 1996 Add MOVEPIX, HDEL and HCHANGE declarations
* *
* May 27 1998 Split off imio subroutines to imio.h * May 27 1998 Split off imio subroutines to imio.h
* Sep 27 1999 Add Fortran-indexed (1,1), not (0,0) image access *1() * Sep 27 1999 Add Fortran-indexed (1,1), not (0,0) image access *1()
* Sep 28 1999 Add addpix() * Sep 28 1999 Add addpix()
* *
* Feb 27 2004 Add fillvec() * Feb 27 2004 Add fillvec()
*
* Jan 5 2007 Add prototype declarations for ANSI C and C++
*/ */
 End of changes. 5 change blocks. 
189 lines changed or deleted 2 lines changed or added


 wcs.h   wcs.h 
/*** File libwcs/wcs.h /*** File libwcs/wcs.h
*** January 10, 2007 *** February 1, 2007
*** 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-2007
*** 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.
skipping to change at line 154 skipping to change at line 154
/* where %f is replaced by the image filenam e */ /* where %f is replaced by the image filenam e */
/* where %x is replaced by image coordinates */ /* where %x is replaced by image coordinates */
double ltm[4]; /* Image rotation matrix */ double ltm[4]; /* Image rotation matrix */
double ltv[2]; /* Image offset */ double ltv[2]; /* Image offset */
int idpix[2]; /* First pixel to use in image (x, y) */ int idpix[2]; /* First pixel to use in image (x, y) */
int ndpix[2]; /* Number of pixels to use in image (x, y) * / int ndpix[2]; /* Number of pixels to use in image (x, y) * /
struct WorldCoor *wcs; /* WCS upon which this WCS depends */ struct WorldCoor *wcs; /* WCS upon which this WCS depends */
struct WorldCoor *wcsdep; /* WCS depending on this WCS */ struct WorldCoor *wcsdep; /* WCS depending on this WCS */
char *wcsname; /* WCS name (defaults to NULL pointer) */ char *wcsname; /* WCS name (defaults to NULL pointer) */
char wcschar; /* WCS character (A-Z, null, space) */ char wcschar; /* WCS character (A-Z, null, space) */
int logwcs; /* 1 if DC-FLAG is set for log wavelength */
}; };
/* Projections (1-26 are WCSLIB) (values for wcs->prjcode) */ /* Projections (1-26 are WCSLIB) (values for wcs->prjcode) */
#define WCS_PIX -1 /* Pixel WCS */ #define WCS_PIX -1 /* Pixel WCS */
#define WCS_LIN 0 /* Linear projection */ #define WCS_LIN 0 /* Linear projection */
#define WCS_AZP 1 /* Zenithal/Azimuthal Perspective */ #define WCS_AZP 1 /* Zenithal/Azimuthal Perspective */
#define WCS_SZP 2 /* Zenithal/Azimuthal Perspective */ #define WCS_SZP 2 /* Zenithal/Azimuthal Perspective */
#define WCS_TAN 3 /* Gnomonic = Tangent Plane */ #define WCS_TAN 3 /* Gnomonic = Tangent Plane */
#define WCS_SIN 4 /* Orthographic/synthesis */ #define WCS_SIN 4 /* Orthographic/synthesis */
#define WCS_STG 5 /* Stereographic */ #define WCS_STG 5 /* Stereographic */
skipping to change at line 889 skipping to change at line 890
* Apr 21 2006 Increase maximum number of axes from 4 to 8 * Apr 21 2006 Increase maximum number of axes from 4 to 8
* Apr 24 2006 Increase maximum number of axes to 9 * Apr 24 2006 Increase maximum number of axes to 9
* 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
*/ */
 End of changes. 3 change blocks. 
1 lines changed or deleted 3 lines changed or added


 wcscat.h   wcscat.h 
/*** File libwcs/wcscat.h /*** File libwcs/wcscat.h
*** January 10, 2007 *** March 13, 2007
*** By Doug Mink, dmink@cfa.harvard.edu *** By Doug Mink, dmink@cfa.harvard.edu
*** Copyright (C) 1998-2007 *** Copyright (C) 1998-2007
*** 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,
skipping to change at line 205 skipping to change at line 205
#define TMXSC 27 /* 2MASS Extended Source Catalog */ #define TMXSC 27 /* 2MASS Extended Source Catalog */
#define TMPSCE 28 /* 2MASS Point Source Catalog with mag error s */ #define TMPSCE 28 /* 2MASS Point Source Catalog with mag error s */
#define TYCHO2E 29 /* Tycho-2 Star Catalog with magnitu de errors */ #define TYCHO2E 29 /* Tycho-2 Star Catalog with magnitu de errors */
#define SKY2K 30 /* SKY2000 Master Catalog */ #define SKY2K 30 /* SKY2000 Master Catalog */
#define TABCAT -1 /* StarBase tab table catalog */ #define TABCAT -1 /* StarBase tab table catalog */
#define BINCAT -2 /* TDC binary catalog */ #define BINCAT -2 /* TDC binary catalog */
#define TXTCAT -3 /* TDC ASCII catalog */ #define TXTCAT -3 /* TDC ASCII catalog */
#define WEBCAT -4 /* Tab catalog via the web */ #define WEBCAT -4 /* Tab catalog via the web */
#define NUMCAT 30 /* Number of predefined catalogs */ #define NUMCAT 30 /* Number of predefined catalogs */
/* Structure for access to tokens within a string */
#define MAXTOKENS 1000 /* Maximum number of tokens to parse */
#define MAXWHITE 20 /* Maximum number of different whitespace character
s */
struct Tokens {
char *line; /* Line which has been parsed */
int lline; /* Number of characters in line */
int ntok; /* Number of tokens on line */
int nwhite; /* Number of whitespace characters */
char white[MAXWHITE]; /* Whitespace (separator) characters */
char *tok1[MAXTOKENS]; /* Pointers to start of tokens */
int ltok[MAXTOKENS]; /* Lengths of tokens */
int itok; /* Current token number */
};
#define EP_EP 1 /* Output epoch as fractional year */ #define EP_EP 1 /* Output epoch as fractional year */
#define EP_JD 2 /* Output epoch as Julian Date */ #define EP_JD 2 /* Output epoch as Julian Date */
#define EP_MJD 3 /* Ouput epoch as Modified Julian Date */ #define EP_MJD 3 /* Ouput epoch as Modified Julian Date */
#define EP_FD 4 /* Output epoch in FITS format (yyyy-mm-dd) */ #define EP_FD 4 /* Output epoch in FITS format (yyyy-mm-dd) */
#define EP_ISO 5 /* Output epoch in ISO format (yyyy-mm-ddThh:mm:ss) */ #define EP_ISO 5 /* Output epoch in ISO format (yyyy-mm-ddThh:mm:ss) */
/* Structure for dealing with ranges */ /* Structure for dealing with ranges */
#define MAXRANGE 20 #define MAXRANGE 20
struct Range { struct Range {
double first; /* Current minimum value */ double first; /* Current minimum value */
skipping to change at line 395 skipping to change at line 382
int refcat, /* Catalog code from wcscat.h (GSC or GSCACT) */ int refcat, /* Catalog code from wcscat.h (GSC or GSCACT) */
int nnum, /* Number of stars to look for */ int nnum, /* Number of stars to look for */
int sysout, /* Search coordinate system */ int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */ double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */ double epout, /* Proper motion epoch (0.0 for no proper motion) */
double *gnum, /* Array of source numbers to look for */ double *gnum, /* Array of source numbers to look for */
double *gra, /* Array of right ascensions (returned) */ double *gra, /* Array of right ascensions (returned) */
double *gdec, /* Array of declinations (returned) */ double *gdec, /* Array of declinations (returned) */
double **gmag, /* 2-D array of magnitudes (returned) */ double **gmag, /* 2-D array of magnitudes (returned) */
int *gtype, /* Array of object types (returned) */ int *gtype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li ne */ int nlog); /* Verbose mode if >1, number of sources per log lin e */
int gscbin( /* Bin sources from HST Guide Star Catalog * / int gscbin( /* Bin sources from HST Guide Star Catalog * /
int refcat, /* Catalog code from wcscat.h (GSC or GSCACT) */ int refcat, /* Catalog code from wcscat.h (GSC or GSCACT) */
struct WorldCoor *wcs, /* World coordinate system for image */ struct WorldCoor *wcs, /* World coordinate system for image */
char *header, /* FITS header for output image */ char *header, /* FITS header for output image */
char *image, /* Output FITS image */ char *image, /* Output FITS image */
double mag1, /* Minimum (brightest) magnitude (no limits if equal ) */ double mag1, /* Minimum (brightest) magnitude (no limits if equal ) */
double mag2, /* Maximum (faintest) magnitude (no limits if equal) */ double mag2, /* Maximum (faintest) magnitude (no limits if equal) */
double magscale, /* Scaling factor for magnitude to pixel flux double magscale, /* Scaling factor for magnitude to pixel flux
* (image of number of catalog objects per bin if 0) */ * (image of number of catalog objects per bin if 0) */
int nlog); /* Verbose mode if > 1, number of sources per log li ne */ int nlog); /* Verbose mode if >1, number of sources per log lin e */
void setgsclass( /* Set GSC object class to return (<0=all) */ void setgsclass( /* Set GSC object class to return (<0=all) */
int class); /* Class of objects to return */ int class); /* Class of objects to return */
/* Subroutine to read GSC II catalog over the web */ /* Subroutine to read GSC II catalog over the web */
int gsc2read( /* Read sources by sky region from GSC II Catalog */ int gsc2read( /* Read sources by sky region from GSC II Catalog */
char *refcatname, /* Name of catalog (GSC2 for 2.2; GSC2.3 for 2.3) */ char *refcatname, /* Name of catalog (GSC2 for 2.2; GSC2.3 for 2.3) */
double cra, /* Search center J2000 right ascension in degrees */ double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */ double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees * / double dra, /* Search half width in right ascension in degrees * /
double ddec, /* Search half-width in declination in degrees */ double ddec, /* Search half-width in declination in degrees */
skipping to change at line 427 skipping to change at line 414
double dradi, /* Inner edge of annulus in degrees (ignore if 0) */ double dradi, /* Inner edge of annulus in degrees (ignore if 0) */
int distsort, /* 1 to sort stars by distance from center */ int distsort, /* 1 to sort stars by distance from center */
int sysout, /* Search coordinate system */ int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */ double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */ double epout, /* Proper motion epoch (0.0 for no proper motion) */
double mag1, /* Limiting magnitudes (none if equal) */ double mag1, /* Limiting magnitudes (none if equal) */
double mag2, /* Limiting magnitudes (none if equal) */ double mag2, /* Limiting magnitudes (none if equal) */
int sortmag, /* Number of magnitude by which to limit and sort */ int sortmag, /* Number of magnitude by which to limit and sort */
int nstarmax, /* Maximum number of stars to be returned */ int nstarmax, /* Maximum number of stars to be returned */
double *gnum, /* Array of ID numbers (returned) */ double *gnum, /* Array of ID numbers (returned) */
char **gobj, /* Array of object IDs (mixed letters and numbers) * /
double *gra, /* Array of right ascensions (returned) */ double *gra, /* Array of right ascensions (returned) */
double *gdec, /* Array of declinations (returned) */ double *gdec, /* Array of declinations (returned) */
double *gpra, /* Array of right ascension proper motions (returned ) */ double *gpra, /* Array of right ascension proper motions (returned ) */
double *gpdec, /* Array of declination proper motions (returned) */ double *gpdec, /* Array of declination proper motions (returned) */
double **gmag, /* 2-D array of magnitudes (returned) */ double **gmag, /* 2-D array of magnitudes (returned) */
int *gtype, /* Array of object types (returned) */ int *gtype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li int nlog); /* Verbose mode if >1, number of sources per log lin
ne */ e */
char *gsc2c2t( /* Convert GSC2 buffer from comma- to tab-separated
*/
char *csvbuff); /* Input comma-separated table */
/* Subroutine to read SDSS catalog over the web */ /* Subroutine to read SDSS catalog over the web */
int sdssread( /* Read sources by sky region from SDSS Catalog */ int sdssread( /* Read sources by sky region from SDSS Catalog */
double cra, /* Search center J2000 right ascension in degrees */ double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */ double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees * / double dra, /* Search half width in right ascension in degrees * /
double ddec, /* Search half-width in declination in degrees */ double ddec, /* Search half-width in declination in degrees */
double drad, /* Limiting separation in degrees (ignore if 0) */ double drad, /* Limiting separation in degrees (ignore if 0) */
double dradi, /* Inner edge of annulus in degrees (ignore if 0) */ double dradi, /* Inner edge of annulus in degrees (ignore if 0) */
int distsort, /* 1 to sort stars by distance from center */ int distsort, /* 1 to sort stars by distance from center */
skipping to change at line 457 skipping to change at line 447
double mag1, /* Limiting magnitudes (none if equal) */ double mag1, /* Limiting magnitudes (none if equal) */
double mag2, /* Limiting magnitudes (none if equal) */ double mag2, /* Limiting magnitudes (none if equal) */
int sortmag, /* Number of magnitude by which to limit and sort */ int sortmag, /* Number of magnitude by which to limit and sort */
int nstarmax, /* Maximum number of stars to be returned */ int nstarmax, /* Maximum number of stars to be returned */
double *gnum, /* Array of ID numbers (returned from tabread) */ double *gnum, /* Array of ID numbers (returned from tabread) */
char **gobj, /* Array of object IDs (too long for integer*4) */ char **gobj, /* Array of object IDs (too long for integer*4) */
double *gra, /* Array of right ascensions (returned) */ double *gra, /* Array of right ascensions (returned) */
double *gdec, /* Array of declinations (returned) */ double *gdec, /* Array of declinations (returned) */
double **gmag, /* 2-D array of magnitudes (returned) */ double **gmag, /* 2-D array of magnitudes (returned) */
int *gtype, /* Array of object types (returned) */ int *gtype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li ne */ int nlog); /* Verbose mode if >1, number of sources per log lin e */
char *sdssc2t( /* Convert SDSS buffer from comma- to tab-separated */ char *sdssc2t( /* Convert SDSS buffer from comma- to tab-separated */
char *csvbuff); /* Input comma-separated table */ char *csvbuff); /* Input comma-separated table */
/* Subroutines to read local copy of 2MASS Point Source Catalog */ /* Subroutines to read local copy of 2MASS Point Source Catalog */
int tmcread( /* Read sources by sky region from 2MASS Point Sourc e Catalog */ int tmcread( /* Read sources by sky region from 2MASS Point Sourc e Catalog */
int refcat, /* Catalog code from wcscat.h (TMPSC or TMXSC or TMP SCE) */ int refcat, /* Catalog code from wcscat.h (TMPSC or TMXSC or TMP SCE) */
double cra, /* Search center J2000 right ascension in degrees */ double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */ double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees * / double dra, /* Search half width in right ascension in degrees * /
double ddec, /* Search half-width in declination in degrees */ double ddec, /* Search half-width in declination in degrees */
skipping to change at line 1278 skipping to change at line 1268
char *string); /* String which might be a range of numbers */ char *string); /* String which might be a range of numbers */
void rstart( /* Restart range */ void rstart( /* Restart range */
struct Range *range); /* Range structure */ struct Range *range); /* Range structure */
int rgetn( /* Return number of values in all ranges */ int rgetn( /* Return number of values in all ranges */
struct Range *range); /* Range structure */ struct Range *range); /* Range structure */
int rgeti4( /* Return next number in range as integer */ int rgeti4( /* Return next number in range as integer */
struct Range *range); /* Range structure */ struct Range *range); /* Range structure */
double rgetr8( /* Return next number in range as double */ double rgetr8( /* Return next number in range as double */
struct Range *range); /* Range structure */ struct Range *range); /* Range structure */
/* Subroutines for access to tokens within a string */ /* Subroutines for read values from keyword=value in blocks of text */
int setoken( /* Tokenize a string for easy decoding */
struct Tokens *tokens, /* Token structure returned */
char *string, /* character string to tokenize */
char *cwhite); /* additional whitespace characters
* if = tab, disallow spaces and commas */
int nextoken( /* Get next token from tokenized string */
struct Tokens *tokens, /* Token structure returned */
char *token, /* token (returned) */
int maxchars); /* Maximum length of token */
int getoken( /* Get specified token from tokenized string */
struct Tokens *tokens, /* Token structure returned */
int itok, /* token sequence number of token
* if <0, get whole string after token -itok
* if =0, get whole string */
char *token, /* token (returned) */
int maxchars); /* Maximum length of token */
int ageti4( /* Extract int value from keyword= value in string */ int ageti4( /* Extract int 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
* the value of which is returned. hget searches fo r a * the value of which is returned. hget searches fo r a
* line beginning with this string. if "[n]" or ",n " is * line beginning with this string. if "[n]" or ",n " is
* present, the n'th token in the value is returned. */ * present, the n'th token in the value is returned. */
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 */
skipping to change at line 1371 skipping to change at line 1344
void ctgclose(); void ctgclose();
/* Subroutines for extracting sources from HST Guide Star Catalog */ /* Subroutines for extracting sources from HST Guide Star Catalog */
int gscread(); /* Read sources by sky region from HST Guide Star Ca talog */ int gscread(); /* Read sources by sky region from HST Guide Star Ca talog */
int gscrnum(); /* Read sources by ID number from HST Guide Star Cat alog */ int gscrnum(); /* Read sources by ID number from HST Guide Star Cat alog */
int gscbin(); /* Bin sources from HST Guide Star Catalog */ int gscbin(); /* Bin sources from HST Guide Star Catalog */
void setgsclass(); /* Set GSC object class */ void setgsclass(); /* Set GSC object class */
/* Subroutine to read GSC II catalog over the web (gsc2read.c) */ /* Subroutine to read GSC II catalog over the web (gsc2read.c) */
int gsc2read(); /* Read sources by sky region from GSC II Ca talog */ int gsc2read(); /* Read sources by sky region from GSC II Ca talog */
char *gsc2c2t(); /* Convert GSC2 buffer from comma- to tab-separated */
/* Subroutine to read SDSS catalog over the web (sdssread.c) */ /* Subroutine to read SDSS catalog over the web (sdssread.c) */
int sdssread(); /* Read sources by sky region from SDSS Cata log */ int sdssread(); /* Read sources by sky region from SDSS Cata log */
char *sdssc2t(); /* Convert SDSS buffer from comma- to tab-separated */ char *sdssc2t(); /* Convert SDSS buffer from comma- to tab-separated */
/* Subroutines to read local copy of 2MASS Point Source Catalog (tmcread.c) */ /* Subroutines to read local copy of 2MASS Point Source Catalog (tmcread.c) */
int tmcread(); /* Read sources by sky region from 2MASS Point Sourc e Catalog */ int tmcread(); /* Read sources by sky region from 2MASS Point Sourc e Catalog */
int tmcrnum(); /* Read sources by ID number from 2MASS Point Source Catalog */ int tmcrnum(); /* Read sources by ID number from 2MASS Point Source Catalog */
int tmcbin(); /* Bin sources from 2MASS Point Source Catalog */ int tmcbin(); /* Bin sources from 2MASS Point Source Catalog */
skipping to change at line 1506 skipping to change at line 1480
void bv2sp(); /* Approximate main sequence spectral type from B - V */ void bv2sp(); /* Approximate main sequence spectral type from B - V */
/* Subroutines for dealing with ranges */ /* Subroutines for dealing with ranges */
struct Range *RangeInit(); /* Initialize range structure from string */ struct Range *RangeInit(); /* Initialize range structure from string */
int isrange(); /* Return 1 if string is a range of numbers, else 0 */ int isrange(); /* Return 1 if string is a range of numbers, else 0 */
int rgetn(); /* Return number of values in all ranges */ int rgetn(); /* Return number of values in all ranges */
int rgeti4(); /* Return next number in range as integer */ int rgeti4(); /* Return next number in range as integer */
double rgetr8(); /* Return next number in range as double */ double rgetr8(); /* Return next number in range as double */
void rstart(); /* Restart range */ void rstart(); /* Restart range */
/* Subroutines for access to tokens within a string */
int setoken(); /* Tokenize a string for easy decoding */
int nextoken(); /* Get next token from tokenized string */
int getoken(); /* Get specified token from tokenized string */
/* Subroutines for VOTable output */ /* Subroutines for VOTable output */
int vothead(); /* Print heading for VOTable SCAT output */ int vothead(); /* Print heading for VOTable SCAT output */
void vottail(); /* Terminate VOTable SCAT output */ void vottail(); /* Terminate VOTable SCAT output */
/* Subroutines for version/date string */ /* Subroutines for version/date string */
void setrevmsg(); /* Set version/date string */ void setrevmsg(); /* Set version/date string */
char *getrevmsg(); /* Return version/date string */ char *getrevmsg(); /* Return version/date string */
/* Subroutines for fitting and evaluating polynomials */ /* Subroutines for fitting and evaluating polynomials */
void polfit(); /* Fit polynomial coefficients */ void polfit(); /* Fit polynomial coefficients */
skipping to change at line 1651 skipping to change at line 1620
* Aug 5 2005 Add Tycho-2 and 2MASS PSC with magnitude errors * Aug 5 2005 Add Tycho-2 and 2MASS PSC with magnitude errors
* *
* Jan 6 2006 Add CatRad() subroutine * Jan 6 2006 Add CatRad() subroutine
* Mar 17 2006 Make vothead() int as it now returns the number of fields * Mar 17 2006 Make vothead() int as it now returns the number of fields
* Apr 3 2006 Add tmcid() to check for 2MASS identifiers * Apr 3 2006 Add tmcid() to check for 2MASS identifiers
* Apr 3 2006 Add setdateform() to set output date format * Apr 3 2006 Add setdateform() to set output date format
* Apr 12 2006 Add SORT_ID for scat to sort catalog entries by ID number * Apr 12 2006 Add SORT_ID for scat to sort catalog entries by ID number
* Jun 20 2006 Add IDSortStars() * Jun 20 2006 Add IDSortStars()
* *
* 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
* Mar 13 2007 Add gsc2c2t() to convert CSV GSC2 buffer to TSV table
* Mar 13 2007 Add gobj object name to gsc2read()
*/ */
 End of changes. 11 change blocks. 
43 lines changed or deleted 15 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/