diff --git a/funcs/fimg-fits.c b/funcs/fimg-fits.c index 64e46bf..f58b003 100644 --- a/funcs/fimg-fits.c +++ b/funcs/fimg-fits.c @@ -19,12 +19,11 @@ extern int verbosity; int fimg_save_R_as_fits(FloatImg *src, char *outname, int flags) { fitsfile *fptr; /* pointer to the FITS file */ -int status, idx, k, sz; +int status, sz; int bitpix = FLOAT_IMG; long naxis = 2; long naxes[2]; -// XXX float *array[1]; #if DEBUG_LEVEL fprintf(stderr, ">>> %s ( %p '%s' %d )\n", __func__, src, outname, flags); @@ -39,23 +38,8 @@ if (fits_create_file(&fptr, outname, &status)) { } naxes[0] = src->width; naxes[1] = src->height; -// XXX array = calloc(src->height, sizeof(float *)); if (verbosity) fimg_describe(src, "to be saved as FITS"); -/************************************************************ - ***** MAGIC CODE MUST COME HERE ? -array[0] = src->R; -#define REVERSE 1 -for( idx=0; idxR + (k*naxes[0]); - fprintf(stderr, " %6d %6d %p\n", idx, k, array[idx]); - } -**************************************************************/ if ( fits_create_img(fptr, bitpix, naxis, naxes, &status) ) { fits_report_error(stderr, status); @@ -76,3 +60,24 @@ if ( fits_close_file(fptr, &status) ) { return 0; } /* --------------------------------------------------------------------- */ + +/************************************************************ + ***** MAGIC CODE FROM OUTERSPACE ? + + function 'writeimage' from : +https://heasarc.gsfc.nasa.gov/docs/software/fitsio/cexamples/cookbook.c + +float **array; +array = calloc(src->height, sizeof(float *)); +array[0] = src->R; +#define REVERSE 1 +for( idx=0; idxR + (k*naxes[0]); + fprintf(stderr, " %6d %6d %p\n", idx, k, array[idx]); + } +**************************************************************/