From 24976855d7aaa60618669928803dae3bc2945daf Mon Sep 17 00:00:00 2001 From: tth Date: Fri, 24 Jul 2020 14:23:02 +0200 Subject: [PATCH] no more upside-down --- funcs/fimg-fits.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/funcs/fimg-fits.c b/funcs/fimg-fits.c index c46d92ab..542d9d70 100644 --- a/funcs/fimg-fits.c +++ b/funcs/fimg-fits.c @@ -16,7 +16,7 @@ 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, sz; +int status, idx, k, sz; int bitpix = FLOAT_IMG; long naxis = 2; @@ -44,8 +44,9 @@ if (verbosity) fimg_describe(src, "to be saved as fits"); /* initialize pointers to the start of each row of the image */ for( idx=0; idxR + (idx*naxes[0]); - // fprintf(stderr, " %6d %p\n", idx, array[idx]); + k = naxes[1] - idx - 1; + array[idx] = src->R + (k*naxes[0]); + fprintf(stderr, " %6d %6d %p\n", idx, k, array[idx]); } if ( fits_create_img(fptr, bitpix, naxis, naxes, &status) ) {