#include #include #include #include // I will use the fits class by TB for reading the interesting data from the files #include "izstream.h" #define HAVE_ZLIB #include "fits.h" using namespace std; ifstream::pos_type size; char * memblock; int main (int argc, char * argv[]) { if (argc < 3) { cout << "Usage: " << argv[0] << " data-file-name calib-file-name [ouput-file-name]" << endl; cout << "" << endl; } char * data_file_name = argv[1]; char * calib_file_name = argv[2]; char * out_file_name = 0; if (argc == 4) { out_file_name = argv[3]; } else { out_file_name = new char[strlen(data_file_name)+4]; strcpy(out_file_name, data_file_name); strcpy(out_file_name+strlen(data_file_name),".uc"); out_file_name[strlen(data_file_name)+3] = 0; } //========================================================================= // CALIBRATION CONSTANTS //========================================================================= fits * calib =new fits(calib_file_name); calib->PrintKeys(); calib->PrintColumns(); int size_of_offset = 1440*1024; float * offset_mV = new float[size_of_offset]; short * offset = new short[size_of_offset]; calib->SetPtrAddress("BaselineMean",offset_mV, size_of_offset); calib->GetNextRow(); for (int i =0 ; i