/* Writer de table Fits (binaire ou ASCII) */ #include "machdefs.h" #include #include #include "pexceptions.h" #include "fabtwriter.h" /*! \class SOPHYA::FitsABTWriter \ingroup FitsIOServer Class for writing a FITS ASCII or BINARY table \verbatim\ Exemple: FitsABTWriter fbtw("myfits.fits",BINARY_TBL,3); fbtw.SetExtName("MY_OWN_EXTENSION"); fbtw.AddCol("vars",TSHORT,"","km"); // col=0 fbtw.AddCol("vars2",TSHORT,"","km"); // col=1 fbtw.AddCol("varl",TLONG,"","Degre"); // col=2 fbtw.AddCol("varf",TFLOAT,"",""); // col=3 fbtw.AddCol("vard",TDOUBLE,"","arcmin"); // col=4 fbtw.SetDebug(3); for(long i=0;i<1000;i++) { double x = i; fbtw.Write(0,i,1000.*x); // if overflow, managed by cfitsio // Write(int,long,double) is called fbtw.Write(1,i,(short)(1000.*x)); // if overflow, managed by language // Write(int,long,short) is called fbtw.Write(2,i,x); fbtw.Write(3,i,x); fbtw.Write(4,i,x); } cout<<"Number of Overflows when writing: " <0) { extname = (char *) malloc((strlen(ExtName.c_str())+1)*sizeof(char)); strcpy(extname,ExtName.c_str()); } for(int i=0;i