
/**************************************************************************
 *                                                                        *
 * Copyright (c) 1989 Michael Richmond, Richard Treffers and              *
 *                    The Regents of the University of California         *
 *                                                                        *
 *                    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 !!!
*/

#define FITS_FAIL                       0
#define FITS_PASS                       1                       
#define FITS_EXTENSION                  ".fts"
#define NHANDLE 16            /* Max number of FITS files which can be open */

typedef int FITS_HANDLE;

#ifdef PROTO

FITS_HANDLE fits_open(  char * fname,
                        char * mode,
                        unsigned * nrows,
                        unsigned * ncols);
int fits_get_data(      FITS_HANDLE h,
                        unsigned row,
                        unsigned col,
                        int16 * data,
                        unsigned npix);
void fits_put_data(     FITS_HANDLE h,
                        unsigned row,
                        unsigned col, 
                        int16 * data,
                        unsigned 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);

#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();

#endif		/* PROTO */
