Changeset 18258
- Timestamp:
- 06/22/15 15:37:48 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/fact/plots/quality.C
r18199 r18258 365 365 366 366 gErrorIgnoreLevel = save; 367 } 368 369 Int_t PlotSqm(TArrayD **vec, TString fname) 370 { 371 fname += ".SQM_CONTROL_DATA.fits"; 372 373 fits file(fname.Data()); 374 if (!file) 375 { 376 cerr << fname << ": " << gSystem->GetError() << endl; 377 return -2; 378 } 379 380 //cout << fname << endl; 381 382 Double_t time; 383 Float_t mag; // magnitude 384 385 if (!file.SetPtrAddress("Time", &time)) 386 return -1; 387 if (!file.SetPtrAddress("Mag", &mag)) 388 return -1; 389 390 //const int marker_style = kFullDotMedium; 391 const int marker_style = kDot; 392 393 TGraph g1; 394 g1.SetName("SQM"); 395 396 397 bool found_first_time = false; 398 while (file.GetNextRow()) 399 if (Contains(vec, time)) 400 { 401 g1.SetPoint(g1.GetN(), time*24*3600, mag); 402 } 403 404 405 g1.SetMinimum(19.0); 406 g1.SetMaximum(21.5); 407 g1.SetMarkerColor(kBlack); 408 g1.SetMarkerStyle(marker_style); 409 g1.GetXaxis()->SetTimeDisplay(true); 410 g1.GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00 GMT"); 411 g1.GetXaxis()->SetLabelSize(0.12); 412 g1.GetYaxis()->SetLabelSize(0.1); 413 g1.GetYaxis()->SetTitle("SQM [mag]"); 414 g1.GetYaxis()->SetTitleOffset(0.2); 415 g1.GetYaxis()->SetTitleSize(0.1); 416 g1.DrawClone("AP"); 417 418 return 0; 419 } 420 421 Int_t PlotSqmLinear(TArrayD **vec, TString fname) 422 { 423 fname += ".SQM_CONTROL_DATA.fits"; 424 425 fits file(fname.Data()); 426 if (!file) 427 { 428 cerr << fname << ": " << gSystem->GetError() << endl; 429 return -2; 430 } 431 432 //cout << fname << endl; 433 434 Double_t time; 435 Float_t mag; // magnitude 436 437 if (!file.SetPtrAddress("Time", &time)) 438 return -1; 439 if (!file.SetPtrAddress("Mag", &mag)) 440 return -1; 441 442 //const int marker_style = kFullDotMedium; 443 const int marker_style = kDot; 444 445 TGraph g1; 446 g1.SetName("SQM"); 447 448 449 bool found_first_time = false; 450 while (file.GetNextRow()) 451 if (Contains(vec, time)) 452 { 453 Double_t mag_double = 4.4 * pow(10, 20) * pow( 10, mag*(-0.4)); 454 g1.SetPoint(g1.GetN(), time*24*3600, mag_double); 455 } 456 457 458 g1.SetMinimum(1.e12); 459 g1.SetMaximum(5.e12); 460 g1.SetMarkerColor(kBlack); 461 g1.SetMarkerStyle(marker_style); 462 g1.GetXaxis()->SetTimeDisplay(true); 463 g1.GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00 GMT"); 464 g1.GetXaxis()->SetLabelSize(0.12); 465 g1.GetYaxis()->SetLabelSize(0.1); 466 g1.GetYaxis()->SetTitle("SQM lin [phot./(s sr m^2)]"); 467 g1.GetYaxis()->SetTitleOffset(0.2); 468 g1.GetYaxis()->SetTitleSize(0.1); 469 g1.DrawClone("AP"); 470 471 return 0; 367 472 } 368 473 … … 840 945 } 841 946 842 TCanvas *c = new TCanvas("quality", Form("Quality %04d/%02d/%02d", y, m, d), 1280, 1 120);843 c->Divide(1, 7, 1e-5, 1e-5);947 TCanvas *c = new TCanvas("quality", Form("Quality %04d/%02d/%02d", y, m, d), 1280, 1280); 948 c->Divide(1, 8, 1e-5, 1e-5); 844 949 845 950 gROOT->SetSelectedPad(0); … … 897 1002 gPad->SetGrid(); 898 1003 gPad->SetTopMargin(0); 1004 gPad->SetBottomMargin(0); 899 1005 gPad->SetRightMargin(0.001); 900 1006 gPad->SetLeftMargin(0.04); … … 902 1008 cout << PlotHumidity2(runs, fname) << endl; 903 1009 1010 gROOT->SetSelectedPad(0); 1011 c->cd(8); 1012 gPad->SetGrid(); 1013 gPad->SetTopMargin(0); 1014 gPad->SetRightMargin(0.001); 1015 gPad->SetLeftMargin(0.04); 1016 cout << PlotSqm(runs, fname) << endl; 1017 1018 904 1019 c->SaveAs(Form("%s/%04d%02d%02d.png", outpath, y, m, d)); 905 1020
Note:
See TracChangeset
for help on using the changeset viewer.