Commit 1db83c27 authored by Johan Richard's avatar Johan Richard
Browse files

Changed keywords from float to double in wfits

parent ee10c4b4
......@@ -38,9 +38,9 @@ int wrf_fits(char *filename,
fitsfile *fptr; /* pointer to the FITS file, defined in fitsio.h */
int status, ii, jj, k;
long fpixel, nelements;
float crval1,crpix1,cdelt1;
float crval2,crpix2,cdelt2;
float bzero=0.,bscale=1.;
double crval1,crpix1,cdelt1;
double crval2,crpix2,cdelt2;
double bzero=0.,bscale=1.;
char cunit[10];
char ctype[10];
char origin[10];
......@@ -94,25 +94,25 @@ int wrf_fits(char *filename,
printerror( status );
/* write another optional keyword to the header */
if ( fits_update_key(fptr, TFLOAT, "BZERO", &bzero, "BZERO", &status) )
if ( fits_update_key(fptr, TDOUBLE, "BZERO", &bzero, "BZERO", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "BSCALE", &bscale, "BSCALE", &status) )
if ( fits_update_key(fptr, TDOUBLE, "BSCALE", &bscale, "BSCALE", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRVAL1", &crval1, "CRVAL1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRVAL1", &crval1, "CRVAL1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRPIX1", &crpix1, "CRPIX1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRPIX1", &crpix1, "CRPIX1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CDELT1", &cdelt1, "CDELT1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CDELT1", &cdelt1, "CDELT1", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CUNIT1", &cunit, "CUNIT1", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CTYPE1", &ctype, "CTYPE1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRVAL2", &crval2, "CRVAL2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRVAL2", &crval2, "CRVAL2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRPIX2", &crpix2, "CRPIX2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRPIX2", &crpix2, "CRPIX2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CDELT2", &cdelt2, "CDELT2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CDELT2", &cdelt2, "CDELT2", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CUNIT2", &cunit, "CUNIT2", &status) )
printerror( status );
......@@ -140,9 +140,9 @@ int wri_fits(char *filename,
fitsfile *fptr; /* pointer to the FITS file, defined in fitsio.h */
int status, ii, jj, k;
long fpixel, nelements;
float crval1,crpix1,cdelt1;
float crval2,crpix2,cdelt2;
float bzero=0.,bscale=1.;
double crval1,crpix1,cdelt1;
double crval2,crpix2,cdelt2;
double bzero=0.,bscale=1.;
char cunit[10];
char ctype[10];
char origin[10];
......@@ -198,25 +198,25 @@ int wri_fits(char *filename,
printerror( status );
/* write another optional keyword to the header */
if ( fits_update_key(fptr, TFLOAT, "BZERO", &bzero, "BZERO", &status) )
if ( fits_update_key(fptr, TDOUBLE, "BZERO", &bzero, "BZERO", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "BSCALE", &bscale, "BSCALE", &status) )
if ( fits_update_key(fptr, TDOUBLE, "BSCALE", &bscale, "BSCALE", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRVAL1", &crval1, "CRVAL1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRVAL1", &crval1, "CRVAL1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRPIX1", &crpix1, "CRPIX1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRPIX1", &crpix1, "CRPIX1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CDELT1", &cdelt1, "CDELT1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CDELT1", &cdelt1, "CDELT1", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CUNIT1", &cunit, "CUNIT1", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CTYPE1", &ctype, "CTYPE1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRVAL2", &crval2, "CRVAL2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRVAL2", &crval2, "CRVAL2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRPIX2", &crpix2, "CRPIX2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRPIX2", &crpix2, "CRPIX2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CDELT2", &cdelt2, "CDELT2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CDELT2", &cdelt2, "CDELT2", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CUNIT2", &cunit, "CUNIT2", &status) )
printerror( status );
......@@ -365,9 +365,9 @@ int wri_fits_abs(char *filename,
fitsfile *fptr; /* pointer to the FITS file, defined in fitsio.h */
int status, ii, jj, k;
long fpixel, nelements;
float crval1,crpix1,cdelt1;
float crval2,crpix2,cdelt2;
float bzero=0.,bscale=1.,equinox;
double crval1,crpix1,cdelt1;
double crval2,crpix2,cdelt2;
double bzero=0.,bscale=1.,equinox;
char cunit[10];
char system[10];
char ratype[10];
......@@ -427,31 +427,31 @@ int wri_fits_abs(char *filename,
printerror( status );
/* write another optional keyword to the header */
if ( fits_update_key(fptr, TFLOAT, "BZERO", &bzero, "BZERO", &status) )
if ( fits_update_key(fptr, TDOUBLE, "BZERO", &bzero, "BZERO", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "BSCALE", &bscale, "BSCALE", &status) )
if ( fits_update_key(fptr, TDOUBLE, "BSCALE", &bscale, "BSCALE", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "EQUINOX", &equinox, "EQUINOX", &status) )
if ( fits_update_key(fptr, TDOUBLE, "EQUINOX", &equinox, "EQUINOX", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "RADECSYS", &system, "RADECSYS", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CTYPE1", &ratype, "CTYPE1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRVAL1", &crval1, "CRVAL1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRVAL1", &crval1, "CRVAL1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRPIX1", &crpix1, "CRPIX1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRPIX1", &crpix1, "CRPIX1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CDELT1", &cdelt1, "CDELT1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CDELT1", &cdelt1, "CDELT1", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CUNIT1", &cunit, "CUNIT1", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CTYPE2", &dectype, "CTYPE2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRVAL2", &crval2, "CRVAL2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRVAL2", &crval2, "CRVAL2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRPIX2", &crpix2, "CRPIX2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRPIX2", &crpix2, "CRPIX2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CDELT2", &cdelt2, "CDELT2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CDELT2", &cdelt2, "CDELT2", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CUNIT2", &cunit, "CUNIT2", &status) )
printerror( status );
......@@ -472,10 +472,10 @@ int wrf_cube_fits(char *filename, double ***cube, int nx,int ny, int nz,
fitsfile *fptr; /* pointer to the FITS file, defined in fitsio.h */
int status, ii, jj, kk, k;
long fpixel, nelements;
float crval1,crpix1,cdelt1;
float crval2,crpix2,cdelt2;
float crval3,crpix3,cdelt3;
float bzero=0.,bscale=1.;
double crval1,crpix1,cdelt1;
double crval2,crpix2,cdelt2;
double crval3,crpix3,cdelt3;
double bzero=0.,bscale=1.;
char cunit[10];
char cunitw[10];
char ctype[10];
......@@ -535,35 +535,35 @@ int wrf_cube_fits(char *filename, double ***cube, int nx,int ny, int nz,
printerror( status );
/* write another optional keyword to the header */
if ( fits_update_key(fptr, TFLOAT, "BZERO", &bzero, "BZERO", &status) )
if ( fits_update_key(fptr, TDOUBLE, "BZERO", &bzero, "BZERO", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "BSCALE", &bscale, "BSCALE", &status) )
if ( fits_update_key(fptr, TDOUBLE, "BSCALE", &bscale, "BSCALE", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRVAL1", &crval1, "CRVAL1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRVAL1", &crval1, "CRVAL1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRPIX1", &crpix1, "CRPIX1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRPIX1", &crpix1, "CRPIX1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CDELT1", &cdelt1, "CDELT1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CDELT1", &cdelt1, "CDELT1", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CUNIT1", &cunit, "CUNIT1", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CTYPE1", &ctype, "CTYPE1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRVAL2", &crval2, "CRVAL2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRVAL2", &crval2, "CRVAL2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRPIX2", &crpix2, "CRPIX2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRPIX2", &crpix2, "CRPIX2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CDELT2", &cdelt2, "CDELT2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CDELT2", &cdelt2, "CDELT2", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CUNIT2", &cunit, "CUNIT2", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CTYPE2", &ctype, "CTYPE2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRVAL3", &crval3, "CRVAL3", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRVAL3", &crval3, "CRVAL3", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRPIX3", &crpix3, "CRPIX3", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRPIX3", &crpix3, "CRPIX3", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CDELT3", &cdelt3, "CDELT3", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CDELT3", &cdelt3, "CDELT3", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CUNIT3", &cunitw, "CUNIT3", &status) )
printerror( status );
......@@ -586,10 +586,10 @@ int wri_cube_fits(char *filename, int ***cube, int nx,int ny, int nz,
fitsfile *fptr; /* pointer to the FITS file, defined in fitsio.h */
int status, ii, jj, kk, k;
long fpixel, nelements;
float crval1,crpix1,cdelt1;
float crval2,crpix2,cdelt2;
float crval3,crpix3,cdelt3;
float bzero=0.,bscale=1.;
double crval1,crpix1,cdelt1;
double crval2,crpix2,cdelt2;
double crval3,crpix3,cdelt3;
double bzero=0.,bscale=1.;
char cunit[10];
char cunitw[10];
char ctype[10];
......@@ -649,35 +649,35 @@ int wri_cube_fits(char *filename, int ***cube, int nx,int ny, int nz,
printerror( status );
/* write another optional keyword to the header */
if ( fits_update_key(fptr, TFLOAT, "BZERO", &bzero, "BZERO", &status) )
if ( fits_update_key(fptr, TDOUBLE, "BZERO", &bzero, "BZERO", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "BSCALE", &bscale, "BSCALE", &status) )
if ( fits_update_key(fptr, TDOUBLE, "BSCALE", &bscale, "BSCALE", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRVAL1", &crval1, "CRVAL1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRVAL1", &crval1, "CRVAL1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRPIX1", &crpix1, "CRPIX1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRPIX1", &crpix1, "CRPIX1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CDELT1", &cdelt1, "CDELT1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CDELT1", &cdelt1, "CDELT1", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CUNIT1", &cunit, "CUNIT1", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CTYPE1", &ctype, "CTYPE1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRVAL2", &crval2, "CRVAL2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRVAL2", &crval2, "CRVAL2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRPIX2", &crpix2, "CRPIX2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRPIX2", &crpix2, "CRPIX2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CDELT2", &cdelt2, "CDELT2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CDELT2", &cdelt2, "CDELT2", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CUNIT2", &cunit, "CUNIT2", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CTYPE2", &ctype, "CTYPE2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRVAL3", &crval3, "CRVAL3", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRVAL3", &crval3, "CRVAL3", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRPIX3", &crpix3, "CRPIX3", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRPIX3", &crpix3, "CRPIX3", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CDELT3", &cdelt3, "CDELT3", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CDELT3", &cdelt3, "CDELT3", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CUNIT3", &cunitw, "CUNIT3", &status) )
printerror( status );
......@@ -700,10 +700,10 @@ int wrf_cube_fits_abs(char *filename, double ***cube, int nx,int ny, int nz,
fitsfile *fptr; /* pointer to the FITS file, defined in fitsio.h */
int status, ii, jj, kk, k;
long fpixel, nelements;
float crval1,crpix1,cdelt1;
float crval2,crpix2,cdelt2;
float crval3,crpix3,cdelt3;
float bzero=0.,bscale=1., equinox;
double crval1,crpix1,cdelt1;
double crval2,crpix2,cdelt2;
double crval3,crpix3,cdelt3;
double bzero=0.,bscale=1., equinox;
char system[10];
char cunit[10];
char cunitw[10];
......@@ -769,35 +769,35 @@ int wrf_cube_fits_abs(char *filename, double ***cube, int nx,int ny, int nz,
printerror( status );
/* write another optional keyword to the header */
if ( fits_update_key(fptr, TFLOAT, "BZERO", &bzero, "BZERO", &status) )
if ( fits_update_key(fptr, TDOUBLE, "BZERO", &bzero, "BZERO", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "BSCALE", &bscale, "BSCALE", &status) )
if ( fits_update_key(fptr, TDOUBLE, "BSCALE", &bscale, "BSCALE", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRVAL1", &crval1, "CRVAL1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRVAL1", &crval1, "CRVAL1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRPIX1", &crpix1, "CRPIX1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRPIX1", &crpix1, "CRPIX1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CDELT1", &cdelt1, "CDELT1", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CDELT1", &cdelt1, "CDELT1", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CUNIT1", &cunit, "CUNIT1", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CTYPE1", ratype, "CTYPE1", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRVAL2", &crval2, "CRVAL2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRVAL2", &crval2, "CRVAL2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRPIX2", &crpix2, "CRPIX2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRPIX2", &crpix2, "CRPIX2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CDELT2", &cdelt2, "CDELT2", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CDELT2", &cdelt2, "CDELT2", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CUNIT2", &cunit, "CUNIT2", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CTYPE2", dectype, "CTYPE2", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRVAL3", &crval3, "CRVAL3", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRVAL3", &crval3, "CRVAL3", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CRPIX3", &crpix3, "CRPIX3", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CRPIX3", &crpix3, "CRPIX3", &status) )
printerror( status );
if ( fits_update_key(fptr, TFLOAT, "CDELT3", &cdelt3, "CDELT3", &status) )
if ( fits_update_key(fptr, TDOUBLE, "CDELT3", &cdelt3, "CDELT3", &status) )
printerror( status );
if ( fits_update_key(fptr, TSTRING, "CUNIT3", &cunitw, "CUNIT3", &status) )
printerror( status );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment