Compare commits

..

No commits in common. "c6dee909e8a50cd28d2e514ab6f5ca90eb7afbc9" and "d8bb6f4ec6b76660f7ae16b8a1be523aae4df187" have entirely different histories.

3 changed files with 9 additions and 15 deletions

View File

@ -3,7 +3,7 @@
* ugly code from tTh * ugly code from tTh
*/ */
#define FIMG_VERSION 104 #define FIMG_VERSION 103
/* /*
* in memory descriptor * in memory descriptor
@ -139,8 +139,6 @@ int fimg_load_from_dump(char *fname, FloatImg *where);
int fimg_create_from_dump(char *fname, FloatImg *head); int fimg_create_from_dump(char *fname, FloatImg *head);
int fimg_save_R_as_fits(FloatImg *src, char *outname, int flags); int fimg_save_R_as_fits(FloatImg *src, char *outname, int flags);
int fimg_save_G_as_fits(FloatImg *src, char *outname, int flags);
int fimg_save_B_as_fits(FloatImg *src, char *outname, int flags);
/* mathematics operations */ /* mathematics operations */

View File

@ -1,9 +1,6 @@
/* /*
* FLOATIMG * FLOATIMG
* import/export to/from FITS files * import/export to/from FITS files
https://heasarc.gsfc.nasa.gov/docs/software/fitsio/c/c_user/node1.html
*/ */
#include <stdio.h> #include <stdio.h>
@ -24,7 +21,7 @@ int bitpix = FLOAT_IMG;
long naxis = 2; long naxis = 2;
long naxes[2]; long naxes[2];
// XXX float *array[1]; float **array;
#if DEBUG_LEVEL #if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p '%s' %d )\n", __func__, src, outname, flags); fprintf(stderr, ">>> %s ( %p '%s' %d )\n", __func__, src, outname, flags);
@ -39,14 +36,14 @@ if (fits_create_file(&fptr, outname, &status)) {
} }
naxes[0] = src->width; naxes[1] = src->height; naxes[0] = src->width; naxes[1] = src->height;
// XXX array = calloc(src->height, sizeof(float *)); array = calloc(src->height, sizeof(float *));
if (verbosity) fimg_describe(src, "to be saved as FITS"); if (verbosity) fimg_describe(src, "to be saved as FITS");
/************************************************************
***** MAGIC CODE MUST COME HERE ?
array[0] = src->R;
#define REVERSE 1 #define REVERSE 1
/* initialize pointers to the start of each row of the image */
array[0] = src->R;
for( idx=0; idx<naxes[1]; idx++ ) { for( idx=0; idx<naxes[1]; idx++ ) {
/**** MAGIC CODE MUST COME HERE ****/
#if REVERSE #if REVERSE
k = naxes[1] - idx - 1; k = naxes[1] - idx - 1;
#else #else
@ -55,7 +52,6 @@ for( idx=0; idx<naxes[1]; idx++ ) {
array[idx] = src->R + (k*naxes[0]); array[idx] = src->R + (k*naxes[0]);
fprintf(stderr, " %6d %6d %p\n", idx, k, array[idx]); 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) ) {
fits_report_error(stderr, status); fits_report_error(stderr, status);
@ -63,7 +59,7 @@ if ( fits_create_img(fptr, bitpix, naxis, naxes, &status) ) {
} }
sz = naxes[0]*naxes[1]; sz = naxes[0]*naxes[1];
if ( fits_write_img(fptr, TFLOAT, 1, sz, src->R, &status) ) { if ( fits_write_img(fptr, TFLOAT, 1, sz, array[0], &status) ) {
fits_report_error(stderr, status); fits_report_error(stderr, status);
return -10; return -10;
} }

View File

@ -163,7 +163,7 @@ if (verbosity > 1) {
fprintf(stderr, "grabing %d picz, ", nbre_capt); fprintf(stderr, "grabing %d picz, ", nbre_capt);
fprintf(stderr, "period is %.3f milliseconds\n", period/1e3); fprintf(stderr, "period is %.3f milliseconds\n", period/1e3);
fprintf(stderr, "framesize is %dx%d\n", width, height); fprintf(stderr, "framesize is %dx%d\n", width, height);
// fprintf(stderr, "destdir is '%s'\n", dest_dir); fprintf(stderr, "destdir is '%s'\n", dest_dir);
if (upscaling) fprintf(stderr, "upscaling is on\n"); if (upscaling) fprintf(stderr, "upscaling is on\n");
} }