--- quicklook/dataToXML/OrbitalRate.cpp 2006/05/02 14:32:23 1.2 +++ quicklook/dataToXML/OrbitalRate.cpp 2006/05/23 13:48:05 1.3 @@ -35,6 +35,7 @@ #include "TPaletteAxis.h" #include "TROOT.h" #include +#include #define TRUE 1 #define FALSE 0 @@ -104,7 +105,7 @@ } -void Rate(TString base, TString outDirectory = "", TString format = "jpg", TString mapFile = ""){ +void Rate(TString base, TString outDirectory = "", TString format = "jpg", TString mapFile = "", TString tleFile = ""){ TTree *tr = 0; pamela::McmdEvent *mcmdev = 0; pamela::McmdRecord *mcmdrc = 0; @@ -130,9 +131,18 @@ TString filename = ((TObjString*)base.Tokenize('/')->Last())->GetString(); filename = ((TObjString*)filename.Tokenize('.')->First())->GetString(); // Test SGP4 - string str1 = "SGP4 Test"; + string str1 = "SGP4 Test"; string str2 = "1 25544U 98067A 06117.32388940 .00009459 00000-0 64427-4 0 8131"; string str3 = "2 25544 51.6388 89.2928 0009043 155.3293 354.6512 15.75673697425143"; + if (tleFile != ""){ + fstream fileTle(tleFile.Data(),ios::in); + if (fileTle.is_open()) { + getline (fileTle,str1); + getline (fileTle,str2); + getline (fileTle,str3); + } + fileTle.close(); + } cTle tle1(str1, str2, str3); cOrbit orbit(tle1); @@ -226,7 +236,7 @@ forpal->SetAxisColor(kBlack); //Delete the stat box forpal->SetStats(0); //Delete the stat box forpal->SetMinimum(0.1); - forpal->SetMaximum(200); + forpal->SetMaximum(15); forpal->SetBinContent(5,1); // just to initialize the histo forpal->SetContour(50); TPaletteAxis *tpp=(TPaletteAxis*)((forpal->GetListOfFunctions())->FindObject("palette")); @@ -280,6 +290,7 @@ int main(int argc, char* argv[]){ TString outDir = "./"; TString mapFile = ""; + TString tleFile = ""; TString format = "jpg"; if (argc < 2){ @@ -292,6 +303,11 @@ printf( "Usage: OrbitRate FILE -map mapFile [OPTION] \n"); printf( "mapFile have to be a mercator map image [gif|jpg|png] \n"); printf( "\t --help Print this help and exit \n"); + printf( "\t -tleFile[path] Path where to find the tle infos [default dummyOrbit] \n"); + printf( "\t\tThe tle file have to satisfy a 3-line structure like (this is the included dummyOrbit)\n "); + printf( "\t\t\tGP4 Test\n"); + printf( "\t\t\t1 25544U 98067A 06117.32388940 .00009459 00000-0 64427-4 0 8131\n"); + printf( "\t\t\t2 25544 51.6388 89.2928 0009043 155.3293 354.6512 15.75673697425143\n"); printf( "\t -outDir[path] Path where to put the output [default ~/tmp] \n"); printf( "\t -format[jpg|gif|ps] Format for output files [default 'jpg'] \n"); exit(1); @@ -309,6 +325,17 @@ } } + if (!strcmp(argv[i], "-tle")){ + if (++i >= argc){ + printf( "-tle needs arguments. \n"); + printf( "Try '--help' for more information. \n"); + exit(1); + } else { + tleFile = argv[i]; + continue; + } + } + if (!strcmp(argv[i], "-map")){ if (++i >= argc){ printf( "-map needs arguments. \n");