00001 /* 00002 * objectfits.h 00003 * 00004 * Created on: Apr 16, 2010 00005 * Author: Brenda Javornik (e-mail: brendaj (at) cora.nwra.com) 00006 */ 00007 00008 #ifndef OBJECTFITS_H_ 00009 #define OBJECTFITS_H_ 00010 00011 #include <fitsio.h> 00012 #include "FITSParameters.h" 00013 00024 typedef struct { 00025 double *data; 00026 int xDim; 00027 int yDim; 00028 } fits2d; 00029 00036 typedef struct { 00037 double **Real; 00038 double **Imaginary; 00039 int xDim; 00040 int yDim; 00041 int zDim; 00042 } fits3d; 00043 00048 typedef struct { 00049 int x; 00050 int y; 00051 int z; 00052 int t; 00053 } location; 00054 00060 typedef struct { 00061 fitsfile *fptr; 00062 location current; 00063 location max; 00064 int bitpix; 00072 int dimension; 00073 } MultiDimFits; 00074 00078 typedef struct { 00079 int z; 00080 int t; 00081 } WhichPlane; 00082 00083 // The operations on the objectfits datatype 00084 fits2d readfits(char *filename); 00085 int writefits(char *filename, fits3d data); 00086 int writefits2d(char *filename, fits2d data); 00087 int writefits2dWithLambda(char *filename, fits2d data, double lambda); 00088 00089 MultiDimFits openMultiDimFitsRead(char *filename); 00090 void openMultiDimFitsWrite(char *filename, MultiDimFits *fileInfoPtr, FITSParameters headerParameters); 00091 fits2d readNextPlane(MultiDimFits fileInfo, WhichPlane whichPlane); 00092 void writeNextPlane(MultiDimFits fileInfo, WhichPlane whichPlane, fits2d data); 00093 int closeMultiDimFits(MultiDimFits fileInfo); 00094 00095 #endif /* OBJECTFITS_H_ */