Browse Source

no more upside-down

master
tth 2 years ago
parent
commit
24976855d7
  1. 7
      funcs/fimg-fits.c

7
funcs/fimg-fits.c

@ -16,7 +16,7 @@ extern int verbosity; @@ -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"); @@ -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; idx<naxes[1]; idx++ ) {
/**** MAGIC CODE MUST COME HERE ****/
array[idx] = src->R + (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) ) {

Loading…
Cancel
Save