no more upside-down

This commit is contained in:
tth 2020-07-24 14:23:02 +02:00
parent 334cffce60
commit 24976855d7

View File

@ -16,7 +16,7 @@ extern int verbosity;
int fimg_save_R_as_fits(FloatImg *src, char *outname, int flags) int fimg_save_R_as_fits(FloatImg *src, char *outname, int flags)
{ {
fitsfile *fptr; /* pointer to the FITS file */ fitsfile *fptr; /* pointer to the FITS file */
int status, idx, sz; int status, idx, k, sz;
int bitpix = FLOAT_IMG; int bitpix = FLOAT_IMG;
long naxis = 2; 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 */ /* initialize pointers to the start of each row of the image */
for( idx=0; idx<naxes[1]; idx++ ) { for( idx=0; idx<naxes[1]; idx++ ) {
/**** MAGIC CODE MUST COME HERE ****/ /**** MAGIC CODE MUST COME HERE ****/
array[idx] = src->R + (idx*naxes[0]); k = naxes[1] - idx - 1;
// fprintf(stderr, " %6d %p\n", idx, array[idx]); 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) ) { if ( fits_create_img(fptr, bitpix, naxis, naxes, &status) ) {