/[PAMELA software]/quicklook/dataToXML/OrbitalRate.cpp
ViewVC logotype

Diff of /quicklook/dataToXML/OrbitalRate.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by kusanagi, Tue May 2 14:32:23 2006 UTC revision 1.3 by kusanagi, Tue May 23 13:48:05 2006 UTC
# Line 35  Line 35 
35  #include "TPaletteAxis.h"  #include "TPaletteAxis.h"
36  #include "TROOT.h"  #include "TROOT.h"
37  #include <sys/stat.h>  #include <sys/stat.h>
38    #include <fstream>
39    
40  #define TRUE  1  #define TRUE  1
41  #define FALSE 0  #define FALSE 0
# Line 104  void InitStyle() { Line 105  void InitStyle() {
105    
106  }  }
107    
108  void Rate(TString base, TString outDirectory = "", TString format = "jpg", TString mapFile = ""){  void Rate(TString base, TString outDirectory = "", TString format = "jpg", TString mapFile = "", TString tleFile = ""){
109          TTree                  *tr         = 0;          TTree                  *tr         = 0;
110          pamela::McmdEvent      *mcmdev     = 0;          pamela::McmdEvent      *mcmdev     = 0;
111          pamela::McmdRecord     *mcmdrc     = 0;          pamela::McmdRecord     *mcmdrc     = 0;
# Line 130  void Rate(TString base, TString outDirec Line 131  void Rate(TString base, TString outDirec
131          TString filename = ((TObjString*)base.Tokenize('/')->Last())->GetString();          TString filename = ((TObjString*)base.Tokenize('/')->Last())->GetString();
132          filename = ((TObjString*)filename.Tokenize('.')->First())->GetString();          filename = ((TObjString*)filename.Tokenize('.')->First())->GetString();
133          // Test SGP4          // Test SGP4
134          string str1 = "SGP4 Test";          string str1 = "SGP4 Test";
135          string str2 = "1 25544U 98067A   06117.32388940  .00009459  00000-0  64427-4 0  8131";          string str2 = "1 25544U 98067A   06117.32388940  .00009459  00000-0  64427-4 0  8131";
136          string str3 = "2 25544  51.6388  89.2928 0009043 155.3293 354.6512 15.75673697425143";          string str3 = "2 25544  51.6388  89.2928 0009043 155.3293 354.6512 15.75673697425143";
137            if (tleFile != ""){
138                    fstream fileTle(tleFile.Data(),ios::in);
139                    if (fileTle.is_open()) {
140                            getline (fileTle,str1);
141                            getline (fileTle,str2);
142                            getline (fileTle,str3);
143                    }
144                    fileTle.close();
145            }
146    
147          cTle tle1(str1, str2, str3);          cTle tle1(str1, str2, str3);
148          cOrbit       orbit(tle1);          cOrbit       orbit(tle1);
# Line 226  void Rate(TString base, TString outDirec Line 236  void Rate(TString base, TString outDirec
236          forpal->SetAxisColor(kBlack); //Delete the stat box          forpal->SetAxisColor(kBlack); //Delete the stat box
237          forpal->SetStats(0); //Delete the stat box          forpal->SetStats(0); //Delete the stat box
238          forpal->SetMinimum(0.1);          forpal->SetMinimum(0.1);
239          forpal->SetMaximum(200);          forpal->SetMaximum(15);
240          forpal->SetBinContent(5,1);    // just to initialize the histo          forpal->SetBinContent(5,1);    // just to initialize the histo
241          forpal->SetContour(50);          forpal->SetContour(50);
242          TPaletteAxis *tpp=(TPaletteAxis*)((forpal->GetListOfFunctions())->FindObject("palette"));          TPaletteAxis *tpp=(TPaletteAxis*)((forpal->GetListOfFunctions())->FindObject("palette"));
# Line 280  void Rate(TString base, TString outDirec Line 290  void Rate(TString base, TString outDirec
290  int main(int argc, char* argv[]){  int main(int argc, char* argv[]){
291      TString outDir  = "./";      TString outDir  = "./";
292      TString mapFile = "";      TString mapFile = "";
293        TString tleFile = "";
294      TString format  = "jpg";      TString format  = "jpg";
295            
296   if (argc < 2){   if (argc < 2){
# Line 292  int main(int argc, char* argv[]){ Line 303  int main(int argc, char* argv[]){
303          printf( "Usage: OrbitRate FILE -map mapFile [OPTION] \n");          printf( "Usage: OrbitRate FILE -map mapFile [OPTION] \n");
304          printf( "mapFile have to be a mercator map image [gif|jpg|png] \n");          printf( "mapFile have to be a mercator map image [gif|jpg|png] \n");
305          printf( "\t --help                 Print this help and exit \n");          printf( "\t --help                 Print this help and exit \n");
306            printf( "\t -tleFile[path]         Path where to find the tle infos [default dummyOrbit] \n");
307            printf( "\t\tThe tle file have to satisfy a 3-line structure like (this is the included dummyOrbit)\n ");
308            printf( "\t\t\tGP4 Test\n");
309            printf( "\t\t\t1 25544U 98067A   06117.32388940  .00009459  00000-0  64427-4 0  8131\n");
310            printf( "\t\t\t2 25544  51.6388  89.2928 0009043 155.3293 354.6512 15.75673697425143\n");
311          printf( "\t -outDir[path]          Path where to put the output [default ~/tmp] \n");          printf( "\t -outDir[path]          Path where to put the output [default ~/tmp] \n");
312          printf( "\t -format[jpg|gif|ps]    Format for output files [default 'jpg'] \n");          printf( "\t -format[jpg|gif|ps]    Format for output files [default 'jpg'] \n");
313          exit(1);          exit(1);
# Line 309  int main(int argc, char* argv[]){ Line 325  int main(int argc, char* argv[]){
325          }          }
326      }      }
327    
328       if (!strcmp(argv[i], "-tle")){
329            if (++i >= argc){
330                printf( "-tle needs arguments. \n");
331                printf( "Try '--help' for more information. \n");
332                exit(1);
333            } else {
334                tleFile = argv[i];
335                continue;
336            }
337        }
338    
339      if (!strcmp(argv[i], "-map")){      if (!strcmp(argv[i], "-map")){
340          if (++i >= argc){          if (++i >= argc){
341              printf( "-map needs arguments. \n");              printf( "-map needs arguments. \n");

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.23