- Timestamp:
- 06/10/15 15:35:50 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/fact/plots/quality.C
r17956 r18195 340 340 } 341 341 342 Int_t PlotHumidity(TArrayD **vec, TString fname) 343 { 344 fname += ".FSC_CONTROL_HUMIDITY.fits"; 345 346 fits file(fname.Data()); 347 if (!file) 348 { 349 cerr << fname << ": " << gSystem->GetError() << endl; 350 return -2; 351 } 352 353 //cout << fname << endl; 354 355 Double_t time; 356 Float_t H[4]; 357 358 if (!file.SetPtrAddress("Time", &time)) 359 return -1; 360 if (!file.SetPtrAddress("H", H)) 361 return -1; 362 363 //const int marker_style = kFullDotMedium; 364 const int marker_style = kDot; 365 366 TGraph g1; 367 TGraph g2; 368 TGraph g3; 369 TGraph g4; 370 //TGraph g5; 371 g1.SetName("H0"); 372 g2.SetName("H1"); 373 g3.SetName("H2"); 374 g4.SetName("H3"); 375 //g5.SetName("PFmini"); 376 377 378 Double_t first_time, last_time; 379 bool found_first_time = false; 380 while (file.GetNextRow()) 381 if (Contains(vec, time)) 382 { 383 if (!found_first_time){ 384 first_time = time*24*3600; 385 found_first_time = true; 386 } 387 g1.SetPoint(g1.GetN(), time*24*3600, H[0]); 388 g2.SetPoint(g2.GetN(), time*24*3600, H[1]); 389 g3.SetPoint(g3.GetN(), time*24*3600, H[2]); 390 g4.SetPoint(g4.GetN(), time*24*3600, H[3]); 391 //g5.SetPoint(g5.GetN(), time*24*3600, I[319]); 392 last_time = time*24*3600; 393 } 394 395 396 g1.SetMinimum(0); 397 g1.SetMaximum(100); 398 g1.SetMarkerColor(kAzure); 399 g1.SetMarkerStyle(marker_style); 400 g1.GetXaxis()->SetTimeDisplay(true); 401 g1.GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00 GMT"); 402 g1.GetXaxis()->SetLabelSize(0.12); 403 g1.GetYaxis()->SetLabelSize(0.1); 404 g1.GetYaxis()->SetTitle("HUMITIDY"); 405 g1.GetYaxis()->SetTitleOffset(0.2); 406 g1.GetYaxis()->SetTitleSize(0.1); 407 g1.DrawClone("AP"); 408 409 g2.SetMarkerColor(kAzure+1); 410 g2.SetMarkerStyle(marker_style); 411 g2.DrawClone("P"); 412 413 g3.SetMarkerColor(kAzure+3); 414 g3.SetMarkerStyle(marker_style); 415 g3.DrawClone("P"); 416 417 g4.SetMarkerColor(kAzure+6); 418 g4.SetMarkerStyle(marker_style); 419 g4.DrawClone("P"); 420 421 //g5.SetMarkerColor(kAzure+1); 422 //g5.SetMarkerStyle(kFullDotMedium); 423 //g5.DrawClone("P"); 424 425 g1.DrawClone("P"); 426 427 TLine l1(first_time-600, 40, last_time+600, 40); 428 l1.SetLineColor(kOrange); 429 l1.DrawClone(); 430 TText t1(first_time-600, 41, "Note in logbook"); 431 t1.SetTextSize(0.1); 432 t1.DrawClone(); 433 434 435 TLine l2(first_time-600, 55, last_time+600, 55); 436 l2.SetLineColor(kRed); 437 l2.DrawClone(); 438 TText t2(first_time-600, 56, "Mail to fact-online."); 439 t2.SetTextSize(0.1); 440 t2.DrawClone(); 441 442 443 return 0; 444 } 445 446 Int_t PlotHumidity2(TArrayD **vec, TString fname) 447 { 448 fname += ".PFMINI_CONTROL_DATA.fits"; 449 450 fits file(fname.Data()); 451 if (!file) 452 { 453 cerr << fname << ": " << gSystem->GetError() << endl; 454 return -2; 455 } 456 457 //cout << fname << endl; 458 459 Double_t time; 460 Float_t H; 461 462 if (!file.SetPtrAddress("Time", &time)) 463 return -1; 464 if (!file.SetPtrAddress("Humidity", &H)) 465 return -1; 466 467 const int marker_style = kFullDotMedium; 468 //const int marker_style = kDot; 469 470 TGraph g1; 471 g1.SetName("PFmini"); 472 473 474 while (file.GetNextRow()) 475 if (Contains(vec, time)) 476 { 477 g1.SetPoint(g1.GetN(), time*24*3600, H); 478 } 479 480 g1.SetMarkerStyle(marker_style); 481 g1.SetMarkerColor(kGreen); 482 g1.DrawClone("P"); 483 return 0; 484 } 342 485 343 486 Int_t PlotPointing(TArrayD **vec, TString fname) … … 420 563 g.GetXaxis()->SetLabelSize(0.1); 421 564 g.GetYaxis()->SetLabelSize(0.1); 422 g.GetYaxis()->SetTitle("TEMP ");565 g.GetYaxis()->SetTitle("TEMPERATURE"); 423 566 g.GetYaxis()->SetTitleOffset(0.2); 424 567 g.GetYaxis()->SetTitleSize(0.1); … … 542 685 if (!file.SetPtrAddress("Time", &time)) 543 686 return -1; 544 if (!file.SetPtrAddress("Data1", temp) && 545 !file.SetPtrAddress("temp", temp)) 687 // if (!file.SetPtrAddress("Data1", temp) && 688 // !file.SetPtrAddress("temp", temp)) 689 if (!file.SetPtrAddress("temp", temp)) 546 690 return -1; 547 691 … … 669 813 } 670 814 671 TCanvas *c = new TCanvas("quality", Form("Quality %04d/%02d/%02d", y, m, d), 1280, 960);672 c->Divide(1, 6, 1e-5, 1e-5);815 TCanvas *c = new TCanvas("quality", Form("Quality %04d/%02d/%02d", y, m, d), 1280, 1120); 816 c->Divide(1, 7, 1e-5, 1e-5); 673 817 674 818 gROOT->SetSelectedPad(0); … … 721 865 cout << PlotTemperature4(runs, fname) << endl; 722 866 867 gROOT->SetSelectedPad(0); 868 c->cd(7); 869 gPad->SetGrid(); 870 gPad->SetTopMargin(0); 871 gPad->SetRightMargin(0.001); 872 gPad->SetLeftMargin(0.04); 873 cout << PlotHumidity(runs, fname) << endl; 874 cout << PlotHumidity2(runs, fname) << endl; 875 723 876 c->SaveAs(Form("%s/%04d%02d%02d.png", outpath, y, m, d)); 724 877
Note:
See TracChangeset
for help on using the changeset viewer.