
/**************************************************************************
 *                                                                        *
 * Copyright (c) 1996 Michael Richmond and Richard Treffers               *
 *                                                                        *
 *                    This software may be copied and distributed for     *
 *                    educational, research and not for profit services   *
 *                    provided that this copyright and statement are      *
 *                    included in all such copies.                        *
 *                                                                        *
 **************************************************************************/


/*      
	include file for FITS

	  !!! CAUTION: the fits writing routines SWAP data bytes !!!
	9/6/94 - unsigned changed to int
	2/23/99 - increased NHANDLE from 16 to 32.  MWR
	7/7/2000 - increased NHANDLE from 32 to 150.  MWR
*/

#define FITS_FAIL                      -1
#define FITS_PASS                       1                       
#define FITS_EXTENSION                  ".fts"

   /* these two are used by the fits_copyheader() function */
#define FITS_CHECK                      0   /* NROW, NCOL must be same */
#define FITS_NOCHECK                    1   /* don't have to be same */

#define NHANDLE 256           /* Max number of FITS files which can be open */

typedef int FITS_HANDLE;

#ifdef PROTO

FITS_HANDLE fits_open(  char * fname,
                        char * mode,
                        int * nrows,
                        int * ncols);
int fits_get_data(      FITS_HANDLE h,
                        int row,
                        int col,
                        int16 * data,
                        int npix);
void fits_put_data(     FITS_HANDLE h,
                        int row,
                        int col, 
                        int16 * data,
                        int npix);
int fits_put_symbol(    FITS_HANDLE h,
                        char * symbol_name,
                        char * contents);
int  fits_get_symbol(   FITS_HANDLE h,                    
                        char * symbol_name,
                        char * contents);
void fits_cut(          FITS_HANDLE h);

void fits_close(        FITS_HANDLE h);


void fits_put_data_fast(FITS_HANDLE h,
                        int16 * data,
                        int nwords);
char *fits_get_headerline(FITS_HANDLE h, int card_number);
int   fits_put_headerline(FITS_HANDLE h, char * header);
void  fits_copyheader(FITS_HANDLE in, FITS_HANDLE out, int checkflag);
void  fits_resetscale(FITS_HANDLE h);

#else		/* PROTO */

FITS_HANDLE fits_open();
int fits_get_data();
void fits_put_data();
int fits_put_symbol();
int  fits_get_symbol();
void fits_cut();

void fits_close();

void fits_put_data_fast();
char *fits_get_headerline();
int   fits_put_headerline();
void  fits_copyheader();
void  fits_resetscale();

#endif		/* PROTO */
