Commit b1348759 authored by No Author's avatar No Author
Browse files

This commit was manufactured by cvs2svn to create tag 'Root_cosmos'.

parent 2acc4acd
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Bayesian Inference
//
// Filename: bayesys3.h
//
// Purpose: Header for bayesys3.c
//
// History: JS 28 Jan 2002 - 18 Sep 2003
//-----------------------------------------------------------------------------
#ifndef BAYESYS3
#define BAYESYS3
/**************/
/* Structures */
/**************/
typedef struct // GENERAL INFORMATION AND WORKSPACE
{
// BayeSys3 external
int Ndim; // I Hypercube dimension = # variables in atom
int MinAtoms; // I Min #atoms >= 1
int MaxAtoms; // I Max #atoms >= MinAtoms (or 0 for unlimited)
double Alpha; // I Hyperparameter for #atoms (+ve or 0 or -ve)
int ENSEMBLE; // I # sample objects in ensemble
int Method; // I Method of algorithm
double Rate; // I Annealing rate
int Iseed; // I O Random seed, +ve = fixed, -ve = time seed
double cool; //(I)O Annealing (burnin<1, Bayes=1, maxLhood=inf)
double Evidence; // O log[e] Pr(Data)
double Information;// O -log"Volume" = INT post log(post/prior) dx
int Nsystem; // O Elapsed iterates
double CPU; // O CPU in units of 1-atom Del|Try|Ins changes
double Success; // O # successes (as internally defined)
// (100% efficiency would be Success ~ CPU)
int Valency; // I 0, or MassInf valency
// MassInf external (referenced by BayeSys3 and used if Valency > 0)
int MassInf; // I Method of analysing Gaussian or Poisson data
// 0=monkeys, 1=positive, 2=pos/neg, 3=gauss,
// add 10 to allow flux=0: add 100 if Poisson data
int Ndata; // I # data
double* Data; // I Data [Ndata]
double* Acc; // I 1/Gaussian_sigma, or Poisson background [Ndata]
double ProbON; // I Prob(individual flux != 0), > 0
double FluxUnit0; // I O Hyperparameter for unit of flux
// BayeSys3 internal
int Nbits; // O # bits per word
unsigned* offset; // (O)Cube-to-Label mapping [Ndim]
int* permute; // (O)Cube-to-Label mapping [Ndim]
unsigned Rand[4]; // O Random generator
// MassInf internal (referenced by BayeSys3 and used if Poisson data)
int* Counts; // (O)Annealed data counts [Ndata]
// USER monitoring information
void* UserCommon;
} CommonStr;
typedef struct // MEMBER OBJECT OF ENSEMBLE
{
// BayeSys3 external
double Lhood; // O log Prob(Data|object)
int Natoms; // O # atoms in object (used dimension of Cube)
double** Cubes; // O Atomic output [Natoms][Ndim+Valency+1]
// Ndim cube position, Valency fluxes, log(width)
// De-allocated before exiting BayeSys3
// MassInf external (referenced by BayeSys3 and used there iff Valency > 0)
double* Mock; // (O)Workspace for Mock data [Ndata]
// De-allocated before exiting BayeSys3
double FluxUnit; // O Unit of flux
// BayeSys3 internal
int Nstore; // # atoms allocated (physical dim of Cube)
unsigned* xLabel; // Label control [Ndim]
unsigned* yLabel; // Label control [Ndim]
unsigned* xOrigin; // Label control [Ndim]
unsigned* yOrigin; // Label control [Ndim]
unsigned* xTry; // Label control [Ndim]
unsigned* yTry; // Label control [Ndim]
unsigned* work; // Cube-to-Label workspace [Ndim]
int clock; // parallel operation
int flowcheck; // parallel operation
unsigned Rand[4]; // Random generator
// MassInf internal (referenced by BayeSys3 and used there if Valency > 0)
int reset; // Reset inserted MassInf fluxes?
double* g1; // grad chisquared [Valency]
double* g2; // grad chisquared [Valency]
double* A11; // grad grad chisquared [Valency]
double* A12; // grad grad chisquared [Valency]
double* A22; // grad grad chisquared [Valency]
int* Xindex; // Index to cross-terms [Valency]
int* nbits; // Fragment numbers [Valency]
int* nbitx; // Fragment numbers [Valency]
int* ibits; // Fragment identifiers [<=Ndata]
int* ibitx; // Fragment identifiers [<=Ndata]
double* zbits; // Fragment quantities [<=Ndata]
double* zbitx; // Fragment quantities [<=Ndata]
double* Foot; // Footprint of unit flux [Ndata]
int* flags; // Valency identifiers [Ndata]
// USER information for individual objects
void* UserObject;
} ObjectStr;
/**************/
/* Procedures */
/**************/
#ifdef __cplusplus
extern "C" {
#endif
// Full Bayesian calculation ended by UserMonitor
extern int BayeSys3( // O +ve = UserMonitor return code, -ve = abort
CommonStr* Common, // I O General information
ObjectStr* Objects); // O ENSEMBLE of sample objects
extern void BayeShape( // Transform cube position to other shape
double* Coord, // O Coordinates
double* Cube, // I Cube (or part of)
int N, // I Dimension of (part of) Cube
int Shape); // I Choice of coordinate shape
// Set empty object with 0 atoms
extern int UserEmpty( // O >=0 is OK, -ve is error abort
double* Lhood, // O loglikelihood
CommonStr* Common, // I General information
ObjectStr* Object); // O Sample object
// Try one new atom
extern int UserTry1( // O +ve = OK, 0 = DO NOT USE, -ve = error abort
double* Ltry, // O DELTA(logLikelihood) from 1 trial atom
CommonStr* Common, // I General information
ObjectStr* Object); // I Sample object (DO NOT UPDATE Lhood)
// Try two new atoms
extern int UserTry2( // O +ve = OK, 0 = DO NOT USE, -ve = error abort
double* Ltry1, // O DELTA(logLikelihood) from 1st trial atom
double* Ltry2, // O DELTA(logLikelihood) from both trial atoms
CommonStr* Common, // I General information
ObjectStr* Object); // I Sample object (DO NOT UPDATE Lhood)
// Insert one atom and update
extern int UserInsert1( // O >=0 is OK, -ve is error abort
double* Lhood, // O DELTA(loglikelihood)
CommonStr* Common, // I General information
ObjectStr* Object); // I O Sample object
// Insert two atoms and update
extern int UserInsert2( // O >=0 is OK, -ve is error abort
double* Lhood, // O DELTA(loglikelihood)
CommonStr* Common, // I General information
ObjectStr* Object); // I O Sample object
// Delete one atom and update
extern int UserDelete1( // O >=0 is OK, -ve is error abort
double* Lhood, // O DELTA(loglikelihood)
CommonStr* Common, // I General information
ObjectStr* Object); // I O Sample object
// Mock data from unit flux for MassInf
extern int UserFoot( // O +ve = OK, 0 = DO NOT USE, -ve = error abort
double* Cube, // I Atom coordinates
CommonStr* Common, // I General information
int* ibits, // O Fragment coords
double* zbits, // O Fragment quantities
int* nbits); // O # fragments >= 0, SUM(nbits) <= Ndata
// Inspect progress and collect statistics
extern int UserMonitor( // O 0 = continue, +ve = finish, -ve = abort
CommonStr* Common, // I General information
ObjectStr* Objects); // I ENSEMBLE of sample objects
#ifdef __cplusplus
};
#endif
/*************/
/* Constants */
/*************/
#undef E_BAYESYS_PARMS
#define E_BAYESYS_PARMS -220 // Wrong input parameters
#undef E_BAYESYS_SYSERR
#define E_BAYESYS_SYSERR -221 // Global error (atom insertion failure)
#undef E_MASSINF_PARMS
#define E_MASSINF_PARMS -210 // Wrong input parameters
#undef E_MASSINF_OVERLAP
#define E_MASSINF_OVERLAP -211 // Valency footprints overlap wrongly
#undef E_MASSINF_NBITS
#define E_MASSINF_NBITS -212 // Too many fragments
#undef E_MASSINF_RANGE
#define E_MASSINF_RANGE -213 // Fragment outside data range
#undef E_MASSINF_DATA
#define E_MASSINF_DATA -214 // Negative count data supplied
#undef E_MASSINF_COUNTS
#define E_MASSINF_COUNTS -215 // Count data too large threatening overflow
#undef E_MALLOC
#define E_MALLOC -130 // Can't allocate memory
#endif
/*
* constants definition
*/
#ifndef CONSTANT_H
#define CONSTANT_H
#define PI 3.141592653589793238462643
#define INVG 2.325968e8 // in Msol/(km/s)^2/Mpc
#define pi_in_a 648000. /* pi en arcsecond */
#define RTD 57.29578 /* 1 rad en deg = 180/pi */
#define DTR 0.017453293 /* 1 deg en rad = pi/180 */
#define RTA 206264.81 /* 1 rad en arecsecond = 648000/pi */
#define pia_c2 7.209970e-06 /* pi en arcsecond/ c^2 = 648000/vol/vol */
#define vol 299792.50 /* en km/s cf. Weinberg*/
#define GM_c2 1.475 /* 1.e12 G.M_sol/c2 en 1.e12 km cf. Weinberg*/
#define kpot 4.59e-7 /* 2(arcsec)/c^2 in arecsec/(km/s)^2 */
#define ikpot 2178644.6 /* c^2/2(arcsec) in (km/s)^2/arecsec */
#define h0 50.
#define MCRIT 7.36126993e11 /* c^3/4Gh0 in M_sol/arcsec^2 (h0=50) */
#define MCRIT12 .2343165 /* c^3/4piGh0 in 1e12 M_sol/arcsec^2 (h0=50) */
#define PC 30.8563 /* 1 pc en 1.e12 km */
#define Mpc 30856300. /* 1 Mpc en 1.e12 km */
#define D0Mpc 5995.85 /* c/H0 en Mpc */
#define D0pc 5995850000. /* c/H0 en pc */
#define d0 29.068701 /* vol/h0*1000/rta -- c/H0 en h-1.kpc/arcsecond (h0=50)*/
#define D0 896952.55
/* vol/h0*Mpc/rta -- c/H0 en 1.e12 h-1.km/arcsecond */
#define cH2piG 0.11585881 /* cH0/2piG en g/cm^2 (H0=50) */
#define cH4piG 0.057929405 /* cH0/4piG en g/cm^2 (H0=50) */
#define cH0_4piG 2.7730112e-4 /* cH0/4piG en 10^12 M_Sol/kpc^2 (H0=50) */
#define E2max .125
#define tyaa .45964488 /* (1/H0)*(pi/648000)^2 (h0=50) in year */
#define th_a2_day 167.8852919 /* (1/H0)*(pi/648000)^2 (h0=50) in days */
#define Msol_in_g 1.989e33
#define cm_in_arcsec 4.982444e15
#define inte 0.012537756 /* cm_in_arcsec^2/Msol_in_g */
#endif // if CONSTANT_H
/*
* Dimension definition
*/
#ifndef DIMENSION_H
#define DIMENSION_H
#define NGGMAX 128 /* maximum grid points in the I->S mapping */
#define NAMAX 40000 /* maximum number of arclets */
#define NASMAX 1000 /* maximum number of arclets for study*/
#define IDSIZE 10 /* size in characters of the id of clumps and images*/
#define ZMBOUND 10 /* maximum number of redshift bounded families*/
#define NGMAX 400 // maximum number of point with the grille command
#define NMAX 5000
#define NPMAX 5000
#define NPZMAX 9 /* maximum number of critical lines in g_cline struct*/
#define NLMAX 500 // maximum number of clumps in the lens[] array
#define NIMAX 50 /* maximum number of families and images per family */
#define NPAMAX 15
#define NTMAX 1024
#define NPOINT 1024 /* Number of contour points in cleanlens mode*/
#define NPARMAX 50
#define NMCMAX 500
#define ARRAY_SIZE 2000000
/* zero pour les calculs de dichotomie, amplification infinie, pente nulle */
#define PREC_ZERO .00001
/* erreur sur dlsds pour le calcul inverse source->image */
#define PREC_DLSDS .00001
/* nombre maximal de points sur une ligne critique tangentielle ou radiale*/
#define NTLINEMAX 250
#define NRLINEMAX 250
#define DMIN 1e-4 // distance minimale de convergence dans le plan image (in arcsec)
#define NITMAX 100
#define IDPARAM1 1 // column of the 1st physical parameter in array (cf readBayesModel.c)
#define LINESIZE 4096 // size of a line in bayes.dat
#endif // if DIMENSION_H
/*** File fitshead.h FITS header access subroutines
*** February 26, 2004
*** By Doug Mink, dmink@cfa.harvard.edu
*** Harvard-Smithsonian Center for Astrophysics
*** Copyright (C) 1996-2004
*** Smithsonian Astrophysical Observatory, Cambridge, MA, USA
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Correspondence concerning WCSTools should be addressed as follows:
Internet email: dmink@cfa.harvard.edu
Postal address: Doug Mink
Smithsonian Astrophysical Observatory
60 Garden St.
Cambridge, MA 02138 USA
*/
/* Declarations for subroutines in hget.c, hput.c, and iget.c */
#ifndef _fitshead_h_
#define _fitshead_h_
#include <sys/types.h>
#ifdef __cplusplus /* C++ prototypes */
extern "C" {
/* Subroutines in hget.c */
int hgeti2( /* Extract short value from FITS header */
const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */
short* val); /* short integer value (returned) */
int hgeti4c( /* Extract int value from FITS header */
const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */
const char mchar, /* WCS to use */
int* val); /* integer value (returned) */
int hgeti4( /* Extract int value from FITS header */
const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */
int* val); /* integer value (returned) */
int hgetr4( /* Extract float value from FITS header */
const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */
float* val); /* float value (returned) */
int hgetr8c( /* Extract double value from FITS header */
const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */
const char mchar, /* WCS to use */
double* val); /* double value (returned) */
int hgetr8( /* Extract double value from FITS header */
const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */
double* val); /* double value (returned) */
int hgetra( /* Extract right ascension from FITS header */
const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */
double* ra); /* RA in degrees (returned) */
int hgetdec( /* Extract declination from FITS header */
const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */
double* dec); /* Dec in degrees (returned) */
int hgetdate( /* Extract date from FITS header */
const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */
double* date); /* Date in fractional years (returned) */
int hgetl( /* Extract boolean value from FITS header */
const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */
int* lval); /* 1 if T, 0 if F (returned) */
int hgetsc( /* Extract string value from FITS header */
const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */
const char mchar, /* WCS to use */
const int lstr, /* maximum length of returned string */
char* string); /* null-terminated string value (returned) */
int hgets( /* Extract string value from FITS header */
const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */
const int lstr, /* maximum length of returned string */
char* string); /* null-terminated string value (returned) */
int hgetm ( /* Extract string from multiple keywords */
const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */
const int lstr, /* maximum length of returned string */
char* string); /* null-terminated string value (returned) */
int hgetndec( /* Find number of decimal places in FITS value*/
const char* hstring, /* FITS header string */
const char* keyword, /* FITS keyword */
int* ndec); /* number of decimal places (returned) */
char* hgetc( /* Return pointer to value for FITS keyword */
const char* hstring, /* FITS header string */
const char* keyword); /* FITS keyword */
char* ksearch( /* Return pointer to keyword in FITS header */
const char* hstring, /* FITS header string */
const char* keyword); /* FITS keyword */
char *blsearch (
const char* hstring, /* FITS header string */
const char* keyword); /* FITS keyword */
char *strsrch ( /* Find string s2 within string s1 */
const char* s1, /* String to search */
const char* s2); /* String to look for */
char *strnsrch ( /* Find string s2 within string s1 */
const char* s1, /* String to search */
const char* s2, /* String to look for */
const int ls1); /* Length of string being searched */
char *strcsrch ( /* Find string s2 within string s1 (no case) */
const char* s1, /* String to search */
const char* s2); /* String to look for */
char *strncsrch ( /* Find string s2 within string s1 (no case) */
const char* s1, /* String to search */
const char* s2, /* String to look for */
const int ls1); /* Length of string being searched */
int hlength( /* Set length of unterminated FITS header */
char *header, /* FITS header */
const int lhead); /* Allocated length of FITS header */
int gethlength( /* Get length of current FITS header */
char *header); /* FITS header */
double str2ra( /* Return RA in degrees from string */
const char* in); /* Character string (hh:mm:ss.sss or dd.dddd) */
double str2dec( /* Return Dec in degrees from string */
const char* in); /* Character string (dd:mm:ss.sss or dd.dddd) */
int isnum( /* Return 1 if number, else 0 */
const char* string); /* Character string which may be a number */
int notnum( /* Return 0 if number, else 1 */
const char* string); /* Character string which may be a number */
int numdec( /* Return number of decimal places in number */
const char* string); /* Character string which may be a number */
char *getltime(); /* Return current local time in ISO format */
char *getutime(); /* Return current UT as an ISO-format string */
/* Subroutines in iget.c */
int mgetstr( /* Extract string from multiline FITS keyword */
const char* hstring, /* FITS header string */
const char* mkey, /* FITS keyword root _n added for extra lines */
const char* keyword, /* IRAF keyword */
const int lstr, /* maximum length of returned string */
char* string); /* null-terminated string value (returned) */
int mgeti4( /* Extract int from multiline FITS keyword */
const char* hstring, /* FITS header string */
const char* mkey, /* FITS keyword root _n added for extra lines */
const char* keyword, /* IRAF keyword */
int* ival); /* int keyword value (returned) */
int mgetr8( /* Extract double from multiline FITS keyword */
const char* hstring, /* FITS header string */
const char* mkey, /* FITS keyword root _n added for extra lines */
const char* keyword, /* IRAF keyword */
double dval); /* double keyword value (returned) */
int igeti4( /* Extract int from IRAF keyword string */
const char* hstring, /* Multiline IRAF keyword string value */
const char* keyword, /* IRAF keyword */
int* val); /* int value (returned) */
int igetr4( /* Extract float from IRAF keyword string */
const char* hstring, /* Multiline IRAF keyword string value */
const char* keyword, /* IRAF keyword */
float* val); /* float value (returned) */
int igetr8( /* Extract double from IRAF keyword string */
const char* hstring, /* Multiline IRAF keyword string value */
const char* keyword, /* IRAF keyword */
double* val); /* double value (returned) */
int igets( /* Extract string from IRAF keyword string */
const char* hstring, /* Multiline IRAF keyword string value */
const char* keyword, /* IRAF keyword */
const int lstr, /* maximum length of returned string */
char* string); /* null-terminated string value (returned) */
char *igetc( /* Extract string from IRAF keyword string */
const char* hstring, /* Multiline IRAF keyword string value */
const char* keyword); /* IRAF keyword */
/* Subroutines in hput.c */
/* All hput* routines return 0 if successful, else -1 */
int hputi2( /* Implant short value into FITS header */
char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */
const short ival); /* short value */
int hputi4( /* Implant int value into FITS header */
char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */
const int ival); /* int value */
int hputr4( /* Implant float value into FITS header */
char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */
const float rval); /* float value */
int hputr8( /* Implant short into FITS header */
char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */
const double dval); /* double value */
int hputnr8( /* double with specified number of decimal places */
char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */
const int ndec, /* Number of decimal places in keyword value */
const double dval); /* double value */
int hputs( /* Quoted character string into FITS header */
char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */
const char* cval); /* Character string value */
int hputm( /* Quoted character string, mutiple keywords */
char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */
const char* cval); /* Character string value */
int hputcom( /* Add comment to keyword line in FITS header */
char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */
const char* comment); /* Comment string */
int hputra( /* Right ascension in degrees into hh:mm:ss.sss */
char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */
const double ra); /* Right ascension in degrees */
int hputdec( /* Declination in degrees into dd:mm:ss.ss */
char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */
const double dec); /* Declination in degrees */
int hputl( /* Implant boolean value into FITS header */
char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */
const int lval); /* 0->F, else ->T */
int hputc( /* Implant character string without quotes */
char* hstring, /* FITS header string (modified) */
const char* keyword, /* FITS keyword */
const char* cval); /* Character string value */
int hdel( /* Delete a keyword line from a FITS header */
char* hstring, /* FITS header string (modified) */
const char* keyword); /* FITS keyword to delete */
int hadd( /* Add a keyword line from a FITS header */
char* hplace, /* Location in FITS header string (modified) */
const char* keyword); /* FITS keyword to add */
int hchange( /* Change a keyword name in a FITS header */
char* hstring, /* FITS header string (modified) */
const char* keyword1, /* Current FITS keyword name */
const char* keyword2); /* New FITS keyword name */
void ra2str( /* Convert degrees to hh:mm:ss.ss */
char *string, /* Character string (returned) */
int lstr, /* Length of string */
const double ra, /* Right ascension in degrees */
const int ndec); /* Number of decimal places in seconds */
void dec2str( /* Convert degrees to dd:mm:ss.ss */
char *string, /* Character string (returned) */
int lstr, /* Length of string */
const double dec, /* Declination in degrees */
const int ndec); /* Number of decimal places in arcseconds */
void deg2str( /* Format angle into decimal degrees string */
char *string, /* Character string (returned) */
int lstr, /* Length of string */
const double deg, /* Angle in degrees */
const int ndec); /* Number of decimal places in degrees */
void num2str( /* Format number into string */
char *string, /* Character string (returned) */
const double num, /* Number */
const int field, /* Total field size in characters */
const int ndec); /* Number of decimal places */
};
#else /* __cplusplus */
/* Subroutines in hget.c */
/* Extract a value from a FITS header for given keyword */
extern int hgeti4(); /* int (Multiple WCS) */
extern int hgeti4c(); /* int */
extern int hgeti2(); /* short */
extern int hgetr4(); /* float */
extern int hgetr8(); /* double */
extern int hgetr8c(); /* double (Multiple WCS) */
extern int hgetra(); /* Right ascension in degrees from string */
extern int hgetdec(); /* Declination in degrees from string */
extern int hgetdate(); /* Date in years from FITS date string */
extern int hgetl(); /* T->1, F->0 from FITS logical entry */
extern int hgets(); /* Previously allocated string */
extern int hgetsc(); /* Previously allocated string (Multiple WCS) */
extern int hgetm(); /* Previously allocated string from multiple keywords */
extern char *hgetc(); /* Return pointer to string */
extern int hgetndec(); /* Number of decimal places in keyword value */
/* Subroutines to convert strings to RA and Dec in degrees */
extern double str2ra();
extern double str2dec();
/* Check to see whether a string is a number or not */
extern int isnum();
extern int notnum();
extern int decnum();
/* Find given keyword entry in FITS header */
extern char *ksearch();
/* Find beginning of fillable blank line before FITS header keyword */
extern char *blsearch();
/* Search for substring s2 within string s1 */
extern char *strsrch (); /* s1 null-terminated */
extern char *strnsrch (); /* s1 ls1 characters long */
extern char *strcsrch (); /* s1 null-terminated (case-insensitive) */
extern char *strncsrch (); /* s1 ls1 characters long (case-insensitive) */
/* Set length of header which is not null-terminated */
extern int hlength();
/* Get length of current FITS header */
extern int gethlength();
/* Subroutines in iget.c */
extern int mgetstr(); /* Previously allocated string from multiline keyword */
extern int mgetr8(); /* double from multiline keyword */
extern int mgeti4(); /* int from multiline keyword */
extern int igeti4(); /* long integer from IRAF compound keyword value */
extern int igetr4(); /* real from IRAF compound keyword value */
extern int igetr8(); /* double from IRAF compound keyword value */
extern int igets(); /* character string from IRAF compound keyword value */
extern char *igetc(); /* Extract string from IRAF keyword string */