fitsfile.h   fitsfile.h 
/*** File fitsfile.h FITS and IRAF file access subroutines /*** File fitsfile.h FITS and IRAF file access subroutines
*** October 5, 2006 *** January 9, 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-2006 *** 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.
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 48 skipping to change at line 48
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 #define FITSBLOCK 2880
#ifdef __cplusplus /* C++ prototypes */
extern "C" {
#endif
#ifdef __STDC__ /* Full ANSI prototypes */
/* Declarations for subroutines in fitsfile.c, imhfile.c, imio.c,
* fileutil.c, and dateutil.c */
/* FITS file access subroutines in fitsfile.c */
int fitsropen( /* Open a FITS file for reading, returning a FILE po
inter */
char *inpath); /* Pathname for FITS tables file to read */
char *fitsrhead( /* Read a FITS header */
char *filename, /* Name of FITS image file */
int *lhead, /* Allocated length of FITS header in bytes (returne
d) */
int *nbhead); /* Number of bytes before start of data (returned) *
/
char *fitsrtail( /* Read FITS header appended to graphics file */
char *filename, /* Name of FITS image file */
int *lhead, /* Allocated length of FITS header in bytes (returne
d) */
int *nbhead); /* Number of bytes before start of data (returned) *
/
char *fitsrimage( /* Read a FITS image */
char *filename, /* Name of FITS image file */
int nbhead, /* Actual length of image header(s) in bytes */
char *header); /* FITS header for image (previously read) */
char *fitsrfull( /* Read a FITS image of any dimension */
char *filename, /* Name of FITS image file */
int nbhead, /* Actual length of image header(s) in bytes */
char *header); /* FITS header for image (previously read) */
char *fitsrsect( /* Read a piece of a FITS image, header */
char *filename, /* Name of FITS image file */
char *header, /* FITS header for image (previously read) */
int nbhead, /* Actual length of image header(s) in bytes */
int x0, /* FITS image X coordinate of first pixel */
int y0, /* FITS image Y coordinate of first pixel */
int nx, /* Number of columns to read (less than NAXIS1) */
int ny, /* Number of rows to read (less than NAXIS2) */
int nlog); /* Note progress mod this rows */
int fitswhead( /* Write FITS header; keep file open for further wri
ting */
char *filename, /* Name of FITS image file */
char *header); /* FITS header for image (previously read) */
int fitswexhead( /* Write FITS header in place */
char *filename, /* Name of FITS image file */
char *header); /* FITS header for image */
int fitswext( /* Write FITS header and image as extension to a fil
e */
char *filename, /* Name of FITS image file */
char *header, /* FITS image header */
char *image); /* FITS image pixels */
int fitswhdu( /* Write FITS head and image as extension */
int fd, /* File descriptor */
char *filename, /* Name of FITS image file */
char *header, /* FITS image header */
char *image); /* FITS image pixels */
int fitswimage( /* Write FITS header and image */
char *filename, /* Name of FITS image file */
char *header, /* FITS image header */
char *image); /* FITS image pixels */
int fitscimage( /* Write FITS header and copy FITS image */
char *filename, /* Name of output FITS image file */
char *header, /* FITS image header */
char *filename0); /* Name of input FITS image file */
int isfits( /* Return 1 if file is a FITS file */
char *filename); /* Name of file to check */
void fitserr(); /* Print FITS error message to stderr */
void setfitsinherit( /* Set flag to append primary data header */
int inh); /* 1 to inherit primary data header, else 0 */
int fitsheadsize( /* Return size of fitsheader in bytes */
char *header); /* FITS image header */
/* FITS table file access subroutines in fitsfile.c */
int fitsrtopen( /* Open FITS table file and fill structure with
* pointers to selected keywords
* Return file descriptor (-1 if unsuccessful) */
char *inpath, /* Pathname for FITS tables file to read */
int *nk, /* Number of keywords to use */
struct Keyword **kw, /* Structure for desired entries */
int *nrows, /* Number of rows in table (returned) */
int *nchar, /* Number of characters in one table row (returned)
*/
int *nbhead); /* Number of characters before table starts */
int fitsrthead( /* Read pointers to selected keywords
* from FITS table header */
char *header, /* Header for FITS tables file */
int *nk, /* Number of keywords to use */
struct Keyword **kw, /* Structure for desired entries */
int *nrows, /* Number of rows in table (returned) */
int *nchar); /* Number of characters in one table row (returned)
*/
void fitsrtlset(void); /* Reset FITS Table buffer limits from start of
data */
int fitsrtline( /* Return specified line of FITS table */
int fd, /* File descriptor for FITS file */
int nbhead, /* Number of bytes in FITS header */
int lbuff, /* Number of bytes in table buffer */
char *tbuff, /* FITS table buffer */
int irow, /* Number of table row to read */
int nbline, /* Number of bytes to read for this line */
char *line); /* One line of FITS table (returned) */
short ftgeti2( /* Extract column for keyword from FITS table line
* as short */
char *entry, /* Row or entry from table */
struct Keyword *kw); /* Table column information from FITS header */
int ftgeti4( /* Extract column for keyword from FITS table line
* as int */
char *entry, /* Row or entry from table */
struct Keyword *kw); /* Table column information from FITS header */
float ftgetr4( /* Extract column for keyword from FITS table line
* as float */
char *entry, /* Row or entry from table */
struct Keyword *kw); /* Table column information from FITS header */
double ftgetr8( /* Extract column for keyword from FITS table line
* as double */
char *entry, /* Row or entry from table */
struct Keyword *kw); /* Table column information from FITS header */
int ftgetc( /* Extract column for keyword from FITS tabl
e line
* as char string */
char *entry, /* Row or entry from table */
struct Keyword *kw, /* Table column information from FITS header */
char *string, /* Returned string */
int maxchar); /* Maximum number of characters in returned string *
/
/* IRAF file access subroutines in imhfile.c */
char *irafrhead( /* Read IRAF .imh header file and translate to FITS
header */
char *filename, /* Name of IRAF header file */
int *lihead); /* Length of IRAF image header in bytes (returned) *
/
char *irafrimage( /* Read IRAF image pixels (call after irafrhead) */
char *fitsheader); /* FITS image header (filled) */
int irafwhead( /* Write IRAF .imh header file */
char *hdrname, /* Name of IRAF header file */
int lhead, /* Length of IRAF header */
char *irafheader, /* IRAF header */
char *fitsheader); /* FITS image header */
int irafwimage( /* Write IRAF .imh header file and .pix image file *
/
char *hdrname, /* Name of IRAF header file */
int lhead, /* Length of IRAF header */
char *irafheader, /* IRAF header */
char *fitsheader, /* FITS image header */
char *image); /* IRAF image */
int isiraf( /* return 1 if IRAF imh file, else 0 */
char *filename); /* Name of file to check */
char *iraf2fits( /* Convert IRAF image header to FITS image header,
* returning FITS header */
char *hdrname, /* IRAF header file name (may be path) */
char *irafheader, /* IRAF image header */
int nbiraf, /* Number of bytes in IRAF header */
int *nbfits); /* Number of bytes in FITS header (returned) */
char *fits2iraf( /* Convert FITS image header to IRAF image header,
* returning IRAF header */
char *fitsheader, /* FITS image header */
char *irafheader, /* IRAF image header (returned updated) */
int nbhead, /* Length of IRAF header */
int *nbiraf); /* Length of returned IRAF header */
/* 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(void); /* Return 1 if machine byte order is not FITS orde
r */
/* File utilities from fileutil.c */
int getfilelines( /* Return number of lines in an ASCII file */
char *filename); /* Name of file to check */
char *getfilebuff( /* Return entire file contents in a character string
*/
char *filename); /* Name of file to read */
int getfilesize( /* Return size of a binary or ASCII file */
char *filename); /* Name of file to check */
int isimlist( /* Return 1 if file is list of FITS or IRAF image fi
les, else 0 */
char *filename); /* Name of file to check */
int isimlistd( /* Return 1 if file is list of FITS or IRAF image fi
les, else 0 */
char *filename, /* Name of file to check */
char *rootdir); /* Name of root directory for files in list */
int isfilelist( /* Return 1 if list of readable files, else 0 */
char *filename, /* Name of file to check */
char *rootdir); /* Name of root directory for files in list */
int isfile( /* Return 1 if file is a readable file, else
0 */
char *filename); /* Name of file to check */
int istiff( /* Return 1 if TIFF image file, else 0 */
char *filename); /* Name of file to check */
int isjpeg( /* Return 1 if JPEG image file, else 0 */
char *filename); /* Name of file to check */
int isgif( /* Return 1 if GIF image file, else 0 */
char *filename); /* Name of file to check */
int first_token( /* Return first token from the next line of an ASCII
file */
FILE *diskfile, /* File descriptor for ASCII file */
int ncmax, /* Maximum number of characters returned */
char *token); /* First token on next line (returned) */
int stc2s ( /* Replace character in string with space */
char *spchar, /* Character to replace with spaces */
char *string); /* Character string to process */
int sts2c ( /* Replace spaces in string with character *
/
char *spchar, /* Character with which to replace spaces */
char *string); /* Character string to process */
/* Subroutines for translating dates and times in dateutil.c */
/* Subroutines to convert from year and day of year */
void doy2dt( /* Year and day of year to yyyy.mmdd hh.mmss */
int year, /* Year */
double doy, /* Day of year with fraction */
double *date, /* Date as yyyy.mmdd (returned) */
double *time); /* Time as hh.mmssxxxx (returned) */
double doy2ep( /* Year and day of year to fractional year (epoch) *
/
int year, /* Year */
double doy); /* Day of year with fraction */
double doy2epb( /* year and day of year to Besselian epoch */
int year, /* Year */
double doy); /* Day of year with fraction */
double doy2epj( /* year and day of year to Julian epoch */
int year, /* Year */
double doy); /* Day of year with fraction */
char *doy2fd( /* year and day of year to FITS date */
int year, /* Year */
double doy); /* Day of year with fraction */
double doy2jd( /* year and day of year to Julian Day */
int year, /* Year */
double doy); /* Day of year with fraction */
double doy2mjd( /* year and day of year to Modified Julian Day */
int year, /* Year */
double doy); /* Day of year with fraction */
double doy2ts( /* year and day of year to seconds since 1950.0 */
int year, /* Year */
double doy); /* Day of year with fraction */
int doy2tsi( /* year and day of year to IRAF seconds since 1980-0
1-01 */
int year, /* Year */
double doy); /* Day of year with fraction */
time_t doy2tsu( /* year and day of year to Unix seconds since 1970-0
1-01 */
int year, /* Year */
double doy); /* Day of year with fraction */
/* Subroutines to convert from date and time */
void dt2doy( /* yyyy.mmdd hh.mmss to year and day of year */
double date, /* Date as yyyy.mmdd
* yyyy = calendar year (e.g. 1973)
* mm = calendar month (e.g. 04 = april)
* dd = calendar day (e.g. 15) */
double time, /* Time as hh.mmssxxxx
* if time<0, it is time as -(fraction of a day)
* hh = hour of day (0 .le. hh .le. 23)
* nn = minutes (0 .le. nn .le. 59)
* ss = seconds (0 .le. ss .le. 59)
* xxxx = tenths of milliseconds (0 .le. xxxx .le. 9
999) */
int *year, /* Year (returned) */
double *doy); /* Day of year with fraction (returned) */
double dt2ep( /* yyyy.ddmm and hh.mmsss to fractional year (epoch)
*/
double date, /* Date as yyyy.mmdd */
double time); /* Time as hh.mmssxxxx */
double dt2epb( /* yyyy.ddmm and hh.mmsss to Besselian epoch */
double date, /* Date as yyyy.mmdd */
double time); /* Time as hh.mmssxxxx */
double dt2epj( /* yyyy.ddmm and hh.mmsss to Julian epoch */
double date, /* Date as yyyy.mmdd */
double time); /* Time as hh.mmssxxxx */
char *dt2fd( /* yyyy.ddmm and hh.mmsss to FITS date string */
double date, /* Date as yyyy.mmdd */
double time); /* Time as hh.mmssxxxx */
void dt2i( /* yyyy.ddmm and hh.mmsss to year, month, day, hrs,
min, sec */
double date, /* Date as yyyy.mmdd */
double time, /* Time as hh.mmssxxxx */
int *iyr, /* year (returned) */
int *imon, /* month (returned) */
int *iday, /* day (returned) */
int *ihr, /* hours (returned) */
int *imn, /* minutes (returned) */
double *sec, /* seconds (returned) */
int ndsec); /* Number of decimal places in seconds (0=int) */
double dt2jd( /* yyyy.ddmm and hh.mmsss to Julian Day */
double date, /* Date as yyyy.mmdd */
double time); /* Time as hh.mmssxxxx */
double dt2mjd( /* yyyy.ddmm and hh.mmsss to Modified Julian Day */
double date, /* Date as yyyy.mmdd */
double time); /* Time as hh.mmssxxxx */
double dt2ts( /* yyyy.ddmm and hh.mmsss to seconds since 1950.0 */
double date, /* Date as yyyy.mmdd */
double time); /* Time as hh.mmssxxxx */
int dt2tsi( /* yyyy.ddmm and hh.mmsss to IRAF seconds si
nce 1980-01-01 */
double date, /* Date as yyyy.mmdd */
double time); /* Time as hh.mmssxxxx */
time_t dt2tsu( /* yyyy.ddmm and hh.mmsss to Unix seconds since 1970
-01-01 */
double date, /* Date as yyyy.mmdd */
double time); /* Time as hh.mmssxxxx */
/* Subroutines to convert from epoch (various types of fractional year)
*/
void ep2dt( /* Fractional year to yyyy.mmdd hh.mmssss */
double epoch, /* Date as fractional year */
double *date, /* Date as yyyy.mmdd (returned) */
double *time); /* Time as hh.mmssxxxx (returned) */
void epb2dt( /* Besselian epoch to yyyy.mmdd hh.mmssss */
double epoch, /* Besselian epoch (fractional 365.242198781-day yea
rs) */
double *date, /* Date as yyyy.mmdd (returned) */
double *time); /* Time as hh.mmssxxxx (returned) */
void epj2dt( /* Julian epoch to yyyy.mmdd hh.mmssss */
double epoch, /* Julian epoch (fractional 365.25-day years) */
double *date, /* Date as yyyy.mmdd (returned)*/
double *time); /* Time as hh.mmssxxxx (returned) */
char *ep2fd( /* Fractional year to FITS date string yyyy-mm-ddThh
:mm:ss.ss */
double epoch); /* Date as fractional year */
char *epb2fd( /* Besselian epoch to FITS date string yyyy-mm-ddThh
:mm:ss.ss */
double epoch); /* Besselian epoch (fractional 365.242198781-day yea
rs) */
char *epj2fd( /* Julian epoch to FITS date string yyyy-mm-ddThh:mm
:ss.ss */
double epoch); /* Julian epoch (fractional 365.25-day years) */
void ep2i( /* Fractional year to year, month, day, hours, min.,
sec. */
double epoch, /* Date as fractional year */
int *iyr, /* year (returned) */
int *imon, /* month (returned) */
int *iday, /* day (returned) */
int *ihr, /* hours (returned) */
int *imn, /* minutes (returned) */
double *sec, /* seconds (returned) */
int ndsec); /* Number of decimal places in seconds (0=int) */
void epb2i( /* Besselian epoch to year, month, day, hour
s, min., sec. */
double epoch, /* Besselian epoch (fractional 365.242198781-day yea
rs) */
int *iyr, /* year (returned) */
int *imon, /* month (returned) */
int *iday, /* day (returned) */
int *ihr, /* hours (returned) */
int *imn, /* minutes (returned) */
double *sec, /* seconds (returned) */
int ndsec); /* Number of decimal places in seconds (0=int) */
void epj2i( /* Julian epoch to year, month, day, hours,
min., sec. */
double epoch, /* Julian epoch (fractional 365.25-day years) */
int *iyr, /* year (returned) */
int *imon, /* month (returned) */
int *iday, /* day (returned) */
int *ihr, /* hours (returned) */
int *imn, /* minutes (returned) */
double *sec, /* seconds (returned) */
int ndsec); /* Number of decimal places in seconds (0=int) */
double ep2jd( /* Fractional year to Julian Date */
double epoch); /* Date as fractional year */
double epb2jd( /* Besselian epoch to Julian Date */
double epoch); /* Besselian epoch (fractional 365.242198781-day yea
rs) */
double epj2jd( /* Julian epoch to Julian Date */
double epoch); /* Julian epoch (fractional 365.25-day years) */
double ep2mjd( /* Fractional year to Modified Julian Date */
double epoch); /* Date as fractional year */
double epb2mjd( /* Besselian epoch to Modified Julian Date */
double epoch); /* Besselian epoch (fractional 365.242198781-day yea
rs) */
double epj2mjd( /* Julian epoch to Modified Julian Date */
double epoch); /* Julian epoch (fractional 365.25-day years) */
double ep2epb( /* Fractional year to Besselian epoch */
double epoch); /* Date as fractional year */
double ep2epj( /* Fractional year to Julian epoch */
double epoch); /* Date as fractional year */
double epb2epj( /* Besselian epoch to Julian epoch */
double epoch); /* Besselian epoch (fractional 365.242198781-day yea
rs) */
double epj2epb( /* Julian epoch to Besselian epoch */
double epoch); /* Julian epoch (fractional 365.25-day years) */
double epb2ep( /* Besselian epoch to fractional year */
double epoch); /* Besselian epoch (fractional 365.242198781-day yea
rs) */
double epj2ep( /* Julian epoch to fractional year */
double epoch); /* Julian epoch (fractional 365.25-day years) */
double ep2ts( /* Fractional year to seconds since 1950.0 */
double epoch); /* Date as fractional year */
double epb2ts( /* Besselian epoch to seconds since 1950.0 */
double epoch); /* Besselian epoch (fractional 365.242198781-day ye
ars) */
double epj2ts( /* Julian epoch to seconds since 1950.0 */
double epoch); /* Julian epoch (fractional 365.25-day years) */
/* Convert from FITS standard date string */
void fd2dt( /* FITS standard date string to date and tim
e */
char *string, /* FITS date string, which may be:
* fractional year
* dd/mm/yy (FITS standard before 2000)
* dd-mm-yy (nonstandard use before 2000)
* yyyy-mm-dd (FITS standard after 1999)
* yyyy-mm-ddThh:mm:ss.ss (FITS standard after 1999)
*/
double *date, /* Date as yyyy.mmdd (returned)*/
double *time); /* Time as hh.mmssxxxx (returned) */
void fd2doy( /* FITS standard date string to year, day of year */
char *string, /* FITS date string */
int *year, /* Year (returned) */
double *doy); /* Day of year with fraction (returned) */
double fd2ep( /* FITS standard date string to fractional year (epo
ch) */
char *string); /* FITS date string */
double fd2epb( /* FITS standard date string to Besselian epoch */
char *string); /* FITS date string */
double fd2epj( /* FITS standard date string to Julian epoch */
char *string); /* FITS date string */
char *fd2fd( /* Any FITS standard date string to ISO FITS date st
ring */
char *string); /* FITS date string */
char *fd2of( /* Any FITS standard date string to old FITS date an
d time */
char *string); /* FITS date string */
char *fd2ofd( /* Any FITS standard date string to old FITS date st
ring */
char *string); /* FITS date string */
char *fd2oft( /* Any FITS standard date string to old FITS time st
ring */
char *string); /* FITS date string */
void fd2i( /* FITS standard date string to year, mon, day, hrs,
min, sec */
char *string, /* FITS date string */
int *iyr, /* year (returned) */
int *imon, /* month (returned) */
int *iday, /* day (returned) */
int *ihr, /* hours (returned) */
int *imn, /* minutes (returned) */
double *sec, /* seconds (returned) */
int ndsec); /* Number of decimal places in seconds (0=int) */
double fd2jd( /* FITS standard date string to Julian Day */
char *string); /* FITS date string */
double fd2mjd( /* FITS standard date string to Modified Julian Day
*/
char *string); /* FITS date string */
double fd2ts( /* FITS standard date to seconds since 1950-01-01 */
char *string); /* FITS date string */
int fd2tsi( /* FITS standard date to IRAF seconds since
1980-01-01 */
char *string); /* FITS date string */
time_t fd2tsu( /* FITS standard date to Unix seconds since 1970-01-
01 */
char *string); /* FITS date string */
/* Convert from Julian Day */
void jd2doy( /* Julian Day to year and day of year */
double dj, /* Julian Day */
int *year, /* Year (returned) */
double *doy); /* Day of year with fraction (returned) */
void jd2dt( /* Julian Day to yyyy.mmdd hh.mmssss */
double dj, /* Julian Day */
double *date, /* Date as yyyy.mmdd (returned)*/
double *time); /* Time as hh.mmssxxxx (returned) */
double jd2ep( /* Julian Day to fractional year */
double dj); /* Julian Day */
double jd2epb( /* Julian Day to Besselian epoch */
double dj); /* Julian Day */
double jd2epj( /* Julian Day to Julian epoch */
double dj); /* Julian Day */
char *jd2fd( /* Julian Day to FITS date string yyyy-mm-ddThh:mm:s
s.ss */
double dj); /* Julian Day */
void jd2i( /* Julian Day to year, month, day, hours, min., sec.
*/
double dj, /* Julian Day */
int *iyr, /* year (returned) */
int *imon, /* month (returned) */
int *iday, /* day (returned) */
int *ihr, /* hours (returned) */
int *imn, /* minutes (returned) */
double *sec, /* seconds (returned) */
int ndsec); /* Number of decimal places in seconds (0=int) */
double jd2mjd( /* Julian Day to Modified Julian day */
double dj); /* Julian Day */
double jd2ts( /* Julian Day to seconds since 1950.0 */
double dj); /* Julian Day */
time_t jd2tsu( /* Julian Day to Unix seconds since 1970-01-01T00:00 */
double dj); /* Julian Day */
int jd2tsi( /* Julian Day to IRAF seconds since 1980-01-01T00:00 */
double dj); /* Julian Day */
/* Convert current local time to various formats */
void lt2dt( /* Current local time to date (yyyy.mmdd), t
ime (hh.mmsss) */
double *date, /* Date as yyyy.mmdd (returned) */
double *time); /* Time as hh.mmssxxxx (returned) */
char *lt2fd(void); /* Current local time to FITS ISO date string */
int lt2tsi(void); /* Current local time to IRAF seconds since 1980-01-
01T00:00 */
time_t lt2tsu(void); /* Current local time to Unix seconds since 1970-0
1-01T00:00 */
double lt2ts(void); /* Current local time to IRAF seconds since
1950-01-01T00:00 */
/* Convert from Modified Julian Day (JD - 2400000.5) */
void mjd2doy( /* Modified Julian Day to year and day of year */
double dj, /* Modified Julian Day */
int *year, /* Year (returned) */
double *doy); /* Day of year with fraction (returned) */
void mjd2dt( /* Modified Julian Day to yyyy.mmdd hh.mmssss */
double dj, /* Modified Julian Date */
double *date, /* Date as yyyy.mmdd (returned)*/
double *time); /* Time as hh.mmssxxxx (returned) */
double mjd2ep( /* Modified Julian Day to fractional year */
double dj); /* Modified Julian Date */
double mjd2epb( /* Modified Julian Day to Besselian epoch */
double dj); /* Modified Julian Date */
double mjd2epj( /* Modified Julian Day to Julian epoch */
double dj); /* Modified Julian Date */
char *mjd2fd( /* Modified Julian Day to FITS date yyyy-mm-ddThh:mm
:ss.ss */
double dj); /* Modified Julian Date */
void mjd2i( /* Modified Julian Day to year, month, day, hours, m
in, sec */
double dj, /* Modified Julian Date */
int *iyr, /* year (returned) */
int *imon, /* month (returned) */
int *iday, /* day (returned) */
int *ihr, /* hours (returned) */
int *imn, /* minutes (returned) */
double *sec, /* seconds (returned) */
int ndsec); /* Number of decimal places in seconds (0=int) */
double mjd2jd( /* Modified Julian Day to Julian day */
double dj); /* Modified Julian Date */
double mjd2ts( /* Modified Julian Day to seconds since 1950.0 */
double dj); /* Modified Julian Date */
/* Convert from seconds since 1950-01-01 0:00 (JPL Ephemeris time) */
void ts2dt( /* Seconds since 1950.0 to yyyy.mmdd hh.mmss
ss */
double tsec, /* seconds since 1950.0 */
double *date, /* Date as yyyy.mmdd (returned)*/
double *time); /* Time as hh.mmssxxxx (returned) */
double ts2ep( /* Seconds since 1950.0 to fractional year */
double tsec); /* seconds since 1950.0 */
double ts2epb( /* Seconds since 1950.0 to Besselian epoch */
double tsec); /* seconds since 1950.0 */
double ts2epj( /* Seconds since 1950.0 to Julian epoch */
double tsec); /* seconds since 1950.0 */
char *ts2fd( /* Seconds since 1950.0 to FITS date, yyyy-mm-ddT00:
00:00.000 */
double tsec); /* seconds since 1950.0 */
void ts2i( /* Seconds since 1950.0 to year, month, day, hours, min, sec
*/
double tsec, /* seconds since 1950.0 */
int *iyr, /* year (returned) */
int *imon, /* month (returned) */
int *iday, /* day (returned) */
int *ihr, /* hours (returned) */
int *imn, /* minutes (returned) */
double *sec, /* seconds (returned) */
int ndsec); /* Number of decimal places in seconds (0=int) */
double ts2jd( /* Seconds since 1950.0 to Julian Day */
double tsec); /* seconds since 1950.0 */
double ts2mjd( /* Seconds since 1950.0 to Modified Julian Day */
double tsec); /* seconds since 1950.0 */
/* Convert from IRAF time (seconds since 1980-01-01 0:00 UT) */
char *tsi2fd( /* Seconds since 1980-01-01 to FITS standard date st
ring */
int isec); /* Seconds past 1980-01-01 */
double tsi2ts( /* Seconds since 1980-01-01 to seconds since 1950-01-01
*/
int isec); /* Seconds past 1980-01-01 */
void tsi2dt( /* Seconds since 1980-01-01 to date yyyy.mmdd, time
hh.mmssss */
int isec, /* Seconds past 1980-01-01 */
double *date, /* Date as yyyy.mmdd (returned) */
double *time); /* Time as hh.mmssxxxx (returned) */
/* Convert from Unix time (seconds since 1970-01-01 0:00 UT) */
void tsu2dt( /* Seconds since 1970-01-01 to date yyyy.ddmm, time
hh.mmsss */
time_t isec, /* Seconds past 1970-01-01 */
double *date, /* Date as yyyy.mmdd (returned) */
double *time); /* Time as hh.mmssxxxx (returned) */
char *tsu2fd( /* Seconds since 1970-01-01 to FITS standard date st
ring */
time_t isec); /* Seconds past 1970-01-01 */
double tsu2ts( /* Seconds since 1970-01-01 to seconds since 1950-01-01
*/
time_t isec); /* Seconds past 1970-01-01 */
int tsu2tsi( /* Seconds since 1970-01-01 to local seconds since 1
980-01-01 */
time_t isec); /* Seconds past 1970-01-01 */
/* Convert times within a day */
char *tsd2fd( /* Seconds since start of day to FITS standard time
string */
double tsec); /* Seconds since start of day */
double tsd2dt( /* Seconds since start of day to hh.mmsssss */
double tsec); /* Seconds since start of day */
/* Convert from current Universal Time */
void ut2dt( /* Current Universal Time to date (yyyy.mmdd
), time (hh.mmsss) */
double *date, /* Date as yyyy.mmdd (returned) */
double *time); /* Time as hh.mmssxxxx (returned) */
void ut2doy( /* Current Universal Time to year, day of year */
int *year, /* Year (returned) */
double *doy); /* Day of year (returned) */
double ut2ep(void); /* Current Universal Time to fractional year
*/
double ut2epb(void); /* Current Universal Time to Besselian Epoch */
double ut2epj(void); /* Current Universal Time to Julian Epoch */
char *ut2fd(void); /* Current Universal Time to FITS ISO date string */
double ut2jd(void); /* Current Universal Time to Julian Date */
double ut2mjd(void); /* Current Universal Time to Modified Julian Date
*/
int ut2tsi(void); /* Current UT to IRAF seconds since 1980-01-01T00:00
*/
time_t ut2tsu(void); /* Current UT to Unix seconds since 1970-01-01T00:
00 */
double ut2ts(void); /* Current UT to seconds since 1950-01-01T00
:00 */
int isdate( /* Return 1 if string is FITS old or ISO dat
e */
char *string); /* Possible FITS date string, which may be:
* dd/mm/yy (FITS standard before 2000)
* dd-mm-yy (nonstandard FITS use before 2000)
* yyyy-mm-dd (FITS standard after 1999)
* yyyy-mm-ddThh:mm:ss.ss (FITS standard after 1999
) */
/* Ephemeris time conversions (ET, TT, and TDT) */
char *et2fd( /* ET (or TDT or TT) in FITS format to UT in FITS fo
rmat */
char *string); /* Ephemeris Time as FITS date string (E not T) */
char *fd2et( /* UT in FITS format to ET (or TDT or TT) in FITS fo
rmat */
char *string); /* FITS date string */
void dt2et( /* yyyy.ddmm and hh.mmsss to Ephemeris Time
*/
double *date, /* Date as yyyy.mmdd */
double *time); /* Time as hh.mmssxxxx
*if time<0, it is time as -(fraction of a day) */
double jd2jed( /* Convert from Julian Date to Julian Ephemeris Date
*/
double dj); /* Julian Date */
double jed2jd( /* Convert from Julian Ephemeris Date to Julian Date
*/
double dj); /* Julian Ephemeris Date */
double ets2ts( /* ET in seconds since 1950-01-01 to UT in same form
at */
double tsec); /* ET in seconds since 1950-01-01 */
double ts2ets( /* UT in seconds since 1950-01-01 to ET in same form
at */
double tsec); /* UT in seconds since 1950-01-01 */
void edt2dt( /* yyyy.ddmm and hh.mmsss Ephemeris Time to UT */
double *date, /* Date as yyyy.mmdd */
double *time); /* Time as hh.mmssxxxx
* If time<0, it is time as -(fraction of a day) */
double utdt( /* Compute difference between UT and dynamical time
(ET-UT) */
double dj); /* Julian Date (UT) */
/* Sidereal Time conversions */
char *fd2gst( /* Convert from FITS UT date to Greenwich Sidereal T
ime */
char *string); /* FITS date string */
void dt2gst( /* Convert from UT as yyyy.mmdd hh.mmssss to Greenwi
ch Sidereal Time */
double *date, /* Date as yyyy.mmdd */
double *time); /* Time as hh.mmssxxxx
* If time<0, it is time as -(fraction of a day) */
double jd2gst( /* Calculate Greenwich Sidereal Time given Julian Da
te */
double dj); /* Julian Date (UT) */
double ts2gst( /* Calculate Greenwich Sidereal Time given Universal
Time */
double tsec); /* Time since 1950.0 in UT seconds */
char *fd2lst( /* Convert from FITS UT date to Local Sidereal Time
*/
char *string); /* FITS date string */
void dt2lst( /* Convert from UT as yyyy.mmdd hh.mmssss to Local S
idereal Time */
double *date, /* Date as yyyy.mmdd */
double *time); /* Time as hh.mmssxxxx
* If time<0, it is time as -(fraction of a day) */
double ts2lst( /* Calculate Local Sidereal Time given Universal Tim
e */
double tsec); /* Time since 1950.0 in UT seconds */
double jd2lst( /* Calculate Local Sidereal Time given Julian Date *
/
double dj); /* Julian Date (UT) */
double eqeqnx( /* Compute equation of eqinoxes from Julian Date */
double dj); /* Julian Date (UT) */
char *fd2mst( /* Convert from FITS UT date to Mean Sidereal Time *
/
char *string); /* FITS date string */
double jd2mst( /* Convert from Julian Date to Mean Sidereal Time */
double dj); /* Julian Date (UT) */
double jd2mst2( /* Convert from Julian Date to Mean Sidereal Time */
double dj); /* Julian Date (UT) */
void dt2mst( /* Convert from UT as yyyy.mmdd hh.mmssss to Mean Si
dereal Time */
double *date, /* Date as yyyy.mmdd */
double *time); /* Time as hh.mmssxxxx
* If time<0, it is time as -(fraction of a day) */
double lst2dt( /* Calculate UT as hh.mmsss given UT date and
* Local Sidereal Time */
double date0, /* UT date as yyyy.mmdd */
double time0); /* LST as hh.mmssss */
double lst2jd( /* Calculate UT as Julian Date given UT date and
* Local Sidereal Time */
double sdj); /* Julian Date of desired day at 0:00 UT + sidereal
time */
char *lst2fd( /* Calculate FITS UT date and time given UT date and
* Local Sidereal Time */
char *string); /* UT Date, LST as yyyy-mm-ddShh:mm:ss.ss */
char *gst2fd( /* Calculate FITS UT date and time given Greenwich S
idereal Time */
char *string); /* UT Date, GST as yyyy-mm-ddShh:mm:ss.ss */
double gst2jd( /* Calculate FITS UT Julian Date given Greenwich Sid
ereal Time */
double sdj); /* UT Date, GST as Julian Date */
char *mst2fd( /* Calculate FITS UT date and time given Mean Sidere
al Time */
char *string); /* UT Date, MST as yyyy-mm-ddShh:mm:ss.ss */
double mst2jd( /* Calculate FITS UT Julian Date given Mean Sidereal
Time */
double sdj); /* UT Date, MST as Julian Date */
double ts2mst( /* Calculate Mean Sidereal Time given Universal Time
*/
double tsec); /* time since 1950.0 in UT seconds */
void setlongitude( /* Longitude for sidereal time in or out */
double longitude); /* longitude of observatory in degrees (+=west) *
/
void compnut( /* Compute nutation in longitude and obliquity and m
ean obliquity*/
double dj, /* TDB (loosely ET or TT) as Julian Date */
double *dpsi, /* Nutation in longitude in radians (returned) */
double *deps, /* Nutation in obliquity in radians (returned) */
double *eps0); /* Mean obliquity in radians (returned) */
/* Heliocentric Julian Date conversions */
double mjd2mhjd( /* Convert from Modified Julian Date to Heliocentric
MJD */
double mjd, /* Julian date (geocentric) */
double ra, /* Right ascension (degrees) */
double dec, /* Declination (degrees) */
int sys); /* J2000, B1950, GALACTIC, ECLIPTIC */
double mjd2hjd( /* Convert from Modified Julian Date to Heliocentric JD
*/
double mjd, /* Julian date (geocentric) */
double ra, /* Right ascension (degrees) */
double dec, /* Declination (degrees) */
int sys); /* J2000, B1950, GALACTIC, ECLIPTIC */
double mhjd2mjd( /* Convert from Heliocentric Modified Julian Date to
MJD */
double mhjd, /* Modified Heliocentric Julian date */
double ra, /* Right ascension (degrees) */
double dec, /* Declination (degrees) */
int sys); /* J2000, B1950, GALACTIC, ECLIPTIC */
double jd2hjd( /* Convert from Julian Date to Heliocentric Julian Date
*/
double dj, /* Julian date (geocentric) */
double ra, /* Right ascension (degrees) */
double dec, /* Declination (degrees) */
int sys); /* J2000, B1950, GALACTIC, ECLIPTIC */
double hjd2jd( /* Convert from Heliocentric Julian Date to Julian Date
*/
double dj, /* Heliocentric Julian date */
double ra, /* Right ascension (degrees) */
double dec, /* Declination (degrees) */
int sys); /* J2000, B1950, GALACTIC, ECLIPTIC */
void setdatedec( /* Set number of decimal places in FITS dates */
int nd); /* Number of decimal places in FITS dates */
#else /* K&R prototypes */
/* FITS file access subroutines in fitsfile.c */ /* FITS file access subroutines in fitsfile.c */
extern int fitsropen(); extern int fitsropen();
extern char *fitsrhead(); extern char *fitsrhead();
extern char *fitsrtail(); extern char *fitsrtail();
extern char *fitsrimage(); extern char *fitsrimage();
extern char *fitsrfull(); extern char *fitsrfull();
extern char *fitsrsect(); extern char *fitsrsect();
extern int fitswhead(); extern int fitswhead();
extern int fitswexhead(); extern int fitswexhead();
extern int fitswext(); extern int fitswext();
skipping to change at line 193 skipping to change at line 1043
void jd2dt(); /* Julian date to yyyy.mmdd hh.mmssss */ void jd2dt(); /* Julian date to yyyy.mmdd hh.mmssss */
double jd2ep(); /* Julian date to fractional year */ double jd2ep(); /* Julian date to fractional year */
double jd2epb(); /* Julian date to Besselian epoch */ double jd2epb(); /* Julian date to Besselian epoch */
double jd2epj(); /* Julian date to Julian epoch */ double jd2epj(); /* Julian date to Julian epoch */
char *jd2fd(); /* Julian date to FITS date string yyyy-mm-ddThh:mm:ss.ss */ char *jd2fd(); /* Julian date to FITS date string yyyy-mm-ddThh:mm:ss.ss */
void jd2i(); /* Julian date to year, month, day, hours, min., sec. */ void jd2i(); /* Julian date to year, month, day, hours, min., sec. */
double jd2mjd(); /* Julian date to modified Julian date */ double jd2mjd(); /* Julian date to modified Julian date */
double jd2ts(); /* Julian date to seconds since 1950.0 */ double jd2ts(); /* Julian date to seconds since 1950.0 */
time_t jd2tsu(); /* Julian date to Unix seconds since 1970-01-01T00:00 */ time_t jd2tsu(); /* Julian date to Unix seconds since 1970-01-01T00:00 */
int jd2tsi(); /* Julian date to IRAF seconds since 1980-01-01T00:00 */ int jd2tsi(); /* Julian date to IRAF seconds since 1980-01-01T00:00 */
void lt2dt(); /* Current local time to date (yyyy.mmdd), time (hh.mmsss) * / void lt2dt(); /* Current local time to date (yyyy.mmdd), time (hh.mmsss) * /
char *lt2fd(); /* Current local time to FITS ISO date string */ char *lt2fd(); /* Current local time to FITS ISO date string */
int lt2tsi(); /* Current local time to IRAF seconds since 1980-01-01T00:00 */ int lt2tsi(); /* Current local time to IRAF seconds since 1980-01-01T00:00 */
time_t lt2tsu(); /* Current local time to Unix seconds since 1970-01-01T00: 00 */ time_t lt2tsu(); /* Current local time to Unix seconds since 1970-01-01T00: 00 */
double lt2ts(); /* Current local time to IRAF seconds since 1950-01-01T00:0 0 */ double lt2ts(); /* Current local time to IRAF seconds since 1950-01-01T00:0 0 */
void mjd2doy(); /* Convert from Modified Julian Date to Day of Year */
void mjd2dt(); /* Modified Julian date to yyyy.mmdd hh.mmssss */ void mjd2dt(); /* Modified Julian date to yyyy.mmdd hh.mmssss */
double mjd2ep(); /* Modified Julian date to fractional year */ double mjd2ep(); /* Modified Julian date to fractional year */
double mjd2epb(); /* Modified Julian date to Besselian epoch */ double mjd2epb(); /* Modified Julian date to Besselian epoch */
double mjd2epj(); /* Modified Julian date to Julian epoch */ double mjd2epj(); /* Modified Julian date to Julian epoch */
char *mjd2fd(); /* Modified Julian date to FITS date yyyy-mm-ddThh:m m:ss.ss */ char *mjd2fd(); /* Modified Julian date to FITS date yyyy-mm-ddThh:m m:ss.ss */
void mjd2i(); /* Modified Julian date to year, month, day, hours, min, sec */ void mjd2i(); /* Modified Julian date to year, month, day, hours, min, sec */
double mjd2jd(); /* Modified Julian date to Julian date */ double mjd2jd(); /* Modified Julian date to Julian date */
double mjd2ts(); /* Modified Julian date to seconds since 1950.0 */ double mjd2ts(); /* Modified Julian date to seconds since 1950.0 */
void ts2dt(); /* Seconds since 1950.0 to yyyy.mmdd hh.mmssss */ void ts2dt(); /* Seconds since 1950.0 to yyyy.mmdd hh.mmssss */
double ts2ep(); /* Seconds since 1950.0 to fractional year */ double ts2ep(); /* Seconds since 1950.0 to fractional year */
double ts2epb(); /* Seconds since 1950.0 to Besselian epoch */ double ts2epb(); /* Seconds since 1950.0 to Besselian epoch */
double ts2epj(); /* Seconds since 1950.0 to Julian epoch */ double ts2epj(); /* Seconds since 1950.0 to Julian epoch */
char *ts2fd(); /* Seconds since 1950.0 to FITS date, yyyy-mm-ddT00:00:00.00 0 */ char *ts2fd(); /* Seconds since 1950.0 to FITS date, yyyy-mm-ddT00:00:00.00 0 */
void ts2i(); /* Seconds since 1950.0 to year, month, day, hours, min, sec */ void ts2i(); /* Seconds since 1950.0 to year, month, day, hours, min, sec */
double ts2jd(); /* Seconds since 1950.0 to Julian date */ double ts2jd(); /* Seconds since 1950.0 to Julian date */
double ts2mjd(); /* Seconds since 1950.0 to modified Julian date */ double ts2mjd(); /* Seconds since 1950.0 to modified Julian date */
char *tsi2fd(); /* Seconds since 1980-01-01 to FITS standard date st ring */ char *tsi2fd(); /* Seconds since 1980-01-01 to FITS standard date st ring */
double tsi2ts(); /* Seconds since 1980-01-01 to seconds since 1950-01-01 */ double tsi2ts(); /* Seconds since 1980-01-01 to seconds since 1950-01-01 */
skipping to change at line 274 skipping to change at line 1128
char *gst2fd(); /* Calculate FITS UT date and time given Greenwich Sidereal Time */ char *gst2fd(); /* Calculate FITS UT date and time given Greenwich Sidereal Time */
double gst2jd(); /* Calculate FITS UT Julian Date given Greenwich Sidereal Time */ double gst2jd(); /* Calculate FITS UT Julian Date given Greenwich Sidereal Time */
char *mst2fd(); /* Calculate FITS UT date and time given Mean Sidereal Time */ char *mst2fd(); /* Calculate FITS UT date and time given Mean Sidereal Time */
double mst2jd(); /* Calculate FITS UT Julian Date given Mean Sidereal Time */ double mst2jd(); /* Calculate FITS UT Julian Date given Mean Sidereal Time */
char *fd2mst(); /* Convert from FITS UT date to Mean Sidereal Time * / char *fd2mst(); /* Convert from FITS UT date to Mean Sidereal Time * /
void dt2mst(); /* Convert from UT as yyyy.mmdd hh.mmssss to Mean Sidereal T ime */ void dt2mst(); /* Convert from UT as yyyy.mmdd hh.mmssss to Mean Sidereal T ime */
double ts2mst(); /* Calculate Mean Sidereal Time given Universal Time */ double ts2mst(); /* Calculate Mean Sidereal Time given Universal Time */
double mjd2mhjd(); /* Convert from Modified Julian Date to Heliocentric MJD */ double mjd2mhjd(); /* Convert from Modified Julian Date to Heliocentric MJD */
double mjd2hjd(); /* Convert from Modified Julian Date to Heliocentric JD * / double mjd2hjd(); /* Convert from Modified Julian Date to Heliocentric JD * /
double mhjd2mjd(); /* Convert from Heliocentric Modified Julian Date to MJD */ double mhjd2mjd(); /* Convert from Heliocentric Modified Julian Date to MJD */
void mjd2doy(); /* Convert from Modified Julian Date to Day of Year */
double jd2hjd(); /* Convert from Julian Date to Heliocentric Julian Date */ double jd2hjd(); /* Convert from Julian Date to Heliocentric Julian Date */
double jd2mhjd(); /* Convert from Julian Date to Modified Heliocentric JD * / double jd2mhjd(); /* Convert from Julian Date to Modified Heliocentric JD * /
double hjd2jd(); /* Convert from Heliocentric Julian Date to Julian Date */ double hjd2jd(); /* Convert from Heliocentric Julian Date to Julian Date */
double hjd2mjd(); /* Convert from Heliocentric Julian Date to Modified JD * / double hjd2mjd(); /* Convert from Heliocentric Julian Date to Modified JD * /
double hjd2mhjd(); /* Convert from Heliocentric Julian Date to Modified HJD */ double hjd2mhjd(); /* Convert from Heliocentric Julian Date to Modified HJD */
void setdatedec(); /* Set number of decimal places in FITS dates */ void setdatedec(); /* Set number of decimal places in FITS dates */
void setlongitude(); /* Longitude for sidereal time in or out */ void setlongitude(); /* Longitude for sidereal time in or out */
void compnut(); /* Compute nutation in longitude and obliquity and m ean obliquity*/ void compnut(); /* Compute nutation in longitude and obliquity and m ean obliquity*/
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* fitsfile_h_ */ #endif /* fitsfile_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
* Jul 10 1996 FITS header now allocated in subroutines * Jul 10 1996 FITS header now allocated in subroutines
* Jul 17 1996 Add FITS table column extraction subroutines * Jul 17 1996 Add FITS table column extraction subroutines
* Aug 6 1996 Add MOVEPIX, HDEL and HCHANGE declarations * Aug 6 1996 Add MOVEPIX, HDEL and HCHANGE declarations
* *
* Oct 10 1997 FITS file opening subroutines now return int instead of FILE * * Oct 10 1997 FITS file opening subroutines now return int instead of FILE *
* *
skipping to change at line 342 skipping to change at line 1201
* May 3 2004 Add setfitsinherit() * May 3 2004 Add setfitsinherit()
* May 6 2004 Add fitswexhead() * May 6 2004 Add fitswexhead()
* 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
*/ */
 End of changes. 9 change blocks. 
3 lines changed or deleted 983 lines changed or added


 fitshead.h   fitshead.h 
/*** File fitshead.h FITS header access subroutines /*** File fitshead.h FITS header access subroutines
*** June 29, 2006 *** January 9, 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-2006 *** 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.
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 39 skipping to change at line 39
/* Declarations for subroutines in hget.c, hput.c, and iget.c */ /* Declarations for subroutines in hget.c, hput.c, and iget.c */
#ifndef _fitshead_h_ #ifndef _fitshead_h_
#define _fitshead_h_ #define _fitshead_h_
#include <sys/types.h> #include <sys/types.h>
#ifdef __cplusplus /* C++ prototypes */ #ifdef __cplusplus /* C++ prototypes */
extern "C" { extern "C" {
#endif
#ifdef __STDC__ /* Full ANSI prototypes */
/* Subroutines in hget.c */ /* Subroutines in hget.c */
int hgeti2( /* Extract short value from FITS hea der */ int hgeti2( /* Extract short value from FITS hea der */
const char* hstring, /* FITS header string */ const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
short* val); /* short integer value (returned) */ short* val); /* short integer value (returned) */
int hgeti4c( /* Extract int value from FITS header */ int hgeti4c( /* Extract int value from FITS header */
const char* hstring, /* FITS header string */ const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
const char mchar, /* WCS to use */ const char* wchar, /* WCS to use (A-Z or null) */
int* val); /* integer value (returned) */ int* val); /* integer value (returned) */
int hgeti4( /* Extract int value from FITS heade r */ int hgeti4( /* Extract int value from FITS heade r */
const char* hstring, /* FITS header string */ const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
int* val); /* integer value (returned) */ int* val); /* integer value (returned) */
int hgetr4( /* Extract float value from FITS hea der */ int hgetr4( /* Extract float value from FITS hea der */
const char* hstring, /* FITS header string */ const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
float* val); /* float value (returned) */ float* val); /* float value (returned) */
int hgetr8c( /* Extract double value from FITS he ader */ int hgetr8c( /* Extract double value from FITS header */
const char* hstring, /* FITS header string */ const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
const char mchar, /* WCS to use */ const char* wchar, /* WCS to use (A-Z or null) */
double* val); /* double value (returned) */ double* val); /* double value (returned) */
int hgetr8( /* Extract double value from FITS he ader */ int hgetr8( /* Extract double value from FITS he ader */
const char* hstring, /* FITS header string */ const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
double* val); /* double value (returned) */ double* val); /* double value (returned) */
int hgetra( /* Extract right ascension from FITS header */ int hgetra( /* Extract right ascension from FITS header */
const char* hstring, /* FITS header string */ const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
double* ra); /* RA in degrees (returned) */ double* ra); /* RA in degrees (returned) */
int hgetdec( /* Extract declination from FITS header */ int hgetdec( /* Extract declination from FITS header */
skipping to change at line 86 skipping to change at line 89
const char* hstring, /* FITS header string */ const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
double* date); /* Date in fractional years (returned) */ double* date); /* Date in fractional years (returned) */
int hgetl( /* Extract boolean value from FITS header */ int hgetl( /* Extract boolean value from FITS header */
const char* hstring, /* FITS header string */ const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
int* lval); /* 1 if T, 0 if F (returned) */ int* lval); /* 1 if T, 0 if F (returned) */
int hgetsc( /* Extract string value from FITS he ader */ int hgetsc( /* Extract string value from FITS he ader */
const char* hstring, /* FITS header string */ const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
const char mchar, /* WCS to use */ const char* wchar, /* WCS to use (A-Z or null) */
const int lstr, /* maximum length of returned string */ const int lstr, /* maximum length of returned string */
char* string); /* null-terminated string value (returned) * / char* string); /* null-terminated string value (returned) * /
int hgets( /* Extract string value from FITS header */ int hgets( /* Extract string value from FITS header */
const char* hstring, /* FITS header string */ const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
const int lstr, /* maximum length of returned string */ const int lstr, /* maximum length of returned string */
char* string); /* null-terminated string value (returned) * / char* string); /* null-terminated string value (returned) * /
int hgetm ( /* Extract string from multiple keyw ords */ int hgetm ( /* Extract string from multiple keyw ords */
const char* hstring, /* FITS header string */ const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
skipping to change at line 132 skipping to change at line 135
char *strcsrch ( /* Find string s2 within string s1 (no case) */ char *strcsrch ( /* Find string s2 within string s1 (no case) */
const char* s1, /* String to search */ const char* s1, /* String to search */
const char* s2); /* String to look for */ const char* s2); /* String to look for */
char *strncsrch ( /* Find string s2 within string s1 (no case) */ char *strncsrch ( /* Find string s2 within string s1 (no case) */
const char* s1, /* String to search */ const char* s1, /* String to search */
const char* s2, /* String to look for */ const char* s2, /* String to look for */
const int ls1); /* Length of string being searched */ const int ls1); /* Length of string being searched */
int hlength( /* Set length of unterminated FITS header */ int hlength( /* Set length of unterminated FITS header */
char *header, /* FITS header */ const char *header, /* FITS header */
const int lhead); /* Allocated length of FITS header */ const int lhead); /* Allocated length of FITS header */
int gethlength( /* Get length of current FITS header */ int gethlength( /* Get length of current FITS header */
char *header); /* FITS header */ char* header); /* FITS header */
double str2ra( /* Return RA in degrees from string */ double str2ra( /* Return RA in degrees from string */
const char* in); /* Character string (hh:mm:ss.sss or dd.dddd ) */ const char* in); /* Character string (hh:mm:ss.sss or dd.dddd ) */
double str2dec( /* Return Dec in degrees from string */ double str2dec( /* Return Dec in degrees from string */
const char* in); /* Character string (dd:mm:ss.sss or dd.dddd ) */ const char* in); /* Character string (dd:mm:ss.sss or dd.dddd ) */
int isnum( /* Return 1 if number, else 0 */ int isnum( /* Return 1 if number, else 0 */
const char* string); /* Character string which may be a number */ const char* string); /* Character string which may be a number */
int notnum( /* Return 0 if number, else 1 */ int notnum( /* Return 0 if number, else 1 */
const char* string); /* Character string which may be a number */ const char* string); /* Character string which may be a number */
int numdec( /* Return number of decimal places i n number */ int numdec( /* Return number of decimal places i n number */
const char* string); /* Character string which may be a number */ const char* string); /* Character string which may be a number */
void strfix( /* Clean up extraneous characters in string */ void strfix( /* Clean up extraneous characters in string */
char* string, /* Character string which may be a number */ char* string, /* Character string which may be a number */
int fillblank, /* If 1, blanks are replaced by underscores */ int fillblank, /* If 1, blanks are replaced by underscores */
int dropzero); /* If 1, drop trailing zeroes from string */ int dropzero); /* If 1, drop trailing zeroes from string */
char *getltime(); /* Return current local time in ISO format * char *getltime(void); /* Return current local time in ISO format *
/ /
char *getutime(); /* Return current UT as an ISO-format string char *getutime(void); /* Return current UT as an ISO-format string
*/ */
/* Subroutines in iget.c */ /* Subroutines in iget.c */
int mgetstr( /* Extract string from multiline FITS keywor d */ int mgetstr( /* Extract string from multiline FITS keywor d */
const char* hstring, /* FITS header string */ const char* hstring, /* FITS header string */
const char* mkey, /* FITS keyword root _n added for extra line s */ const char* mkey, /* FITS keyword root _n added for extra line s */
const char* keyword, /* IRAF keyword */ const char* keyword, /* IRAF keyword */
const int lstr, /* maximum length of returned string */ const int lstr, /* maximum length of returned string */
char* string); /* null-terminated string value (returned) * / char* string); /* null-terminated string value (returned) * /
int mgeti4( /* Extract int from multiline FITS k eyword */ int mgeti4( /* Extract int from multiline FITS k eyword */
const char* hstring, /* FITS header string */ const char* hstring, /* FITS header string */
const char* mkey, /* FITS keyword root _n added for extra line s */ const char* mkey, /* FITS keyword root _n added for extra line s */
const char* keyword, /* IRAF keyword */ const char* keyword, /* IRAF keyword */
int* ival); /* int keyword value (returned) */ int* ival); /* int keyword value (returned) */
int mgetr8( /* Extract double from multiline FIT S keyword */ int mgetr8( /* Extract double from multiline FIT S keyword */
const char* hstring, /* FITS header string */ const char* hstring, /* FITS header string */
const char* mkey, /* FITS keyword root _n added for extra line s */ const char* mkey, /* FITS keyword root _n added for extra line s */
const char* keyword, /* IRAF keyword */ const char* keyword, /* IRAF keyword */
double dval); /* double keyword value (returned) */ double* dval); /* double keyword value (returned) */
int igeti4( /* Extract int from IRAF keyword str ing */ int igeti4( /* Extract int from IRAF keyword str ing */
const char* hstring, /* Multiline IRAF keyword string value */ const char* hstring, /* Multiline IRAF keyword string value */
const char* keyword, /* IRAF keyword */ const char* keyword, /* IRAF keyword */
int* val); /* int value (returned) */ int* val); /* int value (returned) */
int igetr4( /* Extract float from IRAF keyword s tring */ int igetr4( /* Extract float from IRAF keyword s tring */
const char* hstring, /* Multiline IRAF keyword string value */ const char* hstring, /* Multiline IRAF keyword string value */
const char* keyword, /* IRAF keyword */ const char* keyword, /* IRAF keyword */
float* val); /* float value (returned) */ float* val); /* float value (returned) */
int igetr8( /* Extract double from IRAF keyword string */ int igetr8( /* Extract double from IRAF keyword string */
const char* hstring, /* Multiline IRAF keyword string value */ const char* hstring, /* Multiline IRAF keyword string value */
skipping to change at line 199 skipping to change at line 202
char* string); /* null-terminated string value (returned) * / char* string); /* null-terminated string value (returned) * /
char *igetc( /* Extract string from IRAF keyword string * / char *igetc( /* Extract string from IRAF keyword string * /
const char* hstring, /* Multiline IRAF keyword string value */ const char* hstring, /* Multiline IRAF keyword string value */
const char* keyword); /* IRAF keyword */ const char* keyword); /* IRAF keyword */
/* Subroutines in hput.c */ /* Subroutines in hput.c */
/* All hput* routines return 0 if successful, else -1 */ /* All hput* routines return 0 if successful, else -1 */
int hputi2( /* Implant short value into FITS header */ int hputi2( /* Implant short value into FITS header */
char* hstring, /* FITS header string (modified) */ char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
const short ival); /* short value */ short ival); /* short value */
int hputi4( /* Implant int value into FITS header */ int hputi4( /* Implant int value into FITS header */
char* hstring, /* FITS header string (modified) */ char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
const int ival); /* int value */ const int ival); /* int value */
int hputr4( /* Implant float value into FITS header */ int hputr4( /* Implant float value into FITS header */
char* hstring, /* FITS header string (modified) */ char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
const float rval); /* float value */ const float* rval); /* float (4 byte) value */
int hputr8( /* Implant short into FITS header */ int hputr8( /* Implant short into FITS header */
char* hstring, /* FITS header string (modified) */ char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
const double dval); /* double value */ const double dval); /* double value */
int hputnr8( /* double with specified number of decimal places */ int hputnr8( /* double with specified number of decimal places */
char* hstring, /* FITS header string (modified) */ char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
const int ndec, /* Number of decimal places in keyword value */ const int ndec, /* Number of decimal places in keyword value */
const double dval); /* double value */ const double dval); /* double value */
int hputs( /* Quoted character string into FITS header */ int hputs( /* Quoted character string into FITS header */
char* hstring, /* FITS header string (modified) */ char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
const char* cval); /* Character string value */ const char* cval); /* Character string value */
int hputm( /* Quoted character string, mutiple keywords */ int hputm( /* Quoted character string, mutiple keywords */
char* hstring, /* FITS header string (modified) */ char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
const char* cval); /* Character string value */ const char* cval); /* Character string value */
int hputcom( /* Add comment to keyword line in FITS heade r */ int hputcom( /* Add comment to keyword line in FITS header */
char* hstring, /* FITS header string (modified) */ char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
const char* comment); /* Comment string */ const char* comment); /* Comment string */
int hputra( /* Right ascension in degrees into hh:mm:ss.sss */ int hputra( /* Right ascension in degrees into hh:mm:ss.sss */
char* hstring, /* FITS header string (modified) */ char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
const double ra); /* Right ascension in degrees */ const double ra); /* Right ascension in degrees */
int hputdec( /* Declination in degrees into dd:mm:ss.ss * / int hputdec( /* Declination in degrees into dd:mm:ss.ss * /
char* hstring, /* FITS header string (modified) */ char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */ const char* keyword, /* FITS keyword */
skipping to change at line 281 skipping to change at line 284
const int ndec); /* Number of decimal places in degrees */ const int ndec); /* Number of decimal places in degrees */
void num2str( /* Format number into string */ void num2str( /* Format number into string */
char *string, /* Character string (returned) */ char *string, /* Character string (returned) */
const double num, /* Number */ const double num, /* Number */
const int field, /* Total field size in characters */ const int field, /* Total field size in characters */
const int ndec); /* Number of decimal places */ const int ndec); /* Number of decimal places */
void setheadshrink( /* 0 to keep blank line when keyword deleted */ void setheadshrink( /* 0 to keep blank line when keyword deleted */
const int hsh); /* 1 to shrink header by one line */ const int hsh); /* 1 to shrink header by one line */
void setleaveblank( /* 1 to keep blank line where keywor d deleted */ void setleaveblank( /* 1 to keep blank line where keywor d deleted */
const int hsh); /* 0 to shrink header by one line */ const int hsh); /* 0 to shrink header by one line */
};
#else /* __cplusplus */ #else /* K&R prototypes */
/* Subroutines in hget.c */ /* Subroutines in hget.c */
/* Extract a value from a FITS header for given keyword */ /* Extract a value from a FITS header for given keyword */
extern int hgeti4(); /* int (Multiple WCS) */ extern int hgeti4(); /* int (Multiple WCS) */
extern int hgeti4c(); /* int */ extern int hgeti4c(); /* int */
extern int hgeti2(); /* short */ extern int hgeti2(); /* short */
extern int hgetr4(); /* float */ extern int hgetr4(); /* float */
extern int hgetr8(); /* double */ extern int hgetr8(); /* double */
extern int hgetr8c(); /* double (Multiple WCS) */ extern int hgetr8c(); /* double (Multiple WCS) */
skipping to change at line 374 skipping to change at line 377
extern void ra2str(); extern void ra2str();
extern void dec2str(); extern void dec2str();
extern void deg2str(); extern void deg2str();
extern void num2str(); extern void num2str();
extern int numdec(); /* Return number of decimal places in number */ extern int numdec(); /* Return number of decimal places in number */
extern char *getltime(); /* Return current local time in ISO format */ extern char *getltime(); /* Return current local time in ISO format */
extern char *getutime(); /* Return current UT as an ISO-format string */ extern char *getutime(); /* Return current UT as an ISO-format string */
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* fitshead_h_ */ #endif /* fitshead_h_ */
/* Apr 26 1996 Add HGETDATE to get year from date string /* Apr 26 1996 Add HGETDATE to get year from date string
* May 22 1996 Return double from STR2RA and STR2DEC * May 22 1996 Return double from STR2RA and STR2DEC
* 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
* Jul 10 1996 FITS header now allocated in subroutines * Jul 10 1996 FITS header now allocated in subroutines
* Jul 17 1996 Add FITS table column extraction subroutines * Jul 17 1996 Add FITS table column extraction subroutines
* Jul 19 1996 Add declarations for header implanting subroutines * Jul 19 1996 Add declarations for header implanting subroutines
* Aug 5 1996 Add HLENGTH for FITS headers which are not null-terminated * Aug 5 1996 Add HLENGTH for FITS headers which are not null-terminated
skipping to change at line 426 skipping to change at line 434
* *
* Sep 23 2003 Change mgets() to mgetstr() to avoid name collision at UCO L ick * Sep 23 2003 Change mgets() to mgetstr() to avoid name collision at UCO L ick
* Oct 20 2003 Add numdec() to return the number of decimal places in a str ing * Oct 20 2003 Add numdec() to return the number of decimal places in a str ing
* *
* Feb 26 2004 Add igetc(), formerly internal to iget.c * Feb 26 2004 Add igetc(), formerly internal to iget.c
* Jul 1 2004 Add setheadshrink() for hdel() * Jul 1 2004 Add setheadshrink() for hdel()
* Aug 30 2004 Add numdec() to non-C++ declarations * Aug 30 2004 Add numdec() to non-C++ declarations
* *
* May 22 2006 Add setleaveblank() to leave blank line where keyword is del eted * May 22 2006 Add setleaveblank() to leave blank line where keyword is del eted
* Jun 28 2006 Add strfix() to clean up characters in strings * Jun 28 2006 Add strfix() to clean up characters in strings
* Nov 29 2006 Drop semicolon at end of C++ ifdef
*
* Jan 9 2007 Fix declarations so ANSI prototypes are not just for C++
*/ */
 End of changes. 20 change blocks. 
20 lines changed or deleted 31 lines changed or added


 imio.h   imio.h 
/*** imio.h memory access subroutines /*** imio.h memory access subroutines
*** September 27, 1999 *** January 5, 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-2002 *** 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.
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. 
2 lines changed or deleted 189 lines changed or added


 wcs.h   wcs.h 
/*** File libwcs/wcs.h /*** File libwcs/wcs.h
*** April 21, 2006 *** January 10, 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-2006 *** 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.
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 256 skipping to change at line 256
/* TNX permitted types of surfaces */ /* TNX 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 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 /* allan: 28.4.98: added C++ prototypes */ #ifdef __cplusplus /* C++ prototypes */
extern "C" { extern "C" {
#endif
/* WCS subroutines in wcs.c */ #ifdef __STDC__ /* Full ANSI prototypes */
struct WorldCoor *wcsinit (const char* hstring);
struct WorldCoor *wcsninit ( /* WCS data structure initialization subroutines in wcsinit.c */
struct WorldCoor *wcsinit ( /* set up WCS structure from a FITS image h
eader */
const char* hstring);
struct WorldCoor *wcsninit ( /* set up WCS structure from a FITS image
header */
const char* hstring, /* FITS header */ const char* hstring, /* FITS header */
int len); /* Length of FITS header */ int len); /* Length of FITS header */
struct WorldCoor *wcsinitn (
struct WorldCoor *wcsinitn ( /* set up WCS structure from a FITS image
header */
const char* hstring, /* FITS header */ const char* hstring, /* FITS header */
const char* wcsname); /* WCS name */ const char* wcsname); /* WCS name */
struct WorldCoor *wcsninitn (
struct WorldCoor *wcsninitn ( /* set up WCS structure from a FITS image
header */
const char* hstring, /* FITS header */ const char* hstring, /* FITS header */
int len, /* Length of FITS header */ int len, /* Length of FITS header */
const char* wcsname); /* WCS name */ const char* wcsname); /* WCS name */
struct WorldCoor *wcsinitc (
struct WorldCoor *wcsinitc ( /* set up WCS structure from a FITS image
header */
const char* hstring, /* FITS header */ const char* hstring, /* FITS header */
const char wcschar); /* WCS character (A-Z) */ char *wcschar); /* WCS character (A-Z) */
struct WorldCoor *wcsninitc (
struct WorldCoor *wcsninitc ( /* set up WCS structure from a FITS image
header */
const char* hstring, /* FITS header */ const char* hstring, /* FITS header */
int len, /* Length of FITS header */ int len, /* Length of FITS header */
const char wcschar); /* WCS character (A-Z) */ char *wcschar); /* WCS character (A-Z) */
void wcsfree (
/* WCS subroutines in wcs.c */
void wcsfree ( /* Free a WCS structure and its contents */
struct WorldCoor *wcs); /* World coordinate system structure */ struct WorldCoor *wcs); /* World coordinate system structure */
int iswcs( /* Returns 1 if wcs structure set, else 0 */ int wcstype( /* Set projection type from header CTYPEs */
struct WorldCoor *wcs, /* World coordinate system structure */
char *ctype1, /* FITS WCS projection for axis 1 */
char *ctype2); /* FITS WCS projection for axis 2 */
int iswcs( /* Returns 1 if wcs structure set, else 0 */
struct WorldCoor *wcs); /* World coordinate system structure */ struct WorldCoor *wcs); /* World coordinate system structure */
int nowcs( /* Returns 0 if wcs structure set, else 1 */ int nowcs( /* Returns 0 if wcs structure set, else 1 */
struct WorldCoor *wcs); /* World coordinate system structure */ struct WorldCoor *wcs); /* World coordinate system structure */
int pix2wcst ( int pix2wcst ( /* Convert pixel coordinates to World Coordinate str ing */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
double xpix, double xpix, /* Image horizontal coordinate in pixels */
double ypix, /* Image coordinates in pixels */ double ypix, /* Image vertical coordinate in pixels */
char *wcstring, /* World coordinate string (returned) */ char *wcstring, /* World coordinate string (returned) */
int lstr /* Length of world coordinate string (retur int lstr); /* Length of world coordinate string (returned) */
ned) */
);
int pix2wcs ( void pix2wcs ( /* Convert pixel coordinates to World Coordinates */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
double xpix, double xpix, /* Image horizontal coordinate in pixels */
double ypix, /* Image coordinates in pixels */ double ypix, /* Image vertical coordinate in pixels */
double *xpos, double *xpos, /* Longitude/Right Ascension in degrees (returned) *
double *ypos /* RA and Dec in degrees (returned) */ /
); double *ypos); /* Latitude/Declination in degrees (returned) */
void wcsc2pix ( void wcsc2pix ( /* Convert World Coordinates to pixel coordinates */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
double xpos, double xpos, /* Longitude/Right Ascension in degrees */
double ypos, /* World coordinates in degrees */ double ypos, /* Latitude/Declination in degrees */
char *coorsys, /* Coordinate system (B1950, J2000, etc) */ char *coorsys, /* Coordinate system (B1950, J2000, etc) */
double *xpix, double *xpix, /* Image horizontal coordinate in pixels (returned)
double *ypix, /* Image coordinates in pixels */ */
int *offscl); double *ypix, /* Image vertical coordinate in pixels (returned) */
int *offscl);
void wcs2pix ( void wcs2pix ( /* Convert World Coordinates to pixel coordinates */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
double xpos, double xpos, /* Longitude/Right Ascension in degrees */
double ypos, /* World coordinates in degrees */ double ypos, /* Latitude/Declination in degrees */
double *xpix, double *xpix, /* Image horizontal coordinate in pixels (returned)
double *ypix, /* Image coordinates in pixels */ */
int *offscl); double *ypix, /* Image vertical coordinate in pixels (returned) */
int *offscl);
double wcsdist( /* Compute angular distance between 2 sky po double wcsdist( /* Compute angular distance between 2 sky positions
sitions */ */
double ra0, /* World coordinates in degrees */ double ra1, /* First longitude/right ascension in degrees */
double dec0, double dec1, /* First latitude/declination in degrees */
double ra1, /* World coordinates in degrees */ double ra2, /* Second longitude/right ascension in degrees */
double dec1); double dec2); /* Second latitude/declination in degrees */
double wcsdiff( /* Compute angular distance between 2 sky po double wcsdiff( /* Compute angular distance between 2 sky positions
sitions */ */
double ra0, /* World coordinates in degrees */ double ra1, /* First longitude/right ascension in degrees */
double dec0, double dec1, /* First latitude/declination in degrees */
double ra1, /* World coordinates in degrees */ double ra2, /* Second longitude/right ascension in degrees */
double dec1); double dec2); /* Second latitude/declination in degrees */
struct WorldCoor* wcsxinit( 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 */
double xrpix, /* Reference pixel X coordinate */ double xrpix, /* Reference pixel X coordinate */
double yrpix, /* Reference pixel X coordinate */ double yrpix, /* Reference pixel X coordinate */
int nxpix, /* Number of pixels along x-axis */ int nxpix, /* Number of pixels along x-axis */
int nypix, /* Number of pixels along y-axis */ int nypix, /* Number of pixels along y-axis */
double rotate, /* Rotation angle (clockwise positive) in degrees * double rotate, /* Rotation angle (clockwise positive) in degrees */
/ int equinox, /* Equinox of coordinates, 1950 and 2000 supported *
int equinox, /* Equinox of coordinates, 1950 and 2000 supported /
*/ double epoch, /* Epoch of coordinates, used for FK4/FK5 conversion
double epoch, /* Epoch of coordinates, used for FK4/FK5 conversio
n
* no effect if 0 */ * no effect if 0 */
char *proj); /* Projection */ char *proj); /* Projection */
struct WorldCoor* wcskinit( /* set up WCS structure from keyword values */ struct WorldCoor* wcskinit( /* set up WCS structure from keyword values */
int naxis1, /* Number of pixels along x-axis */ int naxis1, /* Number of pixels along x-axis */
int naxis2, /* Number of pixels along y-axis */ int naxis2, /* Number of pixels along y-axis */
char *ctype1, /* FITS WCS projection for axis 1 */ char *ctype1, /* FITS WCS projection for axis 1 */
char *ctype2, /* FITS WCS projection for axis 2 */ char *ctype2, /* FITS WCS projection for axis 2 */
double crpix1, /* Reference pixel coordinates */ double crpix1, /* Reference pixel coordinates */
double crpix2, /* Reference pixel coordinates */ double crpix2, /* Reference pixel coordinates */
double crval1, /* Coordinate at reference pixel in degrees double crval1, /* Coordinate at reference pixel in degrees */
*/ double crval2, /* Coordinate at reference pixel in degrees */
double crval2, /* Coordinate at reference pixel in degrees double *cd, /* Rotation matrix, used if not NULL */
*/ double cdelt1, /* scale in degrees/pixel, if cd is NULL */
double *cd, /* Rotation matrix, used if not NULL */ double cdelt2, /* scale in degrees/pixel, if cd is NULL */
double cdelt1, /* scale in degrees/pixel, if cd is NULL */ double crota, /* Rotation angle in degrees, if cd is NULL */
double cdelt2, /* scale in degrees/pixel, if cd is NULL */ int equinox, /* Equinox of coordinates, 1950 and 2000 supported *
double crota, /* Rotation angle in degrees, if cd is NULL /
*/ double epoch); /* Epoch of coordinates, for FK4/FK5 conversion */
int equinox, /* Equinox of coordinates, 1950 and 2000 supported
*/
double epoch); /* Epoch of coordinates, for FK4/FK5 conversion */
void wcsshift( /* Change center of WCS */ void wcsshift( /* Change center of WCS */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
double cra, /* New center right ascension in degrees */ double cra, /* New center right ascension in degrees */
double cdec, /* New center declination in degrees */ double cdec, /* New center declination in degrees */
char *coorsys); /* FK4 or FK5 coordinates (1950 or 2000) */ char *coorsys); /* FK4 or FK5 coordinates (1950 or 2000) */
void wcsfull( void wcsfull( /* Return RA and Dec of image center, size in degree s */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
double *cra, /* Right ascension of image center (deg) (r double *cra, /* Right ascension of image center (deg) (returned)
eturned) */ */
double *cdec, /* Declination of image center (deg) (retur double *cdec, /* Declination of image center (deg) (returned) */
ned) */ double *width, /* Width in degrees (returned) */
double *width, /* Width in degrees (returned) */ double *height); /* Height in degrees (returned) */
double *height); /* Height in degrees (returned) */
void wcsrange( void wcscent( /* Print the image center and size in WCS units */
struct WorldCoor *wcs); /* World coordinate system structure */
void wcssize( /* Return image center and size in RA and Dec */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
double *ra1, /* Min. right ascension of image (deg) (ret double *cra, /* Right ascension of image center (deg) (returned)
urned) */ */
double *ra2, /* Max. right ascension of image (deg) (ret double *cdec, /* Declination of image center (deg) (returned) */
urned) */ double *dra, /* Half-width in right ascension (deg) (returned) */
double *dec1, /* Min. declination of image (deg) (returne double *ddec); /* Half-width in declination (deg) (returned) */
d) */
double *dec2); /* Max. declination of image (deg) (returne
d) */
void setwcserr( /* Set WCS error message for later printing void wcsrange( /* Return min and max RA and Dec of image in degrees
*/ */
char *errmsg); /* Error mesage < 80 char */ struct WorldCoor *wcs, /* World coordinate system structure */
void wcserr(); /* Print WCS error message to stderr */ double *ra1, /* Min. right ascension of image (deg) (returned) */
double *ra2, /* Max. right ascension of image (deg) (returned) */
double *dec1, /* Min. declination of image (deg) (returned) */
double *dec2); /* Max. declination of image (deg) (returned
) */
void setdefwcs( /* Set flag to use AIPS WCS instead of WCSLI void wcscdset( /* Set scaling and rotation from CD matrix */
B */ struct WorldCoor *wcs, /* World coordinate system structure */
int oldwcs); /* 1 for AIPS WCS subroutines, else WCSLIB * double *cd); /* CD matrix, ignored if NULL */
/
int getdefwcs(); /* Return flag for AIPS WCS set by setdefwcs
*/
char *getradecsys( /* Return name of image coordinate system */ void wcsdeltset( /* set scaling, rotation from CDELTi, CROTA2 */
struct WorldCoor *wcs, /* World coordinate system structure */
double cdelt1, /* degrees/pixel in first axis (or both axes) */
double cdelt2, /* degrees/pixel in second axis if nonzero */
double crota); /* Rotation counterclockwise in degrees */
void wcspcset( /* set scaling, rotation from CDELTs and PC matrix *
/
struct WorldCoor *wcs, /* World coordinate system structure */
double cdelt1, /* degrees/pixel in first axis (or both axes) */
double cdelt2, /* degrees/pixel in second axis if nonzero */
double *pc); /* Rotation matrix, ignored if NULL */
void setwcserr( /* Set WCS error message for later printing */
char *errmsg); /* Error mesage < 80 char */
void wcserr(void); /* Print WCS error message to stderr */
void setdefwcs( /* Set flag to use AIPS WCS instead of WCSLIB */
int oldwcs); /* 1 for AIPS WCS subroutines, else WCSLIB */
int getdefwcs(void); /* Return flag for AIPS WCS set by setdefwcs
*/
char *getradecsys( /* Return name of image coordinate system */
struct WorldCoor *wcs); /* World coordinate system structure */ struct WorldCoor *wcs); /* World coordinate system structure */
void wcsoutinit( /* Set output coordinate system for pix2wcs */ void wcsoutinit( /* Set output coordinate system for pix2wcs */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
char *coorsys); /* Coordinate system (B1950, J2000, etc) */ char *coorsys); /* Coordinate system (B1950, J2000, etc) */
char *getwcsout( /* Return current output coordinate system * / char *getwcsout( /* Return current output coordinate system */
struct WorldCoor *wcs); /* World coordinate system structure */ struct WorldCoor *wcs); /* World coordinate system structure */
void wcsininit( /* Set input coordinate system for wcs2pix * / void wcsininit( /* Set input coordinate system for wcs2pix */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
char *coorsys); /* Coordinate system (B1950, J2000, etc) */ char *coorsys); /* Coordinate system (B1950, J2000, etc) */
char *getwcsin( /* Return current input coordinate system */ char *getwcsin( /* Return current input coordinate system */
struct WorldCoor *wcs); /* World coordinate system structure */ struct WorldCoor *wcs); /* World coordinate system structure */
int setwcsdeg( /* Set WCS coordinate output format */ int setwcsdeg( /* Set WCS coordinate output format */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
int degout); /* 1= degrees, 0= hh:mm:ss dd:mm:ss */ int degout); /* 1= degrees, 0= hh:mm:ss dd:mm:ss */
int wcsndec( /* Set or get number of output decimal place s */ int wcsndec( /* Set or get number of output decimal places */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
int ndec); /* Number of decimal places in output string int ndec); /* Number of decimal places in output string
if < 0, return current ndec unchanged */ if < 0, return current ndec unchanged */
void setwcslin( /* Set pix2wcst() mode for LINEAR coordinate int wcsreset( /* Change WCS using arguments */
s */ struct WorldCoor *wcs, /* World coordinate system data structure */
double crpix1, /* Horizontal reference pixel */
double crpix2, /* Vertical reference pixel */
double crval1, /* Reference pixel horizontal coordinate in degrees
*/
double crval2, /* Reference pixel vertical coordinate in degrees */
double cdelt1, /* Horizontal scale in degrees/pixel, ignored if cd
is not NULL */
double cdelt2, /* Vertical scale in degrees/pixel, ignored if cd is
not NULL */
double crota, /* Rotation angle in degrees, ignored if cd is not N
ULL */
double *cd); /* Rotation matrix, used if not NULL */
void wcseqset( /* Change equinox of reference pixel coordinates in
WCS */
struct WorldCoor *wcs, /* World coordinate system data structure */
double equinox); /* Desired equinox as fractional year */
void setwcslin( /* Set pix2wcst() mode for LINEAR coordinates */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
int mode); /* 0: x y linear, 1: x units x units int mode); /* 0: x y linear, 1: x units x units
2: x y linear units */ 2: x y linear units */
int wcszin( int wcszin( /* Set third dimension for cube projections
int izpix); /* Set coordinate in third dimension (face) */
*/ int izpix); /* Set coordinate in third dimension (face) */
int wcszout ( /* Return coordinate in third dimension */ int wcszout ( /* Return coordinate in third dimension */
struct WorldCoor *wcs); /* World coordinate system structure */ struct WorldCoor *wcs); /* World coordinate system structure */
void savewcscoor( /* Save output coordinate system */ void wcscominit( /* Initialize catalog search command set by -wcscom
char *wcscoor); /* coordinate system (J2000, B1950, galactic */
) */ struct WorldCoor *wcs, /* World coordinate system structure */
char *getwcscoor(); /* Return output coordinate system * int i, /* Number of command (0-9) to initialize */
/ char *command); /* command with %s where coordinates will go */
void savewcscom( /* Save WCS shell command */
char *wcscom); /* Shell command using output WCS string */ void wcscom( /* Execute catalog search command set by -wcscom */
char *getwcscom(); /* Return WCS shell command */ struct WorldCoor *wcs, /* World coordinate system structure */
void setwcsfile( /* Set filename for WCS error message */ int i, /* Number of command (0-9) to execute */
char *filename); /* FITS or IRAF file name */ char *filename, /* Image file name */
double xfile, /* Horizontal image pixel coordinates for WCS comman
d */
double yfile, /* Vertical image pixel coordinates for WCS command
*/
char *wcstring); /* WCS String from pix2wcst() */
void savewcscom( /* Save WCS shell command */
int i, /* i of 10 possible shell commands */
char *wcscom); /* Shell command using output WCS string */
char *getwcscom( /* Return WCS shell command */
int i); /* i of 10 possible shell commands */
void setwcscom( /* Set WCS shell commands from stored values */
struct WorldCoor *wcs); /* World coordinate system structure
*/
void freewcscom( /* Free memory storing WCS shell commands */
struct WorldCoor *wcs); /* World coordinate system structure
*/
void setwcsfile( /* Set filename for WCS error message */
char *filename); /* FITS or IRAF file name */
int cpwcs ( /* Copy WCS keywords with no suffix to ones
with suffix */
char **header, /* Pointer to start of FITS header */
char *cwcs); /* Keyword suffix character for output WCS */
void savewcscoor( /* Save output coordinate system */
char *wcscoor); /* coordinate system (J2000, B1950, galactic) */
char *getwcscoor(void); /* Return output coordinate system */
/* Coordinate conversion subroutines in wcscon.c */ /* Coordinate conversion subroutines in wcscon.c */
void wcsconv( /* Convert between coordinate systems and equinoxes */ void wcsconv( /* Convert between coordinate systems and equinoxes */
int sys1, /* Input coordinate system (J2000, B1950, ECLIPTIC, GALACTIC */ int sys1, /* Input coordinate system (J2000, B1950, ECLIPTIC, GALACTIC */
int sys2, /* Output coordinate system (J2000, B1950, ECLIPTIC, G ALACTIC */ int sys2, /* Output coordinate system (J2000, B1950, ECLIPTIC, G ALACTIC */
double eq1, /* Input equinox (default of sys1 if 0.0) */ double eq1, /* Input equinox (default of sys1 if 0.0) */
double eq2, /* Output equinox (default of sys2 if 0.0) */ double eq2, /* Output equinox (default of sys2 if 0.0) */
double ep1, /* Input Besselian epoch in years */ double ep1, /* Input Besselian epoch in years */
double ep2, /* Output Besselian epoch in years */ double ep2, /* Output Besselian epoch in years */
double *dtheta, /* Longitude or right ascension in degrees double *dtheta, /* Longitude or right ascension in degrees
skipping to change at line 477 skipping to change at line 556
void wcscon( /* Convert between coordinate systems and equinoxes */ void wcscon( /* Convert between coordinate systems and equinoxes */
int sys1, /* Input coordinate system (J2000, B1950, ECLIPTIC, GALACTIC */ int sys1, /* Input coordinate system (J2000, B1950, ECLIPTIC, GALACTIC */
int sys2, /* Output coordinate system (J2000, B1950, ECLIPTIC, G ALACTIC */ int sys2, /* Output coordinate system (J2000, B1950, ECLIPTIC, G ALACTIC */
double eq1, /* Input equinox (default of sys1 if 0.0) */ double eq1, /* Input equinox (default of sys1 if 0.0) */
double eq2, /* Output equinox (default of sys2 if 0.0) */ double eq2, /* Output equinox (default of sys2 if 0.0) */
double *dtheta, /* Longitude or right ascension in degrees double *dtheta, /* Longitude or right ascension in degrees
Input in sys1, returned in sys2 */ Input in sys1, returned in sys2 */
double *dphi, /* Latitude or declination in degrees double *dphi, /* Latitude or declination in degrees
Input in sys1, returned in sys2 */ Input in sys1, returned in sys2 */
double epoch); /* Besselian epoch in years */ double epoch); /* Besselian epoch in years */
void fk425e ( /* Convert B1950(FK4) to J2000(FK5) coordinates */
double *ra, /* Right ascension in degrees (B1950 in, J2000 out)
*/
double *dec, /* Declination in degrees (B1950 in, J2000 out) */
double epoch); /* Besselian epoch in years */
void fk524e ( /* Convert J2000(FK5) to B1950(FK4) coordinates */
double *ra, /* Right ascension in degrees (J2000 in, B1950 out)
*/
double *dec, /* Declination in degrees (J2000 in, B1950 out) */
double epoch); /* Besselian epoch in years */
int wcscsys( /* Return code for coordinate system in string */ int wcscsys( /* Return code for coordinate system in string */
char *coorsys); /* Coordinate system (B1950, J2000, etc) */ char *coorsys); /* Coordinate system (B1950, J2000, etc) */
double wcsceq ( /* Set equinox from string (return 0.0 if not obviou s) */ double wcsceq ( /* Set equinox from string (return 0.0 if not obviou s) */
char *wcstring); /* Coordinate system (B1950, J2000, etc) */ char *wcstring); /* Coordinate system (B1950, J2000, etc) */
void wcscstr ( /* Set coordinate system type string from system and equinox */ void wcscstr ( /* Set coordinate system type string from system and equinox */
char *cstr, /* Coordinate system string (returned) */ char *cstr, /* Coordinate system string (returned) */
int syswcs, /* Coordinate system code */ int syswcs, /* Coordinate system code */
double equinox, /* Equinox of coordinate system */ double equinox, /* Equinox of coordinate system */
double epoch); /* Epoch of coordinate system */ double epoch); /* Epoch of coordinate system */
/* Distortion model subroutines in distort.c */
void distortinit ( /* Set distortion coefficients from FITS header */ void distortinit ( /* Set distortion coefficients from FITS header */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
const char* hstring); /* FITS header */ const char* hstring); /* FITS header */
void setdistcode ( /* Set WCS distortion code string from CTYPEi value */ void setdistcode ( /* Set WCS distortion code string from CTYPEi value */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
char *ctype); /* CTYPE value from FITS header */ char *ctype); /* CTYPE value from FITS header */
char *getdistcode ( /* Return distortion code string for CTYPEi */ char *getdistcode ( /* Return distortion code string for CTYPEi */
struct WorldCoor *wcs); /* World coordinate system structure */ struct WorldCoor *wcs); /* World coordinate system structure */
int DelDistort ( /* Delete all distortion-related fields */ int DelDistort ( /* Delete all distortion-related fields */
char *header, /* FITS header */ char *header, /* FITS header */
int verbose); /* If !=0, print keywords as deleted */ int verbose); /* If !=0, print keywords as deleted */
void pix2foc ( /* Convert pixel to focal plane coordinates */ void pix2foc ( /* Convert pixel to focal plane coordinates */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
double x, /* Image pixel horizontal coordinate */ double x, /* Image pixel horizontal coordinate */
double y, /* Image pixel vertical coordinate */ double y, /* Image pixel vertical coordinate */
double *u, /* Focal plane horizontal coordinate(returne double *u, /* Focal plane horizontal coordinate(returned) */
d) */ double *v); /* Focal plane vertical coordinate (returned) */
double *v); /* Focal plane vertical coordinate (returned
) */
void foc2pix ( /* Convert focal plane to pixel coordinates */ void foc2pix ( /* Convert focal plane to pixel coordinates */
struct WorldCoor *wcs, /* World coordinate system structure */ struct WorldCoor *wcs, /* World coordinate system structure */
double u, /* Focal plane horizontal coordinate */ double u, /* Focal plane horizontal coordinate */
double v, /* Focal plane vertical coordinate */ double v, /* Focal plane vertical coordinate */
double *x, /* Image pixel horizontal coordinate(returne double *x, /* Image pixel horizontal coordinate(returned) */
d) */ double *y); /* Image pixel vertical coordinate (returned) */
double *y); /* Image pixel vertical coordinate (returned
) */
}; /* Other projection subroutines */
#else /* __cplusplus */
/* 8 projections using AIPS algorithms (worldpos.c) */
int worldpos ( /* Convert from pixel location to RA,Dec */
double xpix, /* x pixel number (RA or long without rotation) */
double ypix, /* y pixel number (Dec or lat without rotation) */
struct WorldCoor *wcs, /* WCS parameter structure */
double *xpos, /* x (RA) coordinate (deg) (returned) */
double *ypos); /* y (dec) coordinate (deg) (returned) */
int worldpix ( /* Convert from RA,Dec to pixel location */
double xpos, /* x (RA) coordinate (deg) */
double ypos, /* y (dec) coordinate (deg) */
struct WorldCoor *wcs, /* WCS parameter structure */
double *xpix, /* x pixel number (RA or long without rotation) */
double *ypix); /* y pixel number (dec or lat without rotation) */
/* Digital Sky Survey projection (dsspos.c) */
int dsspos ( /* Convert from pixel location to RA,Dec */
double xpix, /* x pixel number (RA or long without rotation) */
double ypix, /* y pixel number (Dec or lat without rotation) */
struct WorldCoor *wcs, /* WCS parameter structure */
double *xpos, /* x (RA) coordinate (deg) (returned) */
double *ypos); /* y (dec) coordinate (deg) (returned) */
int dsspix ( /* Convert from RA,Dec to pixel location */
double xpos, /* x (RA) coordinate (deg) */
double ypos, /* y (dec) coordinate (deg) */
struct WorldCoor *wcs, /* WCS parameter structure */
double *xpix, /* x pixel number (RA or long without rotation) */
double *ypix); /* y pixel number (dec or lat without rotation) */
/* SAO TDC TAN projection with higher order terms (platepos.c) */
int platepos ( /* Convert from pixel location to RA,Dec */
double xpix, /* x pixel number (RA or long without rotation) */
double ypix, /* y pixel number (Dec or lat without rotation) */
struct WorldCoor *wcs, /* WCS parameter structure */
double *xpos, /* x (RA) coordinate (deg) (returned) */
double *ypos); /* y (dec) coordinate (deg) (returned) */
int platepix ( /* Convert from RA,Dec to pixel location */
double xpos, /* x (RA) coordinate (deg) */
double ypos, /* y (dec) coordinate (deg) */
struct WorldCoor *wcs, /* WCS parameter structure */
double *xpix, /* x pixel number (RA or long without rotation) */
double *ypix); /* y pixel number (dec or lat without rotation) */
void SetFITSPlate ( /* Set FITS header plate fit coefficients fr
om structure */
char *header, /* Image FITS header */
struct WorldCoor *wcs); /* WCS structure */
int SetPlate ( /* Set plate fit coefficients in structure from argu
ments */
struct WorldCoor *wcs, /* World coordinate system structure */
int ncoeff1, /* Number of coefficients for x */
int ncoeff2, /* Number of coefficients for y */
double *coeff); /* Plate fit coefficients */
int GetPlate ( /* Return plate fit coefficients from structure in a
rguments */
struct WorldCoor *wcs, /* World coordinate system structure */
int *ncoeff1, /* Number of coefficients for x */
int *ncoeff2, /* Number of coefficients for y) */
double *coeff); /* Plate fit coefficients */
/* IRAF TAN projection with higher order terms (tnxpos.c) */
int tnxinit ( /* initialize the gnomonic forward or inverse transf
orm */
const char *header, /* FITS header */
struct WorldCoor *wcs); /* pointer to WCS structure */
int tnxpos ( /* forward transform (physical to world) gnomonic pr
ojection. */
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 tnxpix ( /* Inverse transform (world to physical) gnomonic pr
ojection */
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 */
/* 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 */
struct WorldCoor *wcskinit(); /* set up a WCS structure from keyword values */ struct WorldCoor *wcskinit(); /* set up a WCS structure from keyword values */
void wcsfree(); /* Free a WCS structure and its contents */ void wcsfree(void); /* Free a WCS structure and its contents */
int wcstype(); /* Set projection type from header CTYPEs */ int wcstype(); /* Set projection type from header CTYPEs */
void wcscdset(); /* Set scaling and rotation from CD matrix */ void wcscdset(); /* Set scaling and rotation from CD matrix */
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 */
skipping to change at line 556 skipping to change at line 709
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(); /* Set coordinate system string from system and equinox */ 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 or TNX */
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 */
void freewcscom(); /* Free memory used to store WCS shell commands */ void freewcscom(); /* Free memory used to store WCS shell commands */
void setwcsfile(); /* Set filename for WCS error message */ void setwcsfile(); /* Set filename for WCS error message */
int cpwcs(); /* Copy WCS keywords with no suffix to ones with suf fix */
/* Coordinate conversion subroutines in wcscon.c */ /* Coordinate conversion subroutines in wcscon.c */
void wcscon(); /* Convert between coordinate systems and equinoxes */ void wcscon(); /* Convert between coordinate systems and equinoxes */
void wcsconp(); /* Convert between coordinate systems and eq uinoxes */ void wcsconp(); /* Convert between coordinate systems and eq uinoxes */
void wcsconv(); /* Convert between coordinate systems and eq uinoxes */ void wcsconv(); /* Convert between coordinate systems and eq uinoxes */
void fk425e(); /* Convert B1950(FK4) to J2000(FK5) coordinates */
void fk524e(); /* Convert J2000(FK5) to B1950(FK4) coordinates */
int wcscsys(); /* Set coordinate system from string */ int wcscsys(); /* Set coordinate system from string */
double wcsceq(); /* Set equinox from string (return 0.0 if not obviou s) */ double wcsceq(); /* Set equinox from string (return 0.0 if not obviou s) */
void wcscstr(); /* Return system string from system code, eq
uinox, epoch */ /* Distortion model subroutines in distort.c */
void distortinit(); /* Set distortion coefficients from FITS header */ void distortinit(); /* Set distortion coefficients from FITS header */
void setdistcode(); /* Set WCS distortion code string from CTYPEi value */ void setdistcode(); /* Set WCS distortion code string from CTYPEi value */
char *getdistcode(); /* Return distortion code string for CTYPEi */ char *getdistcode(); /* Return distortion code string for CTYPEi */
int DelDistort(); /* Delete all distortion-related fields */ int DelDistort(); /* Delete all distortion-related fields */
void pix2foc(); /* pixel coordinates -> focal plane coordin ates */ void pix2foc(); /* pixel coordinates -> focal plane coordin ates */
void foc2pix(); /* focal plane coordinates -> pixel coordin ates */ void foc2pix(); /* focal plane coordinates -> pixel coordin ates */
/* Other projection subroutines */
/* 8 projections using AIPS algorithms (worldpos.c) */
extern int worldpos(); /* Convert from pixel location to RA,Dec */
extern int worldpix(); /* Convert from RA,Dec to pixel location */
/* Digital Sky Survey projection (dsspos.c) */
extern int dsspos(); /* Convert from pixel location to RA,Dec */
extern int dsspix(); /* Convert from RA,Dec to pixel location */
/* SAO TDC TAN projection with higher order terms (platepos.c) */
extern int platepos(); /* Convert from pixel location to RA,Dec */
extern int platepix(); /* Convert from RA,Dec to pixel location */
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 GetPlate(); /* Return plate fit coefficients from structure in a
rguments */
/* IRAF TAN projection with higher order terms (tnxpos.c) */
extern int tnxinit(); /* initialize the gnomonic forward or inverse transf
orm */
extern int tnxpos(); /* forward transform (physical to world) gnomonic pr
ojection. */
extern int tnxpix(); /* Inverse transform (world to physical) gnomonic pr
ojection */
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif #endif
#endif
#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
* Dec 22 1994 Add flag for coordinate reversal * Dec 22 1994 Add flag for coordinate reversal
* Mar 6 1995 Add parameters for Digital Sky Survey plate fit * Mar 6 1995 Add parameters for Digital Sky Survey plate fit
* Jun 8 1995 Add parameters for coordinate system change * Jun 8 1995 Add parameters for coordinate system change
* Jun 21 1995 Add parameter for plate scale * Jun 21 1995 Add parameter for plate scale
* Jul 6 1995 Add parameter to note whether WCS is set * Jul 6 1995 Add parameter to note whether WCS is set
* Aug 8 1995 Add parameter to note whether to print coordinate system * Aug 8 1995 Add parameter to note whether to print coordinate system
skipping to change at line 696 skipping to change at line 881
* Nov 3 2003 Add distinit(), setdistcode(), and getdistcode() to distort. c * Nov 3 2003 Add distinit(), setdistcode(), and getdistcode() to distort. c
* Dec 3 2003 Add back wcs->naxes for backward compatibility * Dec 3 2003 Add back wcs->naxes for backward compatibility
* *
* Aug 30 2004 Add DelDistort() * Aug 30 2004 Add DelDistort()
* *
* Nov 1 2005 Add WCS_ICRS * Nov 1 2005 Add WCS_ICRS
* *
* Jan 5 2006 Add secrad() * Jan 5 2006 Add secrad()
* 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
* Dec 21 2006 Add cpwcs()
*
* Jan 4 2007 Drop extra declaration of wcscstr()
* 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 worldpos.c, dsspos.c, platepos.c, and tnxpos.c subroutin
es
* Jan 10 2007 Add ANSI prototypes for all subroutines
*/ */
 End of changes. 68 change blocks. 
173 lines changed or deleted 383 lines changed or added


 wcscat.h   wcscat.h 
/*** File libwcs/wcscat.h /*** File libwcs/wcscat.h
*** June 20, 2006 *** January 10, 2007
*** By Doug Mink, dmink@cfa.harvard.edu *** By Doug Mink, dmink@cfa.harvard.edu
*** Copyright (C) 1998-2006 *** 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,
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 29 skipping to change at line 29
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U SA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U SA
Correspondence concerning WCSTools should be addressed as follows: Correspondence concerning WCSTools should be addressed as follows:
Internet email: dmink@cfa.harvard.edu Internet email: dmink@cfa.harvard.edu
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
*/ */
/* Source catalog flags and subroutines */ #ifndef _wcscat_h_
#define _wcscat_h_
/* Source catalog flags returned from CatCode */
#define GSC 1 /* HST Guide Star Catalog */
#define UJC 2 /* USNO UJ Star Catalog */
#define UAC 3 /* USNO A Star Catalog */
#define USAC 4 /* USNO SA Star Catalog */
#define SAO 5 /* SAO Star Catalog */
#define IRAS 6 /* IRAS Point Source Catalog */
#define PPM 7 /* PPM Star Catalog */
#define TYCHO 8 /* Tycho Star Catalog */
#define UA1 9 /* USNO A-1.0 Star Catalog */
#define UA2 10 /* USNO A-2.0 Star Catalog */
#define USA1 11 /* USNO SA-1.0 Star Catalog */
#define USA2 12 /* USNO SA-2.0 Star Catalog */
#define HIP 13 /* Hipparcos Star Catalog */
#define ACT 14 /* USNO ACT Star Catalog */
#define BSC 15 /* Yale Bright Star Catalog */
#define TYCHO2 16 /* Tycho-2 Star Catalog */
#define USNO 17 /* USNO-format plate catalog */
#define TMPSC 18 /* 2MASS All-Sky Point Source Catalog */
#define GSCACT 19 /* GSC-ACT revised Guide Star Catalog */
#define GSC2 20 /* GSC II version 2.2 */
#define UB1 21 /* USNO B-1.0 Star Catalog */
#define UCAC1 22 /* USNO CCD Astrograph Catalog 1.0 */
#define UCAC2 23 /* USNO CCD Astrograph Catalog 2.0 */
#define TMIDR2 24 /* 2MASS IDR2 Point Source Catalog */
#define YB6 25 /* USNO YB6 Catalog */
#define SDSS 26 /* Sloan Digital Sky Survey Catalog */
#define TMXSC 27 /* 2MASS Extended Source Catalog */
#define TMPSCE 28 /* 2MASS Point Source Catalog with mag error
s */
#define TYCHO2E 29 /* Tycho-2 Star Catalog with magnitu
de errors */
#define SKY2K 30 /* SKY2000 Master Catalog */
#define TABCAT -1 /* StarBase tab table catalog */
#define BINCAT -2 /* TDC binary catalog */
#define TXTCAT -3 /* TDC ASCII catalog */
#define WEBCAT -4 /* Tab catalog via the web */
#define NUMCAT 30 /* Number of predefined catalogs */
/* Subroutines for dealing with catalogs */
int CatCode(); /* Return catalog type code */
int RefCat(); /* Return catalog type code, title, coord. system */
char *CatName(); /* Return catalog name given catalog type code */
char *CatSource(); /* Return catalog source description given catalog t
ype code */
char *ProgCat(); /* Return catalog name given program name used */
char *ProgName(); /* Return program name given program path used */
char *CatName(); /* Return catalog name given catalog type code */
void CatID(); /* Return catalog ID keyword given catalog type code
*/
void CatNum(); /* Return formatted source number */
int CatNumLen(); /* Return length of source numbers */
int CatNdec(); /* Return number of decimal places in source numbers
*/
void CatMagName(); /* Return name of specified magnitude */
int CatMagNum(); /* Returns number of magnitude specified by letter a
s int */
double CatRad(); /* Return default search radius for given catalog */
int NumNdec(); /* Return number of decimal places in a number */
int StrNdec(); /* Return number of decimal places in numeric string
*/
void SearchLim(); /* Compute limiting RA and Dec */
void RefLim(); /* Compute limiting RA and Dec in new system */
int isacat(); /* Return 1 if string is name of ASCII catalog file
*/
int ageti4(); /* Extract int value from keyword= value in string *
/
int agetr8(); /* Extract double value from keyword= value in strin
g */
int agets(); /* Extract value from keyword= value in string */
void bv2sp(); /* Approximate main sequence spectral type from B -
V */
/* Subroutines for extracting sources from catalogs by sky region */
int gscread(); /* Read sources from HST Guide Star Catalog */
int gsc2read(); /* Read sources from GSC II Catalog */
int sdssread(); /* Read sources from SDSS Catalog */
int tmcread(); /* Read sources from 2MASS Point Source Catalog */
int uacread(); /* Read sources from USNO A or SA Catalog */
int ubcread(); /* Read sources from USNO B Catalog */
int ucacread(); /* Read sources from USNO UCAC 1 Catalog */
int ujcread(); /* Read sources from USNO J Catalog */
int tabread(); /* Read sources from tab table catalog */
int binread(); /* Read sources from SAO TDC binary format catalog *
/
int ctgread(); /* Read sources from SAO TDC ASCII format catalog */
int actread(); /* Read sources from USNO ACT Catalog */
int ty2read(); /* Read sources from Tycho 2 Catalog */
int webread(); /* Read sources from catalog on the World Wide Web *
/
int daoread(); /* Read image source positions from x y mag file */
int daoopen(); /* Open image source position x y mag file */
char *daoline(); /* Read line from image source position x y mag file
*/
/* Subroutines for extracting sources from catalogs by ID number */
int gscrnum(); /* Read sources from HST Guide Star Catalog */
int tmcrnum(); /* Read sources from 2MASS Point Source Catalog */
int uacrnum(); /* Read sources from USNO A or SA Catalog */
int ubcrnum(); /* Read sources from USNO B Catalog */
int ucacrnum(); /* Read sources from USNO UCAC 1 Catalog */
int ujcrnum(); /* Read sources from USNO J Catalog */
int tabrnum(); /* Read sources from tab table catalog */
int binrnum(); /* Read sources from SAO TDC binary format catalog *
/
int ctgrnum(); /* Read sources from SAO TDC ASCII format catalog */
int actrnum(); /* Read sources from USNO ACT Catalog */
int ty2rnum(); /* Read sources from Tycho 2 Catalog */
int webrnum(); /* Read sources from catalog on the World Wide Web *
/
int tmcid(); /* Return 1 if string is 2MASS ID, else 0 */
/* Subroutines for extracting sources from catalogs by date range */
int ctgrdate(); /* Read sources from SAO TDC ASCII format ca
talog */
/* Subroutines for putting sources from catalogs into FITS WCS images */
int gscbin(); /* Read sources from HST Guide Star Catalog */
int tmcbin(); /* Read sources from 2MASS Point Source Catalog */
int uacbin(); /* Read sources from USNO A or SA Catalog */
int ubcbin(); /* Read sources from USNO B Catalog */
int ucacbin(); /* Read sources from USNO UCAC 1 Catalog */
int ujcbin(); /* Read sources from USNO J Catalog */
int tabbin(); /* Read sources from tab table catalog */
int binbin(); /* Read sources from SAO TDC binary format catalog *
/
int ctgbin(); /* Read sources from SAO TDC ASCII format catalog */
int actbin(); /* Read sources from USNO ACT Catalog */
int ty2bin(); /* Read sources from Tycho 2 Catalog */
char *sdssc2t(); /* Convert SDSS buffer from comma- to tab-separated
*/
void setgsclass(); /* Set GSC object class */
void setuplate(); /* Set USNO catalog plate number to search */
void setdateform(); /* Set output date format */
int getuplate(); /* Get USNO catalog plate number to search */
void settabkey(); /* Set tab table keyword to read for object */
int ctgstar(); /* Read one star entry from ASCII catalog, 0 if OK *
/
int binstar(); /* Read one star entry from binary catalog, 0 if OK
*/
int tabstar(); /* Read one star entry from tab table catalog, 0 if
OK */
struct TabTable *webopen(); /* Open tab table across the web */
char *webbuff(); /* Read URL into buffer across the web */
void setlimdeg(); /* Limit output in degrees (1) or hh:mm:ss dd:mm:ss
(0) */
/* Subroutines for sorting tables of star positions and magnitudes */
#define SORT_UNSET -1 /* Catalog sort flag not set yet */
#define SORT_NONE 0 /* Do not sort catalog output */
#define SORT_MAG 1 /* Sort output by magnitude */
#define SORT_DIST 2 /* Sort output by distance from center */
#define SORT_RA 3 /* Sort output by right ascension */
#define SORT_DEC 4 /* Sort output by declination */
#define SORT_X 5 /* Sort output by image X coordinate */
#define SORT_Y 6 /* Sort output by image Y coordinate */
#define SORT_ID 7 /* Merge close catalog objects */
#define SORT_MERGE 8 /* Merge close catalog objects */
void XSortStars();
void YSortStars();
void IDSortStars();
void RASortStars();
void DecSortStars();
void MagSortStars();
void FluxSortStars();
int MergeStars();
#define EP_EP 1 /* Output epoch as fractional year */
#define EP_JD 2 /* Output epoch as 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_ISO 5 /* Output epoch in ISO format (yyyy-mm-ddThh
:mm:ss) */
char *DateString(); /* Convert epoch to output format */
/* Data structure for SAO TDC ASCII and binary star catalog entries */ /* Data structure for SAO TDC ASCII and binary star catalog entries */
struct Star { struct Star {
float rdum; float rdum;
float xno; /* Catalog number */ float xno; /* Catalog number */
double ra; /* Right Ascension (degrees) */ double ra; /* Right Ascension (degrees) */
double dec; /* Declination (degrees) */ double dec; /* Declination (degrees) */
char isp[24]; /* Spectral type or other 2-char identifier */ char isp[24]; /* Spectral type or other 2-char identifier */
short mag[11]; /* Up to 10 Magnitudes * 100 */ short mag[11]; /* Up to 10 Magnitudes * 100 */
double rapm; /* RA proper motion (degrees per year) */ double rapm; /* RA proper motion (degrees per year) */
skipping to change at line 296 skipping to change at line 144
char keymag[10][16]; /* Entry name for up to 10 magnitudes */ char keymag[10][16]; /* Entry name for up to 10 magnitudes */
char keyrpm[16]; /* Entry name for right ascension proper motion */ char keyrpm[16]; /* Entry name for right ascension proper motion */
char keydpm[16]; /* Entry name for declination proper motion */ char keydpm[16]; /* Entry name for declination proper motion */
char keypeak[16]; /* Entry name for integer code */ char keypeak[16]; /* Entry name for integer code */
char keytype[16]; /* Entry name for spectral type */ char keytype[16]; /* Entry name for spectral type */
char keyrv[16]; /* Entry name for radial velocity */ char keyrv[16]; /* Entry name for radial velocity */
char keyadd[16]; /* Entry name for additional keyword */ char keyadd[16]; /* Entry name for additional keyword */
char keyepoch[16]; /* Entry name for epoch */ char keyepoch[16]; /* Entry name for epoch */
}; };
/* Subroutines for reading headers of TDC binary and ASCII catalogs */
int isbin();
struct StarCat *binopen();
void binclose();
struct StarCat *ctgopen();
void ctgclose();
/* Data structure for tab table files */ /* Data structure for tab table files */
struct TabTable { struct TabTable {
char *filename; /* Name of tab table file */ char *filename; /* Name of tab table file */
int nlines; /* Number of entries in table */ int nlines; /* Number of entries in table */
char *tabname; /* Name of this table or NULL */ char *tabname; /* Name of this table or NULL */
char *tabbuff; /* Pointer to start of saved tab table in memory */ char *tabbuff; /* Pointer to start of saved tab table in memory */
char *tabheader; /* Pointer to start of line containing table header */ char *tabheader; /* Pointer to start of line containing table header */
char *tabhead; /* Pointer to start of line containing column headin g */ char *tabhead; /* Pointer to start of line containing column headin g */
char *tabdash; /* Pointer to start of line with dashes after column headings */ char *tabdash; /* Pointer to start of line with dashes after column headings */
char *tabdata; /* Pointer to start of first line of table data */ char *tabdata; /* Pointer to start of first line of table data */
skipping to change at line 325 skipping to change at line 166
int lline; /* Length in bytes of line buffer */ int lline; /* Length in bytes of line buffer */
char *tabline; /* Pointer to start of current line */ char *tabline; /* Pointer to start of current line */
FILE *tcat; /* File descriptor for tab table file */ FILE *tcat; /* File descriptor for tab table file */
int ncols; /* Number of columns per table entry */ int ncols; /* Number of columns per table entry */
char **colname; /* Column names */ char **colname; /* Column names */
int *lcol; /* Lengths of column header names */ int *lcol; /* Lengths of column header names */
int *lcfld; /* Number of columns in field (hyphens) */ int *lcfld; /* Number of columns in field (hyphens) */
int lbuff; /* Number of bytes in entire tab table */ int lbuff; /* Number of bytes in entire tab table */
}; };
/* Subroutines for extracting tab table information */ /* Source catalog flags and subroutines */
struct TabTable *tabopen(); /* Open tab table file */
struct StarCat *tabcatopen(); /* Open tab table catalog */
void tabcatclose(); /* Close tab table catalog */
int tabxyread(); /* Read x, y, and magnitude from tab table star list
*/
char *gettabline(); /* Find a specified line in a tab table */
int tabrkey(); /* Keyword values from tab table catalogs */
int tabcol(); /* Find column for name */
int tabgetk(); /* Get tab table entries for named column */
int tabgetc(); /* Get tab table entry for named column */
int tabgeti4(); /* Return 4-byte integer from tab table line
*/
int tabparse(); /* Aeturn column names and positions in tabt
able */
double tabgetra(); /* Return right ascension in degrees from tab table*
/
double tabgetdec(); /* Return declination in degrees from tab table*/
double tabgetpm(); /* Return RA or Dec p.m. in degrees from tab table*/
double tabgetr8(); /* Return double number from tab table line */
void tabclose(); /* Free all arrays left open by tab table structure
*/
char *gettaberr(); /* Return most recent tab table error message */
int istab();
int gettabndec(); /* Return number of decimal places in tab catalog id
s */
#define MAXRANGE 20 /* Source catalog flags returned from CatCode */
#define GSC 1 /* HST Guide Star Catalog */
#define UJC 2 /* USNO UJ Star Catalog */
#define UAC 3 /* USNO A Star Catalog */
#define USAC 4 /* USNO SA Star Catalog */
#define SAO 5 /* SAO Star Catalog */
#define IRAS 6 /* IRAS Point Source Catalog */
#define PPM 7 /* PPM Star Catalog */
#define TYCHO 8 /* Tycho Star Catalog */
#define UA1 9 /* USNO A-1.0 Star Catalog */
#define UA2 10 /* USNO A-2.0 Star Catalog */
#define USA1 11 /* USNO SA-1.0 Star Catalog */
#define USA2 12 /* USNO SA-2.0 Star Catalog */
#define HIP 13 /* Hipparcos Star Catalog */
#define ACT 14 /* USNO ACT Star Catalog */
#define BSC 15 /* Yale Bright Star Catalog */
#define TYCHO2 16 /* Tycho-2 Star Catalog */
#define USNO 17 /* USNO-format plate catalog */
#define TMPSC 18 /* 2MASS All-Sky Point Source Catalog */
#define GSCACT 19 /* GSC-ACT revised Guide Star Catalog */
#define GSC2 20 /* GSC II version 2.2 */
#define UB1 21 /* USNO B-1.0 Star Catalog */
#define UCAC1 22 /* USNO CCD Astrograph Catalog 1.0 */
#define UCAC2 23 /* USNO CCD Astrograph Catalog 2.0 */
#define TMIDR2 24 /* 2MASS IDR2 Point Source Catalog */
#define YB6 25 /* USNO YB6 Catalog */
#define SDSS 26 /* Sloan Digital Sky Survey Catalog */
#define TMXSC 27 /* 2MASS Extended Source Catalog */
#define TMPSCE 28 /* 2MASS Point Source Catalog with mag error
s */
#define TYCHO2E 29 /* Tycho-2 Star Catalog with magnitu
de errors */
#define SKY2K 30 /* SKY2000 Master Catalog */
#define TABCAT -1 /* StarBase tab table catalog */
#define BINCAT -2 /* TDC binary catalog */
#define TXTCAT -3 /* TDC ASCII catalog */
#define WEBCAT -4 /* Tab catalog via the web */
#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_JD 2 /* Output epoch as 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_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
struct Range { struct Range {
double first; /* Current minimum value */ double first; /* Current minimum value */
double last; /* Current maximum value */ double last; /* Current maximum value */
double step; /* Current step in value */ double step; /* Current step in value */
double value; /* Current value */ double value; /* Current value */
double ranges[MAXRANGE*3]; /* nranges sets of first, last, step */ double ranges[MAXRANGE*3]; /* nranges sets of first, last, step */
int nvalues; /* Total number of values in all ranges */ int nvalues; /* Total number of values in all ranges */
int nranges; /* Number of ranges */ int nranges; /* Number of ranges */
int irange; /* Index of current range */ int irange; /* Index of current range */
}; };
/* Subroutines for dealing with ranges */ /* Flags for sorting catalog search results */
struct Range *RangeInit(); /* Initialize range structure from string */ #define SORT_UNSET -1 /* Catalog sort flag not set yet */
int isrange(); /* Return 1 if string is a range of numbers, else 0 #define SORT_NONE 0 /* Do not sort catalog output */
*/ #define SORT_MAG 1 /* Sort output by magnitude */
int rgetn(); /* Return number of values in all ranges */ #define SORT_DIST 2 /* Sort output by distance from center */
int rgeti4(); /* Return next number in range as integer */ #define SORT_RA 3 /* Sort output by right ascension */
double rgetr8(); /* Return next number in range as double */ #define SORT_DEC 4 /* Sort output by declination */
void rstart(); /* Restart range */ #define SORT_X 5 /* Sort output by image X coordinate */
#define SORT_Y 6 /* Sort output by image Y coordinate */
#define SORT_ID 7 /* Merge close catalog objects */
#define SORT_MERGE 8 /* Merge close catalog objects */
/* Shapes for SAOimage region file output */ /* Shapes for SAOimage region file output */
#define WCS_CIRCLE 1 /* circle shape for SAOimage plotting */ #define WCS_CIRCLE 1 /* circle shape for SAOimage plotting */
#define WCS_SQUARE 2 /* square shape for SAOimage plotting */ #define WCS_SQUARE 2 /* square shape for SAOimage plotting */
#define WCS_DIAMOND 3 /* diamond shape for SAOimage plotting */ #define WCS_DIAMOND 3 /* diamond shape for SAOimage plotting */
#define WCS_CROSS 4 /* cross shape for SAOimage plotting */ #define WCS_CROSS 4 /* cross shape for SAOimage plotting */
#define WCS_EX 5 /* x shape for SAOimage plotting */ #define WCS_EX 5 /* x shape for SAOimage plotting */
#define WCS_VAR 6 /* variable (+ and x) shape for HSTGSC plotting */ #define WCS_VAR 6 /* variable (+ and x) shape for HSTGSC plotting */
#define WCS_PCIRCLE 11 /* pixel circle shape for SAOimage plotting */ #define WCS_PCIRCLE 11 /* pixel circle shape for SAOimage plotting */
#define WCS_PSQUARE 12 /* pixel square shape for SAOimage plotting */ #define WCS_PSQUARE 12 /* pixel square shape for SAOimage plotting */
#define WCS_PDIAMOND 13 /* pixel diamond shape for SAOimage plotting */ #define WCS_PDIAMOND 13 /* pixel diamond shape for SAOimage plotting */
#define WCS_PCROSS 14 /* pixel cross shape for SAOimage plotting */ #define WCS_PCROSS 14 /* pixel cross shape for SAOimage plotting */
#define WCS_PEX 15 /* pixel ex shape for SAOimage plotting */ #define WCS_PEX 15 /* pixel ex shape for SAOimage plotting */
#define WCS_PVAR 16 /* pixel variable (+ and x) shape for HSTGSC plottin g */ #define WCS_PVAR 16 /* pixel variable (+ and x) shape for HSTGSC plottin g */
/* Structure and subroutines for access to tokens within a string */ /* Subroutines for extracting sources from catalogs */
#define MAXTOKENS 1000 /* Maximum number of tokens to parse */
#define MAXWHITE 20 /* Maximum number of different whitespace character #ifdef __cplusplus
s */ extern "C" {
struct Tokens { #endif
char *line; /* Line which has been parsed */
int lline; /* Number of characters in line */ #ifdef __STDC__ /* Full ANSI prototypes */
int ntok; /* Number of tokens on line */
int nwhite; /* Number of whitespace characters */ /* Subroutines for reading any catalogs, including TDC ASCII catalogs */
char white[MAXWHITE]; /* Whitespace (separator) characters */
char *tok1[MAXTOKENS]; /* Pointers to start of tokens */ int ctgread( /* Read sources by sky region from any catalog */
int ltok[MAXTOKENS]; /* Lengths of tokens */ char *catfile, /* Name of reference star catalog file */
int itok; /* Current token number */ int refcat, /* Catalog code from wcscat.h */
}; int distsort, /* 1 to sort stars by distance from center */
double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees *
/
double ddec, /* Search half-width in declination in degrees */
double drad, /* Limiting separation in degrees (ignore if 0) */
double dradi, /* Inner edge of annulus in degrees (ignore if 0) */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double mag1, /* Limiting magnitudes (none if equal) */
double mag2, /* Limiting magnitudes (none if equal) */
int sortmag, /* Number of magnitude by which to limit and sort */
int nsmax, /* Maximum number of stars to be returned */
struct StarCat **starcat, /* Catalog data structure */
double *tnum, /* Array of ID numbers (returned) */
double *tra, /* Array of right ascensions (returned) */
double *tdec, /* Array of declinations (returned) */
double *tpra, /* Array of right ascension proper motions (returned
) */
double *tpdec, /* Array of declination proper motions (returned) */
double **tmag, /* 2-D array of magnitudes (returned) */
int *tc, /* Array of fluxes (returned) */
char **tobj, /* Array of object names (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int ctgrnum( /* Read sources by number from any catalog */
char *catfile, /* Name of reference star catalog file */
int refcat, /* Catalog code from wcscat.h */
int nnum, /* Number of stars to look for */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
int match, /* 1 to match star number exactly, else sequence num
*/
struct StarCat **starcat, /* Star catalog data structure */
double *tnum, /* Array of source numbers to look for */
double *tra, /* Array of right ascensions (returned) */
double *tdec, /* Array of declinations (returned) */
double *tpra, /* Array of right ascension proper motions (returned
) */
double *tpdec, /* Array of declination proper motions (returned) */
double **tmag, /* 2-D Array of magnitudes (returned) */
int *tpeak, /* Array of peak counts (returned) */
char **tkey, /* Array of values of additional keyword */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int ctgrdate( /* Read sources by date from SAO TDC ASCII format ca
talog */
char *catfile, /* Name of reference star catalog file */
int refcat, /* Catalog code from wcscat.h */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
struct StarCat **starcat, /* Star catalog data structure */
double date1, /* Start time as Modified Julian Date or Julian Date
*/
double date2, /* End time as Modified Julian Date or Julian Date *
/
int nmax, /* Maximum number of stars to look for */
double *tnum, /* Array of source numbers (returned) */
double *tra, /* Array of right ascensions (returned) */
double *tdec, /* Array of declinations (returned) */
double *tpra, /* Array of right ascension proper motions (returned
) */
double *tpdec, /* Array of declination proper motions (returned) */
double **tmag, /* 2-D Array of magnitudes (returned) */
int *tc, /* Array of fluxes (returned) */
char **tobj, /* Array of object names (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int ctgbin( /* Bin sources from SAO TDC ASCII format cat
alog */
char *catfile, /* Name of reference star catalog file */
int refcat, /* Catalog code from wcscat.h */
struct WorldCoor *wcs, /* World coordinate system for image */
char *header, /* FITS header for output image */
char *image, /* Output FITS image */
double mag1, /* Minimum (brightest) magnitude (no limits if equal
) */
double mag2, /* Maximum (faintest) magnitude (no limits if equal)
*/
int sortmag, /* Magnitude by which to sort (1 to nmag) */
double magscale, /* Scaling factor for magnitude to pixel flux
* (image of number of catalog objects per bin if 0)
*/
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int ctgstar( /* Read one star entry from ASCII catalog, 0
if OK */
int istar, /* Star sequence number in ASCII catalog */
struct StarCat *sc, /* Star catalog data structure */
struct Star *st); /* Star data structure, updated on return */
int isacat( /* Return 1 if string is name of ASCII catal
og file */
char *catpath); /* Path to file to check */
struct StarCat *ctgopen( /* Open a Starbase, TDC ASCII, or TDC binary c
atalog */
char *catfile, /* Name of reference star catalog file */
int refcat); /* Catalog code from wcscat.h */
void ctgclose( /* Close Starbase, TDC ASCII, or TDC binary catalog
* and free data structures */
struct StarCat *sc); /* Star catalog data structure */
/* Subroutines for extracting sources from HST Guide Star Catalog */
int gscread( /* Read sources by sky region from HST Guide Star Ca
talog */
int refcat, /* Catalog code from wcscat.h (GSC or GSCACT) */
double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees *
/
double ddec, /* Search half-width in declination in degrees */
double drad, /* Limiting separation 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 sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double mag1, /* Limiting magnitudes (none if equal) */
double mag2, /* Limiting magnitudes (none if equal) */
int nstarmax, /* Maximum number of stars to be returned */
double *gnum, /* Array of ID numbers (returned) */
double *gra, /* Array of right ascensions (returned) */
double *gdec, /* Array of declinations (returned) */
double **gmag, /* 2-D array of magnitudes (returned) */
int *gtype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int gscrnum( /* Read sources by ID number from HST Guide Star Cat
alog */
int refcat, /* Catalog code from wcscat.h (GSC or GSCACT) */
int nnum, /* Number of stars to look for */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double *gnum, /* Array of source numbers to look for */
double *gra, /* Array of right ascensions (returned) */
double *gdec, /* Array of declinations (returned) */
double **gmag, /* 2-D array of magnitudes (returned) */
int *gtype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int gscbin( /* Bin sources from HST Guide Star Catalog *
/
int refcat, /* Catalog code from wcscat.h (GSC or GSCACT) */
struct WorldCoor *wcs, /* World coordinate system for image */
char *header, /* FITS header for output image */
char *image, /* Output FITS image */
double mag1, /* Minimum (brightest) magnitude (no limits if equal
) */
double mag2, /* Maximum (faintest) magnitude (no limits if equal)
*/
double magscale, /* Scaling factor for magnitude to pixel flux
* (image of number of catalog objects per bin if 0)
*/
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
void setgsclass( /* Set GSC object class to return (<0=all) */
int class); /* Class of objects to return */
/* Subroutine to read GSC II catalog over the web */
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)
*/
double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees *
/
double ddec, /* Search half-width in declination in degrees */
double drad, /* Limiting separation 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 sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double mag1, /* Limiting magnitudes (none if equal) */
double mag2, /* Limiting magnitudes (none if equal) */
int sortmag, /* Number of magnitude by which to limit and sort */
int nstarmax, /* Maximum number of stars to be returned */
double *gnum, /* Array of ID numbers (returned) */
double *gra, /* Array of right ascensions (returned) */
double *gdec, /* Array of declinations (returned) */
double *gpra, /* Array of right ascension proper motions (returned
) */
double *gpdec, /* Array of declination proper motions (returned) */
double **gmag, /* 2-D array of magnitudes (returned) */
int *gtype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
/* Subroutine to read SDSS catalog over the web */
int sdssread( /* Read sources by sky region from SDSS Catalog */
double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees *
/
double ddec, /* Search half-width in declination in degrees */
double drad, /* Limiting separation 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 sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double mag1, /* Limiting magnitudes (none if equal) */
double mag2, /* Limiting magnitudes (none if equal) */
int sortmag, /* Number of magnitude by which to limit and sort */
int nstarmax, /* Maximum number of stars to be returned */
double *gnum, /* Array of ID numbers (returned from tabread) */
char **gobj, /* Array of object IDs (too long for integer*4) */
double *gra, /* Array of right ascensions (returned) */
double *gdec, /* Array of declinations (returned) */
double **gmag, /* 2-D array of magnitudes (returned) */
int *gtype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
char *sdssc2t( /* Convert SDSS buffer from comma- to tab-separated
*/
char *csvbuff); /* Input comma-separated table */
/* Subroutines to read local copy of 2MASS Point Source 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) */
double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees *
/
double ddec, /* Search half-width in declination in degrees */
double drad, /* Limiting separation 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 sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double mag1, /* Limiting magnitudes (none if equal) */
double mag2, /* Limiting magnitudes (none if equal) */
int sortmag, /* Number of magnitude by which to limit and sort */
int nstarmax, /* Maximum number of stars to be returned */
double *gnum, /* Array of catalog numbers (returned) */
double *gra, /* Array of right ascensions (returned) */
double *gdec, /* Array of declinations (returned) */
double **gmag, /* 2-D array of magnitudes (returned) */
int *gtype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int tmcrnum( /* Read sources by ID number from 2MASS Point Source
Catalog */
int refcat, /* Catalog code from wcscat.h (TMPSC or TMXSC or TMP
SCE) */
int nstars, /* Number of stars to look for */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double *gnum, /* Array of source numbers to look for */
double *gra, /* Array of right ascensions (returned) */
double *gdec, /* Array of declinations (returned) */
double **gmag, /* 2-D array of magnitudes (returned) */
int *gtype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int tmcbin( /* Bin sources from 2MASS Point Source Catal
og */
int refcat, /* Catalog code from wcscat.h (TMPSC or TMXSC or TMP
SCE) */
struct WorldCoor *wcs, /* World coordinate system for image */
char *header, /* FITS header for output image */
char *image, /* Output FITS image */
double mag1, /* Minimum (brightest) magnitude (no limits if equal
) */
double mag2, /* Maximum (faintest) magnitude (no limits if equal)
*/
int sortmag, /* Magnitude to use (1 to nmag) */
double magscale, /* Scaling factor for magnitude to pixel flux
* (image of number of catalog objects per bin if 0)
*/
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
/* Subroutines to read local copies of USNO catalogs */
int uacread( /* Read sources by sky region from USNO A or SA Cata
log */
char *refcatname, /* Name of catalog (UAC, USAC, UAC2, USAC2) */
int distsort, /* 1 to sort stars by distance from center */
double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees *
/
double ddec, /* Search half-width in declination in degrees */
double drad, /* Limiting separation in degrees (ignore if 0) */
double dradi, /* Inner edge of annulus in degrees (ignore if 0) */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double mag1, /* Limiting magnitudes (none if equal) */
double mag2, /* Limiting magnitudes (none if equal) */
int sortmag, /* Number of magnitude by which to limit and sort */
int nstarmax, /* Maximum number of stars to be returned */
double *unum, /* Array of catalog numbers (returned) */
double *ura, /* Array of right ascensions (returned) */
double *udec, /* Array of declinations (returned) */
double **umag, /* 2-D array of magnitudes (returned) */
int *uplate, /* Array of plate numbers (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int uacrnum( /* Read sources by ID number from USNO A or SA Catal
og */
char *refcatname, /* Name of catalog (UAC, USAC, UAC2, USAC2) */
int nnum, /* Number of stars to look for */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double *unum, /* Array of source numbers to look for */
double *ura, /* Array of right ascensions (returned) */
double *udec, /* Array of declinations (returned) */
double **umag, /* 2-D array of magnitudes (returned) */
int *uplate, /* Array of plate numbers (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int uacbin( /* Bin sources from USNO A or SA Catalog */
char *refcatname, /* Name of catalog (UAC, USAC, UAC2, USAC2) */
struct WorldCoor *wcs, /* World coordinate system for image */
char *header, /* FITS header for output image */
char *image, /* Output FITS image */
double mag1, /* Minimum (brightest) magnitude (no limits if equal
) */
double mag2, /* Maximum (faintest) magnitude (no limits if equal)
*/
int sortmag, /* Magnitude to use (1 to nmag) */
double magscale, /* Scaling factor for magnitude to pixel flux
* (image of number of catalog objects per bin if 0)
*/
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
void setuplate( /* Set USNO catalog plate number to search */
int xplate); /* If nonzero, use objects only from this plate */
int getuplate(void); /* Get USNO catalog plate number to search */
int ubcread( /* Read sources by sky region from USNO B Catalog */
char *refcatname, /* Name of catalog (UB1 only for now) */
int distsort, /* 1 to sort stars by distance from center */
double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees *
/
double ddec, /* Search half-width in declination in degrees */
double drad, /* Limiting separation in degrees (ignore if 0) */
double dradi, /* Inner edge of annulus in degrees (ignore if 0) */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double mag1, /* Limiting magnitudes (none if equal) */
double mag2, /* Limiting magnitudes (none if equal) */
int sortmag, /* Number of magnitude by which to limit and sort */
int nstarmax, /* Maximum number of stars to be returned */
double *unum, /* Array of ID numbers (returned) */
double *ura, /* Array of right ascensions (returned) */
double *udec, /* Array of declinations (returned) */
double *upra, /* Array of right ascension proper motions (returned
) */
double *updec, /* Array of declination proper motions (returned) */
double **umag, /* 2-D array of magnitudes (returned) */
int *upmni, /* Array of number of ids and pm quality (returned)
*/
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int ubcrnum( /* Read sources by ID number from USNO B Catalog */
char *refcatname, /* Name of catalog (UB1 only for now) */
int nnum, /* Number of stars to look for */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double *unum, /* Array of source numbers to look for */
double *ura, /* Array of right ascensions (returned) */
double *udec, /* Array of declinations (returned) */
double *upra, /* Array of right ascension proper motions (returned
) */
double *updec, /* Array of declination proper motions (returned) */
double **umag, /* 2-D array of magnitudes (returned) */
int *upmni, /* Array of number of ids and pm quality (returned)
*/
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int ubcbin( /* Bin sources from USNO B Catalog */
char *refcatname, /* Name of catalog (UB1 only for now) */
struct WorldCoor *wcs, /* World coordinate system for image */
char *header, /* FITS header for output image */
char *image, /* Output FITS image */
double mag1, /* Minimum (brightest) magnitude (no limits if equal
) */
double mag2, /* Maximum (faintest) magnitude (no limits if equal)
*/
int sortmag, /* Magnitude to use (1 to nmag) */
double magscale, /* Scaling factor for magnitude to pixel flux
* (image of number of catalog objects per bin if 0)
*/
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int ucacread( /* Read sources by sky region from USNO UCAC 1 Catal
og */
char *refcatname, /* Name of catalog (UCAC1 or UCAC2) */
double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees *
/
double ddec, /* Search half-width in declination in degrees */
double drad, /* Limiting separation 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 sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double mag1, /* Limiting magnitudes (none if equal) */
double mag2, /* Limiting magnitudes (none if equal) */
int sortmag, /* Number of magnitude by which to limit and sort */
int nstarmax, /* Maximum number of stars to be returned */
double *gnum, /* Array of ID numbers (returned) */
double *gra, /* Array of right ascensions (returned) */
double *gdec, /* Array of declinations (returned) */
double *gpra, /* Array of right ascension proper motions (returned
) */
double *gpdec, /* Array of declination proper motions (returned) */
double **gmag, /* 2-D array of magnitudes (returned) */
int *gtype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int ucacrnum( /* Read sources by ID number from USNO UCAC 1 Catalo
g */
char *refcatname, /* Name of catalog (UCAC1 or UCAC2) */
int nstars, /* Number of stars to look for */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double *gnum, /* Array of source numbers to look for */
double *gra, /* Array of right ascensions (returned) */
double *gdec, /* Array of declinations (returned) */
double *gpra, /* Array of right ascension proper motions (returned
) */
double *gpdec, /* Array of declination proper motions (returned) */
double **gmag, /* 2-D array of magnitudes (returned) */
int *gtype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int ucacbin( /* Bin sources from USNO UCAC 1 Catalog */
char *refcatname, /* Name of catalog (UCAC1 or UCAC2) */
struct WorldCoor *wcs, /* World coordinate system for image */
char *header, /* FITS header for output image */
char *image, /* Output FITS image */
double mag1, /* Minimum (brightest) magnitude (no limits if equal
) */
double mag2, /* Maximum (faintest) magnitude (no limits if equal)
*/
int sortmag, /* Magnitude to use (1 to nmag) */
double magscale, /* Scaling factor for magnitude to pixel flux
* (image of number of catalog objects per bin if 0)
*/
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int ujcread( /* Read sources by sky region from USNO J Catalog */
char *refcatname, /* Name of catalog (UJC, xxxxx.usno) */
double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees *
/
double ddec, /* Search half-width in declination in degrees */
double drad, /* Limiting separation 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 sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double mag1, /* Limiting magnitudes (none if equal) */
double mag2, /* Limiting magnitudes (none if equal) */
int nstarmax, /* Maximum number of stars to be returned */
double *unum, /* Array of catalog numbers (returned) */
double *ura, /* Array of right ascensions (returned) */
double *udec, /* Array of declinations (returned) */
double **umag, /* 2-D array of magnitudes (returned) */
int *uplate, /* Array of plate numbers (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int ujcrnum( /* Read sources by ID number from USNO J Catalog */
char *refcatname, /* Name of catalog (UJC, xxxxx.usno) */
int nnum, /* Number of stars to look for */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double *unum, /* Array of source numbers to look for */
double *ura, /* Array of right ascensions (returned) */
double *udec, /* Array of declinations (returned) */
double **umag, /* 2-D array of magnitudes (returned) */
int *uplate, /* Array of plate numbers (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int ujcbin( /* Bin sources from USNO J Catalog */
char *refcatname, /* Name of catalog (UJC, xxxxx.usno) */
struct WorldCoor *wcs, /* World coordinate system for image */
char *header, /* FITS header for output image */
char *image, /* Output FITS image */
double mag1, /* Minimum (brightest) magnitude (no limits if equal
) */
double mag2, /* Maximum (faintest) magnitude (no limits if equal)
*/
double magscale, /* Scaling factor for magnitude to pixel flux
* (image of number of catalog objects per bin if 0)
*/
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
/* Subroutines to read a local copy of the Tycho-2 catalog */
int ty2read( /* Read sources by sky region from Tycho 2 Catalog *
/
int refcat, /* Catalog code from wcscat.h (TYCHO2 or TYCHO2E */
double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees *
/
double ddec, /* Search half-width in declination in degrees */
double drad, /* Limiting separation 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 sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double mag1, /* Limiting magnitudes (none if equal) */
double mag2, /* Limiting magnitudes (none if equal) */
int sortmag, /* Number of magnitude by which to limit and sort */
int nstarmax, /* Maximum number of stars to be returned */
double *gnum, /* Array of ID numbers (returned) */
double *gra, /* Array of right ascensions (returned) */
double *gdec, /* Array of declinations (returned) */
double *gpra, /* Array of right ascension proper motions (returned
) */
double *gpdec, /* Array of declination proper motions (returned) */
double **gmag, /* 2-D array of magnitudes (returned) */
int *gtype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int ty2rnum( /* Read sources by ID number from Tycho 2 Catalog */
int refcat, /* Catalog code from wcscat.h (TYCHO2 or TYCHO2E */
int nstars, /* Number of stars to look for */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double *gnum, /* Array of source numbers to look for */
double *gra, /* Array of right ascensions (returned) */
double *gdec, /* Array of declinations (returned) */
double *gpra, /* Array of right ascension proper motions (returned
) */
double *gpdec, /* Array of declination proper motions (returned) */
double **gmag, /* 2-D array of magnitudes (returned) */
int *gtype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int ty2bin( /* Bin sources from Tycho 2 Catalog */
struct WorldCoor *wcs, /* World coordinate system for image */
char *header, /* FITS header for output image */
char *image, /* Output FITS image */
double mag1, /* Minimum (brightest) magnitude (no limits if equal
) */
double mag2, /* Maximum (faintest) magnitude (no limits if equal)
*/
int sortmag, /* Magnitude to use (1 to nmag) */
double magscale, /* Scaling factor for magnitude to pixel flux
* (image of number of catalog objects per bin if 0)
*/
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
/* Subroutines to read a local copy of the ACT catalog */
int actread( /* Read sources by sky region from USNO ACT Catalog
*/
double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees *
/
double ddec, /* Search half-width in declination in degrees */
double drad, /* Limiting separation 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 sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double mag1, /* Limiting magnitudes (none if equal) */
double mag2, /* Limiting magnitudes (none if equal) */
int sortmag, /* Number of magnitude by which to limit and sort */
int nstarmax, /* Maximum number of stars to be returned */
double *gnum, /* Array of ID numbers (returned) */
double *gra, /* Array of right ascensions (returned) */
double *gdec, /* Array of declinations (returned) */
double *gpra, /* Array of right ascension proper motions (returned
) */
double *gpdec, /* Array of declination proper motions (returned) */
double **gmag, /* 2-D array of magnitudes (returned) */
int *gtype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int actrnum( /* Read sources by ID number from USNO ACT Catalog *
/
int nstars, /* Number of stars to look for */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double *gnum, /* Array of source numbers to look for */
double *gra, /* Array of right ascensions (returned) */
double *gdec, /* Array of declinations (returned) */
double *gpra, /* Array of right ascension proper motions (returned
) */
double *gpdec, /* Array of declination proper motions (returned) */
double **gmag, /* 2-D array of magnitudes (returned) */
int *gtype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int actbin( /* Bin sources from USNO ACT Catalog */
struct WorldCoor *wcs, /* World coordinate system for image */
char *header, /* FITS header for output image */
char *image, /* Output FITS image */
double mag1, /* Minimum (brightest) magnitude (no limits if equal
) */
double mag2, /* Maximum (faintest) magnitude (no limits if equal)
*/
int sortmag, /* Magnitude to use (1 to nmag) */
double magscale, /* Scaling factor for magnitude to pixel flux
* (image of number of catalog objects per bin if 0)
*/
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
/* Subroutines to read SAO-TDC binary format catalogs */
int binread( /* Read from sky region from SAO TDC binary format c
atalog */
char *bincat, /* Name of reference star catalog file */
int distsort, /* 1 to sort stars by distance from center */
double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees *
/
double ddec, /* Search half-width in declination in degrees */
double drad, /* Limiting separation in degrees (ignore if 0) */
double dradi, /* Inner edge of annulus in degrees (ignore if 0) */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double mag1, /* Limiting magnitudes (none if equal) */
double mag2, /* Limiting magnitudes (none if equal) */
int sortmag, /* Number of magnitude by which to limit and sort */
int nstarmax, /* Maximum number of stars to be returned */
struct StarCat **starcat, /* Star catalog data structure */
double *tnum, /* Array of ID numbers (returned) */
double *tra, /* Array of right ascensions (returned) */
double *tdec, /* Array of declinations (returned) */
double *tpra, /* Array of right ascension proper motions (returned
) */
double *tpdec, /* Array of declination proper motions (returned) */
double **tmag, /* 2-D array of magnitudes (returned) */
int *tpeak, /* Array of encoded spectral types (returned) */
char **tobj, /* Array of object names (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int binrnum( /* Read sources by ID number from SAO TDC binary for
mat catalog */
char *bincat, /* Name of reference star catalog file */
int nstars, /* Number of stars to look for */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
int match, /* If 1, match number exactly, else number is sequen
ce*/
double *tnum, /* Array of source numbers to look for */
double *tra, /* Array of right ascensions (returned) */
double *tdec, /* Array of declinations (returned) */
double *tpra, /* Array of right ascension proper motions (returned
) */
double *tpdec, /* Array of declination proper motions (returned) */
double **tmag, /* 2-D array of magnitudes (returned) */
int *tpeak, /* Array of encoded spectral types (returned) */
char **tobj, /* Array of object names (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int binbin( /* Bin sources from SAO TDC binary format ca
talog */
char *bincat, /* Name of reference star catalog file */
struct WorldCoor *wcs, /* World coordinate system for image */
char *header, /* FITS header for output image */
char *image, /* Output FITS image */
double mag1, /* Minimum (brightest) magnitude (no limits if equal
) */
double mag2, /* Maximum (faintest) magnitude (no limits if equal)
*/
int sortmag, /* Magnitude to use (1 to nmag) */
double magscale, /* Scaling factor for magnitude to pixel flux
* (image of number of catalog objects per bin if 0)
*/
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int binstar( /* Read one star entry from binary catalog, 0 if OK
*/
struct StarCat *sc, /* Star catalog descriptor */
struct Star *st, /* Current star entry (returned) */
int istar); /* Star sequence number in binary catalog */
struct StarCat *binopen( /* Open binary catalog, returning number of en
tries */
char *bincat); /* Name of reference star catalog file */
void binclose( /* Close binary catalog */
struct StarCat *sc); /* Star catalog descriptor */
int isbin( /* Return 1 if TDC binary catalog file, else 0 */
char *filename); /* Name of file to check */
/* Subroutines for extracting tab table information (in tabread.c) */
int tabread( /* Read sources from tab table catalog */
char *tabcatname, /* Name of reference star catalog file */
int distsort, /* 1 to sort stars by distance from center */
double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees *
/
double ddec, /* Search half-width in declination in degrees */
double drad, /* Limiting separation in degrees (ignore if 0) */
double dradi, /* Inner edge of annulus in degrees (ignore if 0) */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double mag1, /* Minimum (brightest) magnitude (no limits if equal
) */
double mag2, /* Maximum (faintest) magnitude (no limits if equal)
*/
int sortmag, /* Magnitude by which to sort (1 to nmag) */
int nstarmax, /* Maximum number of stars to be returned */
struct StarCat **starcat, /* Star catalog data structure */
double *tnum, /* Array of source numbers (returned) */
double *tra, /* Array of right ascensions (returned) */
double *tdec, /* Array of declinations (returned) */
double *tpra, /* Array of right ascension proper motions (returned
) */
double *tpdec, /* Array of declination proper motions (returned) */
double **tmag, /* 2-D Array of magnitudes (returned) */
int *tpeak, /* Array of peak counts (returned) */
char **tkey, /* Array of values of additional keyword */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int tabrnum( /* Read sources from tab table catalog */
char *tabcatname, /* Name of reference star catalog file */
int nnum, /* Number of stars to look for */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
struct StarCat **starcat, /* Star catalog data structure */
int match, /* 1 to match star number exactly, else sequence num
*/
double *tnum, /* Array of source numbers to look for */
double *tra, /* Array of right ascensions (returned) */
double *tdec, /* Array of declinations (returned) */
double *tpra, /* Array of right ascension proper motions (returned
) */
double *tpdec, /* Array of declination proper motions (returned) */
double **tmag, /* 2-D Array of magnitudes (returned) */
int *tpeak, /* Array of peak counts (returned) */
char **tkey, /* Array of values of additional keyword */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int tabbin( /* Read sources from tab table catalog */
char *tabcatname, /* Name of reference star catalog file */
struct WorldCoor *wcs, /* World coordinate system for image */
char *header, /* FITS header for output image */
char *image, /* Output FITS image */
double mag1, /* Minimum (brightest) magnitude (no limits if equal
) */
double mag2, /* Maximum (faintest) magnitude (no limits if equal)
*/
int sortmag, /* Magnitude by which to sort (1 to nmag) */
double magscale, /* Scaling factor for magnitude to pixel flux
* (image of number of catalog objects per bin if 0)
*/
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int tabxyread( /* Read x, y, and magnitude from tab table star list
*/
char *tabcatname, /* Name of reference star catalog file */
double **xa, /* Array of x coordinates (returned) */
double **ya, /* Array of y coordinates (returned) */
double **ba, /* Array of magnitudes (returned) */
int **pa, /* Array of fluxes (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int tabrkey( /* Keyword values from tab table catalogs */
char *tabcatname, /* Name of reference star catalog file */
struct StarCat **starcat, /* Star catalog data structure */
int nnum, /* Number of stars to look for */
double *tnum, /* Array of source numbers to look for */
char *keyword, /* Keyword for which to return values */
char **tval); /* Returned values for specified keyword */
struct StarCat *tabcatopen( /* Open tab table catalog */
char *tabpath, /* Tab table catalog file pathname */
struct TabTable *tabtable, /* Tab table data structure */
int nbbuff); /* Number of bytes in buffer; 0=read whole file */
void tabcatclose( /* Close tab table catalog */
struct StarCat *sc); /* Source catalog data structure */
int tabstar( /* Read one star entry from tab table catalog, 0 if
OK */
int istar, /* Source sequence number in tab table catal
og */
struct StarCat *sc, /* Source catalog data structure */
struct Star *st, /* Star data structure, updated on return */
int verbose); /* 1 to print error messages */
struct TabTable *tabopen( /* Open tab table file */
char *tabfile, /* Tab table catalog file name */
int nbbuff); /* Number of bytes in buffer; 0=read whole file */
void tabclose( /* Free all arrays left open by tab table structure
*/
struct TabTable *tabtable); /* Tab table data structure */
char *gettabline( /* Find a specified line in a tab table */
struct TabTable *tabtable, /* Tab table data structure */
int iline); /* Line sequence number in tab table */
double tabgetra( /* Return right ascension in degrees from tab table*
/
struct Tokens *tabtok, /* Line token structure */
int ientry); /* sequence of entry on line */
double tabgetdec( /* Return declination in degrees from tab table*/
struct Tokens *tabtok, /* Line token structure */
int ientry); /* sequence of entry on line */
double tabgetr8( /* Return double number from tab table line */
struct Tokens *tabtok, /* Line token structure */
int ientry); /* sequence of entry on line */
int tabgeti4( /* Return 4-byte integer from tab table line */
struct Tokens *tabtok, /* Line token structure */
int ientry); /* sequence of entry on line */
void settabkey( /* Set tab table keyword to read for object */
char *keyword); /* column header of desired value */
int tabgetk( /* Get tab table entries for named column */
struct TabTable *tabtable, /* Tab table data structure */
struct Tokens *tabtok, /* Line token structure */
char *keyword, /* column header of desired value */
char *string, /* character string (returned) */
int maxchar); /* Maximum number of characters in returned string *
/
int tabgetc( /* Get tab table entry for named column */
struct Tokens *tabtok, /* Line token structure */
int ientry, /* sequence of entry on line */
char *string, /* character string (returned) */
int maxchar); /* Maximum number of characters in returned string *
/
int tabparse( /* Aeturn column names and positions in tabt
able */
struct TabTable *tabtable); /* Tab table data structure */
int tabcol( /* Find column for name */
struct TabTable *tabtable, /* Tab table data structure */
char *keyword); /* column header of desired value */
int istab( /* Return 1 if tab table file, else 0 */
char *filename); /* Name of file to check */
char *gettaberr(); /* Return most recent tab table error message */
int gettabndec(); /* Return number of decimal places in tab catalog id
s */
/* Subroutines to read catalogs over the web, from SCAT, HST, ESO, or SDSS
servers */
int webread( /* Read sources by sky region from WWW catalog */
char *caturl, /* URL of search engine */
char *refcatname, /* Name of catalog */
int distsort, /* 1 to sort stars by distance from center */
double cra, /* Search center J2000 right ascension in degrees */
double cdec, /* Search center J2000 declination in degrees */
double dra, /* Search half width in right ascension in degrees *
/
double ddec, /* Search half-width in declination in degrees */
double drad, /* Limiting separation in degrees (ignore if 0) */
double dradi, /* Inner edge of annulus in degrees (ignore if 0) */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
double mag1, /* Limiting magnitudes (none if equal) */
double mag2, /* Limiting magnitudes (none if equal) */
int sortmag, /* Number of magnitude by which to limit and sort */
int nstarmax, /* Maximum number of stars to be returned */
double *unum, /* Array of ID numbers (returned) */
double *ura, /* Array of right ascensions (returned) */
double *udec, /* Array of declinations (returned) */
double *upra, /* Array of right ascension proper motions (returned
) */
double *updec, /* Array of declination proper motions (returned) */
double **umag, /* 2-D array of magnitudes (returned) */
int *utype, /* Array of integer catalog values (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
int webrnum( /* Read sources by ID number from WWW catalog */
char *caturl, /* URL of search engine */
char *refcatname, /* Name of catalog */
int nnum, /* Number of stars to look for */
int sysout, /* Search coordinate system */
double eqout, /* Search coordinate equinox */
double epout, /* Proper motion epoch (0.0 for no proper motion) */
int match, /* 1 to match star number exactly, else sequence num
*/
double *unum, /* Array of source numbers to look for */
double *ura, /* Array of right ascensions (returned) */
double *udec, /* Array of declinations (returned) */
double *upra, /* Array of right ascension proper motions (returned
) */
double *updec, /* Array of declination proper motions (returned) */
double **umag, /* 2-D array of magnitudes (returned) */
int *utype, /* Array of object types (returned) */
int nlog); /* Verbose mode if > 1, number of sources per log li
ne */
char *webbuff( /* Read URL into buffer across the web */
char *url, /* URL to read */
int diag, /* 1 to print diagnostic messages */
int *lbuff); /* Length of buffer (returned) */
struct TabTable *webopen( /* Open tab table across the web */
char *caturl, /* URL of search engine */
char *srchpar, /* Search engine parameters to append */
int nlog); /* 1 to print diagnostic messages */
/* Subroutines to read DAOPHOT-style catalogs of sources found in an image
*/
int daoread( /* Read image source positions from x y mag file */
char *daocat, /* Name of DAOFIND catalog file */
double **xa, /* X and Y coordinates of stars, array returned */
double **ya, /* X and Y coordinates of stars, array returned */
double **ba, /* Instrumental magnitudes of stars, array returned
*/
int **pa, /* Peak counts of stars in counts, array returned */
int nlog); /* 1 to print each star's position */
int daoopen( /* Open image source position x y mag file */
char *daofile); /* DAOFIND catalog file name */
char *daoline( /* Read line from image source position x y mag file
*/
int iline, /* Star sequence number in DAOFIND catalog */
char *line); /* Pointer to iline'th entry (returned updated) */
/* Subroutines for sorting tables of star positions and magnitudes from sor
tstar.c */
void FluxSortStars( /* Sort image stars by decreasing flux */
double *sx, /* Image X coordinate */
double *sy, /* Image Y coordinate */
double *sb, /* Brighness in counts */
int *sc, /* Other 4-byte information */
int ns); /* Number of stars to sort */
void MagSortStars( /* Sort image stars by increasing magnitude */
double *sn, /* Identifying number */
double *sra, /* Right Ascension */
double *sdec, /* Declination */
double *spra, /* Right Ascension proper motion */
double *spdec, /* Declination proper motion */
double *sx, /* Image X coordinate */
double *sy, /* Image Y coordinate */
double **sm, /* Magnitudes */
int *sc, /* Other 4-byte information */
char **sobj, /* Object name */
int ns, /* Number of stars to sort */
int nm, /* Number of magnitudes per star */
int ms); /* Magnitude by which to sort (1 to nmag) */
void IDSortStars( /* Sort image stars by increasing ID Number value */
double *sn, /* Identifying number */
double *sra, /* Right Ascension */
double *sdec, /* Declination */
double *spra, /* Right Ascension proper motion */
double *spdec, /* Declination proper motion */
double *sx, /* Image X coordinate */
double *sy, /* Image Y coordinate */
double **sm, /* Magnitudes */
int *sc, /* Other 4-byte information */
char **sobj, /* Object name */
int ns, /* Number of stars to sort */
int nm); /* Number of magnitudes per star */
void RASortStars( /* Sort image stars by increasing right ascension */
double *sn, /* Identifying number */
double *sra, /* Right Ascension */
double *sdec, /* Declination */
double *spra, /* Right Ascension proper motion */
double *spdec, /* Declination proper motion */
double *sx, /* Image X coordinate */
double *sy, /* Image Y coordinate */
double **sm, /* Magnitudes */
int *sc, /* Other 4-byte information */
char **sobj, /* Object name */
int ns, /* Number of stars to sort */
int nm); /* Number of magnitudes per star */
void DecSortStars( /* Sort image stars by increasing declination */
double *sn, /* Identifying number */
double *sra, /* Right Ascension */
double *sdec, /* Declination */
double *spra, /* Right Ascension proper motion */
double *spdec, /* Declination proper motion */
double *sx, /* Image X coordinate */
double *sy, /* Image Y coordinate */
double **sm, /* Magnitudes */
int *sc, /* Other 4-byte information */
char **sobj, /* Object name */
int ns, /* Number of stars to sort */
int nm); /* Number of magnitudes per star */
void XSortStars( /* Sort image stars by increasing image X value */
double *sn, /* Identifying number */
double *sra, /* Right Ascension */
double *sdec, /* Declination */
double *spra, /* Right Ascension proper motion */
double *spdec, /* Declination proper motion */
double *sx, /* Image X coordinate */
double *sy, /* Image Y coordinate */
double **sm, /* Magnitudes */
int *sc, /* Other 4-byte information */
char **sobj, /* Object name */
int ns, /* Number of stars to sort */
int nm); /* Number of magnitudes per star */
void YSortStars( /* Sort image stars by increasing image Y value */
double *sn, /* Identifying number */
double *sra, /* Right Ascension */
double *sdec, /* Declination */
double *spra, /* Right Ascension proper motion */
double *spdec, /* Declination proper motion */
double *sx, /* Image X coordinate */
double *sy, /* Image Y coordinate */
double **sm, /* Magnitudes */
int *sc, /* Other 4-byte information */
char **sobj, /* Object name */
int ns, /* Number of stars to sort */
int nm); /* Number of magnitudes per star */
int MergeStars( /* Merge multiple entries within given radius
* return mean ra, dec, proper motion, and magnitude
(s) */
double *sn, /* Identifying number */
double *sra, /* Right Ascension */
double *sdec, /* Declination */
double *spra, /* Right Ascension proper motion */
double *spdec, /* Declination proper motion */
double *sx, /* Image X coordinate */
double *sy, /* Image Y coordinate */
double **sm, /* Magnitudes */
int *sc, /* Other 4-byte information */
char **sobj, /* Object name */
int ns, /* Number of stars to sort */
int nm, /* Number of magnitudes per star */
double rad, /* Maximum separation in arcseconds to merge */
int log); /* If >0, log progress every time mod number written
*/
/* Catalog utility subroutines from catutil.c */
/* Subroutines for dealing with catalogs */
int RefCat( /* Return catalog type code, title, coord. s
ystem */
char *refcatname, /* Name of reference catalog */
char *title, /* Description of catalog (returned) */
int *syscat, /* Catalog coordinate system (returned) */
double *eqcat, /* Equinox of catalog (returned) */
double *epcat, /* Epoch of catalog (returned) */
int *catprop, /* 1 if proper motion in catalog (returned) */
int *nmag); /* Number of magnitudes in catalog (returned) */
int CatCode( /* Return catalog type code */
char *refcatname); /* Name of reference catalog */
char *CatName( /* Return catalog name given catalog type code */
int refcat, /* Catalog code */
char *refcatname); /* Name of reference catalog */
char *CatSource( /* Return catalog source description given catalog t
ype code */
int refcat, /* Catalog code */
char *refcatname); /* Name of reference catalog */
void CatID( /* Return catalog ID keyword given catalog t
ype code */
char *catid, /* Catalog ID (returned) */
int refcat); /* Catalog code */
double CatRad( /* Return default search radius for given catalog */
int refcat); /* Catalog code */
char *ProgName( /* Return program name given program path used */
char *progpath0); /* Pathname by which program is invoked */
char *ProgCat( /* Return catalog name given program name used */
char *progname); /* Program name which might contain catalog code */
void CatNum( /* Return formatted source number */
int refcat, /* Catalog code */
int nnfld, /* Number of characters in number (from CatNumLen)
* Print leading zeroes if negative */
int nndec, /* Number of decimal places ( >= 0)
* Omit leading spaces if negative */
double dnum, /* Catalog number of source */
char *numstr); /* Formatted number (returned) */
int CatNumLen( /* Return length of source numbers */
int refcat, /* Catalog code */
double maxnum, /* Maximum ID number
* (Ignored for standard catalogs) */
int nndec); /* Number of decimal places ( >= 0) */
int CatNdec( /* Return number of decimal places in source numbers
*/
int refcat); /* Catalog code */
void CatMagName( /* Return name of specified magnitude */
int imag, /* Sequence number of magnitude */
int refcat, /* Catalog code */
char *magname); /* Name of magnitude, returned */
int CatMagNum( /* Returns number of magnitude specified by letter a
s int */
int imag, /* int of magnitude letter */
int refcat); /* Catalog code */
void CatTabHead ( /* Print heading for catalog search result table */
int refcat, /* Catalog being searched */
int sysout, /* Output coordinate system */
int nnfld, /* Number of characters in ID column */
int mprop, /* 1 if proper motion in catalog */
int nmag, /* Number of magnitudes */
char *ranges, /* Catalog numbers to print */
char *keyword, /* Column to add to tab table output */
int gcset, /* 1 if there are any values in gc[] */
int tabout, /* 1 if output is tab-delimited */
int classd, /* GSC object class to accept (-1=all) */
int printxy, /* 1 if X and Y included in output */
char **gobj1, /* Pointer to array of object names; NULL if none */
FILE *fd); /* Output file descriptor; none if NULL */
int StrNdec( /* Return number of decimal places in numeric string
*/
char *string); /* Numeric string */
int NumNdec( /* Return number of decimal places in a number */
double number); /* Floating point number */
void setdateform ( /* Set date format code */
int dateform0); /* Date format code */
char *DateString( /* Return string with epoch of position in desired f
ormat */
double epoch, /* Date as fraction of a year */
int tabout); /* 1 for tab-preceded output string, else space-prec
eded */
void setlimdeg( /* Limit output in degrees (1) or hh:mm:ss dd:mm:ss
(0) */
int degout); /* 1 for fractional degrees, else sexagesimal hours,
degrees */
void SearchLim( /* Compute limiting RA and Dec */
double cra, /* Longitude/Right Ascension of Center of search are
a in degrees */
double cdec, /* Latitude/Declination of search area in degrees */
double dra, /* Horizontal half-width in degrees */
double ddec, /* Vertical half-width in degrees */
int syscoor, /* Coordinate system */
double *ra1, /* Lower right ascension limit in degrees (returned)
*/
double *ra2, /* Upper right ascension limit in degrees (returned)
*/
double *dec1, /* Lower declination limit in degrees (returned) */
double *dec2, /* Upper declination limit in degrees (returned) */
int verbose); /* 1 to print limits, else 0 */
void RefLim( /* Compute limiting RA and Dec in new system */
double cra, /* Longitude/Right Ascension of Center of search are
a in degrees */
double cdec, /* Latitude/Declination of search area in degrees */
double dra, /* Horizontal half-width in degrees */
double ddec, /* Vertical half-width in degrees */
int sysc, /* System of search coordinates */
int sysr, /* System of reference catalog coordinates */
double eqc, /* Equinox of search coordinates in years */
double eqr, /* Equinox of reference catalog in years */
double epc, /* Epoch of search coordinates in years */
double epr, /* Epoch of reference catalog coordinates in years *
/
double secmarg, /* Margin in arcsec/century to catch moving stars */
double *ramin, /* Lower right ascension limit in degrees (returned)
*/
double *ramax, /* Upper right ascension limit in degrees (returned)
*/
double *decmin, /* Lower declination limit in degrees (returned) */
double *decmax, /* Upper declination limit in degrees (returned) */
int *wrap, /* 1 if search passes through 0:00:00 RA */
int verbose); /* 1 to print limits, else 0 */
/* Subroutines for dealing with ranges */
struct Range *RangeInit( /* Initialize range structure from string */
char *string, /* String containing numbers separated by , and - */
int ndef); /* Maximum allowable range value */
int isrange( /* Return 1 if string is a range of numbers, else 0
*/
char *string); /* String which might be a range of numbers */
void rstart( /* Restart range */
struct Range *range); /* Range structure */
int rgetn( /* Return number of values in all ranges */
struct Range *range); /* Range structure */
int rgeti4( /* Return next number in range as integer */
struct Range *range); /* Range structure */
double rgetr8( /* Return next number in range as double */
struct Range *range); /* Range structure */
/* Subroutines for access to tokens within a string */
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 */
char *string, /* character string containing <keyword>= <value> */
char *keyword, /* character string containing the name of the keywo
rd
* the value of which is returned. hget searches fo
r a
* line beginning with this string. if "[n]" or ",n
" is
* present, the n'th token in the value is returned.
*/
int *ival); /* Integer value, returned */
int agetr8( /* Extract double value from keyword= value
in string */
char *string, /* character string containing <keyword>= <value> */
char *keyword, /* character string containing the name of the keywo
rd */
double *dval); /* Double value, returned */
int agets( /* Extract value from keyword= value in string */
char *string, /* character string containing <keyword>= <value> */
char *keyword, /* character string containing the name of the keywo
rd */
int lval, /* Size of value in characters
* If negative, value ends at end of line */
char *value); /* String (returned) */
int tmcid( /* Return 1 if string is 2MASS ID, else 0 */
char *string, /* Character string to check */
double *ra, /* Right ascension (returned) */
double *dec); /* Declination (returned) */
/* Subroutines for VOTable output */
int vothead( /* Print heading for VOTable SCAT output */
int refcat, /* Catalog code */
char *refcatname, /* Name of catalog */
int mprop, /* Proper motion flag */
int typecol, /* Flag for spectral type */
int ns, /* Number of sources found in catalog */
double cra, /* Search center right ascension */
double cdec, /* Search center declination */
double drad); /* Radius to search in degrees */
void vottail(); /* Terminate VOTable SCAT output */
/* Subroutines for version/date string */
void setrevmsg( /* Set version/date string */
char *revmsg); /* Version/date string */
char *getrevmsg(void); /* Return version/date string */
/* Subroutines for fitting and evaluating polynomials */
void polfit( /* Fit polynomial coefficients */
double *x, /* Array of independent variable points */
double *y, /* Array of dependent variable points */
double x0, /* Offset to independent variable */
int npts, /* Number of data points to fit */
int nterms, /* Number of parameters to fit */
double *a, /* Vector containing current fit values */
double *stdev); /* Standard deviation of fit (returned) */
double polcomp( /* Evaluate polynomial from polfit coefficients */
double xi, /* Independent variable */
double x0, /* Offset to independent variable */
int norder, /* Number of coefficients */
double *a); /* Vector containing coeffiecients */
#else /* K&R prototypes */
/* Subroutines for reading TDC ASCII catalogs (ctgread.c) */
int ctgread(); /* Read sources by sky region from SAO TDC ASCII for
mat catalog */
int ctgrnum(); /* Read sources by number from SAO TDC ASCII format
catalog */
int ctgrdate(); /* Read sources by date range from SAO TDC A
SCII format catalog */
int ctgbin(); /* Bin sources from SAO TDC ASCII format catalog */
int ctgstar(); /* Read one star entry from ASCII catalog, 0 if OK *
/
int isacat(); /* Return 1 if string is name of ASCII catalog file
*/
struct StarCat *ctgopen();
void ctgclose();
/* Subroutines for extracting sources from HST Guide Star Catalog */
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 gscbin(); /* Bin sources from HST Guide Star Catalog */
void setgsclass(); /* Set GSC object class */
/* Subroutine to read GSC II catalog over the web (gsc2read.c) */
int gsc2read(); /* Read sources by sky region from GSC II Ca
talog */
/* Subroutine to read SDSS catalog over the web (sdssread.c) */
int sdssread(); /* Read sources by sky region from SDSS Cata
log */
char *sdssc2t(); /* Convert SDSS buffer from comma- to tab-separated
*/
/* 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 tmcrnum(); /* Read sources by ID number from 2MASS Point Source
Catalog */
int tmcbin(); /* Bin sources from 2MASS Point Source Catalog */
/* Subroutines to read local copies of USNO A and SA catalogs (uacread.c) *
/
int uacread(); /* Read sources by sky region from USNO A or SA Cata
log */
int uacrnum(); /* Read sources by ID number from USNO A or SA Catal
og */
int uacbin(); /* Bin sources from USNO A or SA Catalog */
void setuplate(); /* Set USNO catalog plate number to search */
int getuplate(); /* Get USNO catalog plate number to search */
/* Subroutines to read local copies of USNO B catalogs (ubcread.c) */
int ubcread(); /* Read sources by sky region from USNO B Catalog */
int ubcrnum(); /* Read sources by ID number from USNO B Catalog */
int ubcbin(); /* Bin sources from USNO B Catalog */
/* Subroutines to read local copies of USNO UCAC catalogs (ucacread.c) */
int ucacread(); /* Read sources by sky region from USNO UCAC
1 Catalog */
int ucacrnum(); /* Read sources by ID number from USNO UCAC
1 Catalog */
int ucacbin(); /* Bin sources from USNO UCAC 1 Catalog */
/* Subroutines to read local copies of USNO UJ catalog (ucacread.c) */
int ujcread(); /* Read sources by sky region from USNO J Catalog */
int ujcrnum(); /* Read sources by ID number from USNO J Catalog */
int ujcbin(); /* Bin sources from USNO J Catalog */
/* Subroutines to read a local copy of the Tycho-2 catalog (ty2read.c) */
int ty2read(); /* Read sources by sky region from Tycho 2 Catalog *
/
int ty2rnum(); /* Read sources by ID number from Tycho 2 Catalog */
int ty2bin(); /* Bin sources from Tycho 2 Catalog */
/* Subroutines to read a local copy of the ACT catalog (actread.c) */
int actread(); /* Read sources by sky region from USNO ACT Catalog
*/
int actrnum(); /* Read sources by ID number from USNO ACT Catalog *
/
int actbin(); /* Bin sources from USNO ACT Catalog */
/* Subroutines to read SAO-TDC binary format catalogs (binread.c) */
int binread(); /* Read sources by sky region from SAO TDC binary fo
rmat catalog */
int binrnum(); /* Read sources by ID number from SAO TDC binary for
mat catalog */
int binbin(); /* Bin sources from SAO TDC binary format catalog */
int binstar(); /* Read one star entry from binary catalog, 0 if OK
*/
int isbin();
struct StarCat *binopen();
void binclose();
/* Subroutines for extracting tab table information (tabread.c) */
int tabread(); /* Read sources from tab table catalog */
int tabrnum(); /* Read sources from tab table catalog */
int tabbin(); /* Read sources from tab table catalog */
struct TabTable *tabopen(); /* Open tab table file */
struct StarCat *tabcatopen(); /* Open tab table catalog */
void tabcatclose(); /* Close tab table catalog */
int tabxyread(); /* Read x, y, and magnitude from tab table star list
*/
void settabkey(); /* Set tab table keyword to read for object */
char *gettabline(); /* Find a specified line in a tab table */
int tabrkey(); /* Keyword values from tab table catalogs */
int tabcol(); /* Find column for name */
int tabgetk(); /* Get tab table entries for named column */
int tabgetc(); /* Get tab table entry for named column */
int tabgeti4(); /* Return 4-byte integer from tab table line
*/
int tabparse(); /* Aeturn column names and positions in tabt
able */
double tabgetra(); /* Return right ascension in degrees from tab table*
/
double tabgetdec(); /* Return declination in degrees from tab table*/
double tabgetr8(); /* Return double number from tab table line */
void tabclose(); /* Free all arrays left open by tab table structure
*/
char *gettaberr(); /* Return most recent tab table error message */
int istab(); /* Return 1 if tab table file, else 0 */
int gettabndec(); /* Return number of decimal places in tab catalog id
s */
/* Subroutines to read catalogs over the web, from SCAT, HST, ESO, or SDSS
servers */
int webread(); /* Read sources by sky region from catalog on the Wo
rld Wide Web */
int webrnum(); /* Read sources by ID number from catalog on the Wor
ld Wide Web */
char *webbuff(); /* Read URL into buffer across the web */
struct TabTable *webopen(); /* Open tab table across the web */
/* Subroutines to read DAOPHOT-style catalogs of sources found in an image
*/
int daoread(); /* Read image source positions from x y mag file */
int daoopen(); /* Open image source position x y mag file */
char *daoline(); /* Read line from image source position x y mag file
*/
/* Subroutines for sorting tables of star positions and magnitudes from sor
tstar.c */
void FluxSortStars(); /* Sort image stars by decreasing flux */
void MagSortStars(); /* Sort image stars by increasing magnitude */
void IDSortStars(); /* Sort image stars by increasing ID Number value */
void RASortStars(); /* Sort image stars by increasing right ascension */
void DecSortStars(); /* Sort image stars by increasing declination */
void XSortStars(); /* Sort image stars by increasing image X value */
void YSortStars(); /* Sort image stars by increasing image Y value */
int MergeStars(); /* Merge multiple entries within given radius */
/* Catalog utility subroutines from catutil.c */
/* Subroutines for dealing with catalogs */
int CatCode(); /* Return catalog type code */
int RefCat(); /* Return catalog type code, title, coord. system */
char *CatName(); /* Return catalog name given catalog type code */
char *CatSource(); /* Return catalog source description given catalog t
ype code */
char *ProgCat(); /* Return catalog name given program name used */
char *ProgName(); /* Return program name given program path used */
char *CatName(); /* Return catalog name given catalog type code */
void CatID(); /* Return catalog ID keyword given catalog type code
*/
void CatNum(); /* Return formatted source number */
int CatNumLen(); /* Return length of source numbers */
int CatNdec(); /* Return number of decimal places in source numbers
*/
void CatMagName(); /* Return name of specified magnitude */
int CatMagNum(); /* Returns number of magnitude specified by letter a
s int */
double CatRad(); /* Return default search radius for given catalog */
int tmcid(); /* Return 1 if string is 2MASS ID, else 0 */
int NumNdec(); /* Return number of decimal places in a number */
int StrNdec(); /* Return number of decimal places in numeric string
*/
void setdateform(); /* Set date format code */
void setlimdeg(); /* Limit output in degrees (1) or hh:mm:ss dd:mm:ss
(0) */
char *DateString(); /* Convert epoch to output format */
void SearchLim(); /* Compute limiting RA and Dec */
void RefLim(); /* Compute limiting RA and Dec in new system */
int ageti4(); /* Extract int value from keyword= value in string *
/
int agetr8(); /* Extract double value from keyword= value in strin
g */
int agets(); /* Extract value from keyword= value in string */
void bv2sp(); /* Approximate main sequence spectral type from B -
V */
/* Subroutines for dealing with ranges */
struct Range *RangeInit(); /* Initialize range structure from string */
int isrange(); /* Return 1 if string is a range of numbers, else 0
*/
int rgetn(); /* Return number of values in all ranges */
int rgeti4(); /* Return next number in range as integer */
double rgetr8(); /* Return next number in range as double */
void rstart(); /* Restart range */
/* Subroutines for access to tokens within a string */
int setoken(); /* Tokenize a string for easy decoding */ int setoken(); /* Tokenize a string for easy decoding */
int nextoken(); /* Get next token from tokenized string */ int nextoken(); /* Get next token from tokenized string */
int getoken(); /* Get specified token from tokenized string */ int getoken(); /* Get specified token from tokenized string */
/* Subroutines for fitting and evaluating polynomials */
void polfit(); /* Fit polynomial coefficients */
double polcomp(); /* Evaluate polynomial from polfit coefficients */
/* 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 */
void polfit(); /* Fit polynomial coefficients */
double polcomp(); /* Evaluate polynomial from polfit coefficients */
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _wcscat_h_ */
/* Sep 22 1998 New header file (star.h) /* Sep 22 1998 New header file (star.h)
* Oct 16 1998 Add more options for ASCII catalogs * Oct 16 1998 Add more options for ASCII catalogs
* Oct 20 1998 Add object name to binary files * Oct 20 1998 Add object name to binary files
* Oct 21 1998 New file (wcscat.h) * Oct 21 1998 New file (wcscat.h)
* Oct 26 1998 Combined wcscat.h and star.h * Oct 26 1998 Combined wcscat.h and star.h
* Oct 27 1998 Add SAOimage region shapes * Oct 27 1998 Add SAOimage region shapes
* Nov 9 1998 Add rasorted flag to catalog structure * Nov 9 1998 Add rasorted flag to catalog structure
* Nov 20 1998 Add support for USNO A-2.0 and SA-2.0 catalogs * Nov 20 1998 Add support for USNO A-2.0 and SA-2.0 catalogs
* Dec 8 1998 Add support for the Hipparcos and ACT catalogs * Dec 8 1998 Add support for the Hipparcos and ACT catalogs
* *
skipping to change at line 529 skipping to change at line 1649
* *
* Jul 27 2005 Add date format codes and DateString() * Jul 27 2005 Add date format codes and DateString()
* 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
*/ */
 End of changes. 12 change blocks. 
241 lines changed or deleted 1564 lines changed or added


 wcslib.h   wcslib.h 
skipping to change at line 80 skipping to change at line 80
#if __STDC__ || defined(__cplusplus) #if __STDC__ || defined(__cplusplus)
int prjset(const char [], struct prjprm *); int prjset(const char [], struct prjprm *);
int prjfwd(const double, const double, struct prjprm *, double *, double *); int prjfwd(const double, const double, struct prjprm *, double *, double *);
int prjrev(const double, const double, struct prjprm *, double *, double *); int prjrev(const double, const double, struct prjprm *, double *, double *);
int azpset(struct prjprm *); int azpset(struct prjprm *);
int azpfwd(const double, const double, struct prjprm *, double *, double *); int azpfwd(const double, const double, struct prjprm *, double *, double *);
int azprev(const double, const double, struct prjprm *, double *, double *); int azprev(const double, const double, struct prjprm *, double *, double *);
int szpset(struct prjprm *); int szpset(struct prjprm *);
int szpfwd(const double, const double, struct prjprm *, double *, double *); int szpfwd(const double, const double, struct prjprm *, double *, double *);
int szprev(const double, const double, struct prjprm *, double *, double *); int szprev(const double, const double, struct prjprm *, double *, double *);
int szpset(struct prjprm *);
int szpfwd(const double, const double, struct prjprm *, double *, double
*);
int szprev(const double, const double, struct prjprm *, double *, double
*);
int tanset(struct prjprm *); int tanset(struct prjprm *);
int tanfwd(const double, const double, struct prjprm *, double *, double *); int tanfwd(const double, const double, struct prjprm *, double *, double *);
int tanrev(const double, const double, struct prjprm *, double *, double *); int tanrev(const double, const double, struct prjprm *, double *, double *);
int stgset(struct prjprm *); int stgset(struct prjprm *);
int stgfwd(const double, const double, struct prjprm *, double *, double *); int stgfwd(const double, const double, struct prjprm *, double *, double *);
int stgrev(const double, const double, struct prjprm *, double *, double *); int stgrev(const double, const double, struct prjprm *, double *, double *);
int sinset(struct prjprm *); int sinset(struct prjprm *);
int sinfwd(const double, const double, struct prjprm *, double *, double *); int sinfwd(const double, const double, struct prjprm *, double *, double *);
int sinrev(const double, const double, struct prjprm *, double *, double *); int sinrev(const double, const double, struct prjprm *, double *, double *);
int arcset(struct prjprm *); int arcset(struct prjprm *);
skipping to change at line 378 skipping to change at line 375
double acosdeg(); double acosdeg();
double asindeg(); double asindeg();
double atandeg(); double atandeg();
double atan2deg(); double atan2deg();
#endif #endif
/* Domain tolerance for asin and acos functions. */ /* Domain tolerance for asin and acos functions. */
#define WCSTRIG_TOL 1e-10 #define WCSTRIG_TOL 1e-10
#ifdef __cplusplus #ifdef __cplusplus
}; }
#endif #endif
#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
* Jan 4 2007 Doug Mink - Drop extra declarations of SZP subroutines
*/ */
 End of changes. 3 change blocks. 
6 lines changed or deleted 3 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/