Changeset 8185 for trunk/MagicSoft/Mars/datacenter
- Timestamp:
- 11/01/06 08:29:46 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/macros
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/plotdb.C
r8169 r8185 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1. 29 2006-10-27 13:36:18tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.30 2006-11-01 08:29:45 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 70 70 #include <TStyle.h> 71 71 #include <TCanvas.h> 72 #include <TPRegexp.h> 72 73 #include <TSQLRow.h> 73 74 #include <TSQLResult.h> … … 77 78 #include "MAstro.h" 78 79 #include "MDataSet.h" 79 #include "MSQL Server.h"80 #include "MSQLMagic.h" 80 81 #include "MStatusDisplay.h" 81 82 … … 86 87 { 87 88 kNone, 88 kGroupByDay, 89 kGroupByPrimary, 90 kGroupByHour, 91 kGroupByNight, 89 92 kGroupByWeek, 90 93 kGroupByMonth, … … 92 95 }; 93 96 private: 94 MSQL Server&fServer;97 MSQLMagic &fServer; 95 98 96 99 MDataSet *fDataSet; 100 101 TString fPrimary; 102 TString fSecondary; 97 103 98 104 TString fRequestFrom; … … 146 152 const char *zd = (*row)[1]; 147 153 const char *val = (*row)[2]; 148 const char *snum = (*row)[3];154 const char *snum = res.GetFieldCount()>3 ? (*row)[3] : 0; 149 155 const char *verr = res.GetFieldCount()>4 ? (*row)[5] : 0; 150 if (!date || !val || !zd || !snum)156 if (!date || !val || !zd) 151 157 continue; 152 158 … … 162 168 last = TMath::Nint(TMath::Ceil(t.GetMjd())); 163 169 164 UInt_t seq = atoi(snum);170 UInt_t seq = snum ? atoi(snum) : 0; 165 171 166 172 Float_t value = atof(val); … … 207 213 208 214 cerr << setprecision(4) << setw(10) << title << ": "; 215 if (gt.GetN()==0) 216 { 217 cerr << " <empty>" << endl; 218 return; 219 } 209 220 cerr << setw(8) << gt.GetMean(2) << "+-" << setw(8) << gt.GetRMS(2) << " "; 210 221 if (gt0.GetN()>0 || gt1.GetN()>0) … … 314 325 315 326 public: 316 MPlot(MSQL Server&server) : fServer(server), fDataSet(NULL),327 MPlot(MSQLMagic &server) : fServer(server), fDataSet(NULL), 317 328 fRequestPeriod(-1), fPlotMin(0), fPlotMax(-1), fHistMin(0), fHistMax(-1), fGroupBy(kNone) 318 329 { … … 337 348 void SetRequestRange(const char *from="", const char *to="") { fRequestFrom = from; fRequestTo = to; } 338 349 void SetRequestPeriod(Int_t n=-1) { fRequestPeriod = n; } 350 void SetCondition(const char *cond="") { fCondition = cond; } 339 351 void SetDescription(const char *d, const char *t=0) { fDescription = d; fNameTab = t; } 340 void SetCondition(const char *cond="") { fCondition = cond; }341 352 void SetGroupBy(GroupBy_t b=kGroupByWeek) { fGroupBy=b; } 353 void SetPrimary(const char *ts) { fPrimary=ts; } 354 void SetSecondary(const char *ts) { fSecondary=ts; } 342 355 343 356 Bool_t Plot(const char *value, Float_t min=0, Float_t max=-1, Float_t resolution=0) 344 357 { 345 TString named = "Sequences.fRunStart";346 TString named2 = "(Sequences.fZenithDistanceMin+Sequences.fZenithDistanceMax)/2";358 TString named = fPrimary; 359 TString named2 = fSecondary; 347 360 TString namev = value; 348 361 TString join = "fSequenceFirst"; … … 354 367 TString valued = named(named.First('.')+1, named.Length()); 355 368 356 TString query; 369 TString query="SELECT "; 370 query += valued; 357 371 if (fGroupBy==kNone) 358 query = Form("select %s, %s, %s, Sequences.fSequenceFirst ", valued.Data(), named2.Data(), valuev.Data()); 372 { 373 query += ", "; 374 query += fSecondary; 375 query += ", "; 376 query += value; 377 query += ", "; 378 query += " Sequences.fSequenceFirst "; 379 } 359 380 else 360 query = Form("select %s, AVG(%s), AVG(%s), Sequences.fSequenceFirst, STD(%s), STD(%s) ", valued.Data(), named2.Data(), valuev.Data(), named2.Data(), valuev.Data()); 381 { 382 query += ", AVG("; 383 query += fSecondary; 384 query += "), AVG("; 385 query += value; 386 query += "), Sequences.fSequenceFirst, STD("; 387 query += fSecondary; 388 query += "), STD("; 389 query += value; 390 query += ") "; 391 } 361 392 362 393 switch (fGroupBy) 363 394 { 364 395 case kNone: 396 case kGroupByPrimary: 365 397 break; 366 case kGroupByDay: 367 query += Form(", date_format(adddate(%s,Interval 12 hour), '%%Y-%%m-%%d') as %s ", named.Data(), valued.Data()); 398 case kGroupByHour: 399 query += Form(", DATE_FORMAT(%s, '%%Y-%%m-%%d %%H') AS %s ", named.Data(), valued.Data()); 400 break; 401 case kGroupByNight: 402 query += Form(", DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-%%d') AS %s ", named.Data(), valued.Data()); 368 403 break; 369 404 case kGroupByWeek: 370 query += Form(", date_format(adddate(%s,Interval 12 hour), '%%x%%v') as%s ", named.Data(), valued.Data());405 query += Form(", DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%x%%v') AS %s ", named.Data(), valued.Data()); 371 406 break; 372 407 case kGroupByMonth: 373 query += Form(", date_format(adddate(%s,Interval 12 hour), '%%Y-%%m') as%s ", named.Data(), valued.Data());408 query += Form(", DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m') AS %s ", named.Data(), valued.Data()); 374 409 break; 375 410 case kGroupByYear: 376 query += Form(", date_format(adddate(%s,Interval 12 hour), '%%Y') as%s ", named.Data(), valued.Data());411 query += Form(", DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y') AS %s ", named.Data(), valued.Data()); 377 412 break; 378 413 } 379 414 380 query += Form("from %s left join %s ", tabled.Data(), tablev.Data()); 381 query += Form("on %s.%s=%s.%s ", tabled.Data(), join.Data(), tablev.Data(), join.Data()); 415 query += Form("FROM %s ", tabled.Data()); 382 416 383 417 const Bool_t interval = !fRequestFrom.IsNull() && !fRequestTo.IsNull(); 384 418 419 TString where(fCondition); 385 420 if (!fDataSet && !interval && tablev=="Star") 386 421 { 387 if (!query.Contains("Star.fSequenceFirst")) 388 query += "left join Star on Sequences.fSequenceFirst=Star.fSequenceFirst "; 389 // This is from a plot PSF/MuonNumber 390 query += "where Star.fMuonNumber>300 "; 422 if (!where.IsNull()) 423 where += " AND "; 424 where += "Star.fMuonNumber>300 "; 391 425 } 392 426 393 427 if (interval) 394 428 { 395 query += query.Contains(" where ") ? "and " : "where "; 396 query += Form("fRunStart between '%s' and '%s' ", 397 fRequestFrom.Data(), fRequestTo.Data()); 429 if (!where.IsNull()) 430 where += " AND "; 431 where += Form("%s BETWEEN '%s' AND '%s' ", 432 fPrimary.Data(), fRequestFrom.Data(), fRequestTo.Data()); 433 } 434 435 // ------------------------------ 436 437 query += fServer.GetJoins(tabled, query+" "+where); 438 439 if (!where.IsNull()) 440 { 441 query += "WHERE "; 442 query += where; 398 443 } 399 444 400 445 if (fGroupBy!=kNone) 401 446 { 402 query += Form(" 447 query += Form("GROUP BY %s ", valued.Data()); 403 448 //query += Form(" HAVING COUNT(%s)=(COUNT(*)+1)/2 ", valuev.Data()); 404 449 } 405 406 query += "order by fRunStart"; 450 query += Form("ORDER BY %s ", fPrimary.Data()); 451 452 453 // ------------------------------ 407 454 408 455 TSQLResult *res = fServer.Query(query); … … 427 474 { 428 475 //plot.SetGroupBy(MPlot::kGroupByWeek); 476 477 plot.SetPrimary("Sequences.fRunStart"); 478 plot.SetSecondary("(Sequences.fZenithDistanceMin+Sequences.fZenithDistanceMax)/2"); 429 479 430 480 //inner camera … … 457 507 plot.SetDescription("Hi-/Lo-Gain ratio;", "HiLoRatio"); 458 508 plot.Plot("Calibration.fHiLoGainRatioMed", 10, 12.5, 0.05); 509 510 //plot.SetDescription("Pulse Variance;", "PulVar"); 511 //plot.Plot("Calibration.fPulsePosVar", 0, 0.03, 0.001); 459 512 460 513 //from star*.root … … 522 575 TEnv env("sql.rc"); 523 576 524 MSQL Serverserv(env);577 MSQLMagic serv(env); 525 578 if (!serv.IsConnected()) 526 579 { … … 554 607 TEnv env("sql.rc"); 555 608 556 MSQL Serverserv(env);609 MSQLMagic serv(env); 557 610 if (!serv.IsConnected()) 558 611 { … … 586 639 TEnv env("sql.rc"); 587 640 588 MSQL Serverserv(env);641 MSQLMagic serv(env); 589 642 if (!serv.IsConnected()) 590 643 { -
trunk/MagicSoft/Mars/datacenter/macros/plotoptical.C
r8140 r8185 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1. 2 2006-10-20 18:26:00tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1.3 2006-11-01 08:29:45 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 69 69 #include <TFrame.h> 70 70 #include <TStyle.h> 71 #include <TGraph.h>72 71 #include <TCanvas.h> 72 #include <TPRegexp.h> 73 73 #include <TSQLRow.h> 74 74 #include <TSQLResult.h> 75 #include <TGraphErrors.h> 75 76 76 77 #include "MTime.h" … … 82 83 class MPlot : public MParContainer 83 84 { 85 public: 86 enum GroupBy_t 87 { 88 kNone, 89 kGroupByPrimary, 90 kGroupByHour, 91 kGroupByNight, 92 kGroupByWeek, 93 kGroupByMonth, 94 kGroupByYear 95 }; 84 96 private: 85 97 MSQLMagic &fServer; … … 87 99 MDataSet *fDataSet; 88 100 89 TString fRequestFrom; 90 TString fRequestTo; 91 Int_t fRequestPeriod; 92 93 Float_t fPlotMin; 94 Float_t fPlotMax; 95 96 Float_t fHistMin; 97 Float_t fHistMax; 98 99 TString fDescription; 100 TString fNameTab; 101 102 TString fCondition; 103 Bool_t fGroupBy; 101 TString fPrimary; 102 TString fSecondary; 103 104 TString fRequestFrom; 105 TString fRequestTo; 106 Int_t fRequestPeriod; 107 108 Float_t fPlotMin; 109 Float_t fPlotMax; 110 111 Float_t fHistMin; 112 Float_t fHistMax; 113 114 TString fDescription; 115 TString fNameTab; 116 117 TString fCondition; 118 GroupBy_t fGroupBy; 104 119 105 120 void PlotTable(TSQLResult &res, TString name, Float_t fmin, Float_t fmax, Float_t resolution) … … 109 124 TSQLRow *row; 110 125 111 TGraph gt;126 TGraph > = res.GetFieldCount()>4 ? *new TGraphErrors : *new TGraph; 112 127 gt.SetNameTitle(name, Form("%s vs Time", name.Data())); 113 128 gt.SetMarkerStyle(kFullDotMedium); … … 138 153 const char *val = (*row)[2]; 139 154 const char *snum = res.GetFieldCount()>3 ? (*row)[3] : 0; 155 const char *verr = res.GetFieldCount()>4 ? (*row)[5] : 0; 140 156 if (!date || !val || !zd) 141 157 continue; … … 174 190 gt.SetPoint(gt.GetN(), t.GetAxisTime(), value); 175 191 gz.SetPoint(gz.GetN(), zenith, value); 176 } 177 178 TString title = fNameTab.IsNull() ? name(name.First('.')+2, name.Length()) : fNameTab; 179 cerr << setprecision(4) << setw(10) << title << ": "; 180 if (gt.GetN()==0) 181 { 182 cerr << " <empty>" << endl; 183 return; 184 } 185 cerr << setw(8) << gt.GetMean(2) << "+-" << setw(8) << gt.GetRMS(2) << " "; 186 if (gt0.GetN()>0 || gt1.GetN()>0) 187 { 188 cerr << setw(8) << gt1.GetMean(2) << "+-" << setw(8) << gt1.GetRMS(2) << " "; 189 cerr << setw(8) << gt0.GetMean(2) << "+-" << setw(8) << gt0.GetRMS(2); 190 } 191 cerr << endl; 192 193 if (verr) 194 static_cast<TGraphErrors&>(gt).SetPointError(gt.GetN()-1, 0, atof(verr)); 195 } 192 196 193 197 // If this is done earlier the plots remain empty since root 5.12/00 … … 202 206 gROOT->SetSelectedPad(0); 203 207 208 TString title = fNameTab.IsNull() ? name(name.First('.')+2, name.Length()) : fNameTab; 204 209 TCanvas &c = fDisplay ? fDisplay->AddTab(title) : *new TCanvas; 205 210 c.SetFillColor(kWhite); 206 211 c.SetBorderMode(0); 207 212 c.Divide(1,2); 213 214 cerr << setprecision(4) << setw(10) << title << ": "; 215 if (gt.GetN()==0) 216 { 217 cerr << " <empty>" << endl; 218 return; 219 } 220 cerr << setw(8) << gt.GetMean(2) << "+-" << setw(8) << gt.GetRMS(2) << " "; 221 if (gt0.GetN()>0 || gt1.GetN()>0) 222 { 223 cerr << setw(8) << gt1.GetMean(2) << "+-" << setw(8) << gt1.GetRMS(2) << " "; 224 cerr << setw(8) << gt0.GetMean(2) << "+-" << setw(8) << gt0.GetRMS(2); 225 } 226 cerr << endl; 208 227 209 228 TVirtualPad *pad = gPad; … … 308 327 public: 309 328 MPlot(MSQLMagic &server) : fServer(server), fDataSet(NULL), 310 fRequestPeriod(-1), fPlotMin(0), fPlotMax(-1), fHistMin(0), fHistMax(-1), fGroupBy(k FALSE)329 fRequestPeriod(-1), fPlotMin(0), fPlotMax(-1), fHistMin(0), fHistMax(-1), fGroupBy(kNone) 311 330 { 312 331 } … … 326 345 fDataSet = new MDataSet(filename); 327 346 } 328 void SetPlotRange(Float_t min, Float_t max, Int_t n=5) 329 { fPlotMin = min; fPlotMax = max; } 330 void SetHistRange(Float_t min, Float_t max) 331 { fHistMin = min; fHistMax = max; } 332 void SetRequestRange(const char *from="", const char *to="") 333 { fRequestFrom = from; fRequestTo = to; } 334 void SetRequestPeriod(Int_t n=-1) 335 { fRequestPeriod = n; } 336 void SetCondition(const char *cond="") 337 { fCondition = cond; } 347 void SetPlotRange(Float_t min, Float_t max, Int_t n=5) { fPlotMin = min; fPlotMax = max; } 348 void SetHistRange(Float_t min, Float_t max) { fHistMin = min; fHistMax = max; } 349 void SetRequestRange(const char *from="", const char *to="") { fRequestFrom = from; fRequestTo = to; } 350 void SetRequestPeriod(Int_t n=-1) { fRequestPeriod = n; } 351 void SetCondition(const char *cond="") { fCondition = cond; } 338 352 void SetDescription(const char *d, const char *t=0) { fDescription = d; fNameTab = t; } 339 void EnableGroupBy(Bool_t b=kTRUE) { fGroupBy=b; } 353 void SetGroupBy(GroupBy_t b=kGroupByWeek) { fGroupBy=b; } 354 void SetPrimary(const char *ts) { fPrimary=ts; } 355 void SetSecondary(const char *ts) { fSecondary=ts; } 340 356 341 357 Int_t QueryKeyOfSource(TString src) … … 346 362 Bool_t Plot(const char *value, Float_t min=0, Float_t max=-1, Float_t resolution=0) 347 363 { 348 TString named = "OpticalData.fTimeStamp";349 TString named2 = f GroupBy ? "AVG(fZenithDistance)" : "fZenithDistance";364 TString named = fPrimary; 365 TString named2 = fSecondary; 350 366 TString namev = value; 351 367 TString join = "fSequenceFirst"; … … 357 373 TString valued = named(named.First('.')+1, named.Length()); 358 374 359 TString query; 360 query = Form("select %s, %s, %s ", valued.Data(), named2.Data(), value); 361 query += Form("from %s ", tabled.Data()); 362 363 //const Bool_t interval = !fRequestFrom.IsNull() && !fRequestTo.IsNull(); 364 365 if (TString(value).Contains("Object.")) 366 { 367 query += "left join Object on Object.fObjectKEY=OpticalData.fObjectKEY "; 368 } 369 370 if (!fCondition.IsNull()) 371 { 372 query += "where "; 373 query += fCondition; 374 query += " "; 375 } 376 377 if (fGroupBy) 378 query += " GROUP BY fTimeStamp "; 379 380 query += "order by fTimeStamp"; 375 TString query="SELECT "; 376 query += valued; 377 if (fGroupBy==kNone) 378 { 379 query += ", "; 380 query += fSecondary; 381 query += ", "; 382 query += value; 383 query += ", 0 "; 384 } 385 else 386 { 387 query += ", AVG("; 388 query += fSecondary; 389 query += "), AVG("; 390 query += value; 391 query += "), COUNT(*), STD("; 392 query += fSecondary; 393 query += "), STD("; 394 query += value; 395 query += ") "; 396 } 397 398 switch (fGroupBy) 399 { 400 case kNone: 401 case kGroupByPrimary: 402 break; 403 case kGroupByHour: 404 query += Form(", DATE_FORMAT(%s, '%%Y-%%m-%%d %%H') AS %s ", named.Data(), valued.Data()); 405 break; 406 case kGroupByNight: 407 query += Form(", DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-%%d') AS %s ", named.Data(), valued.Data()); 408 break; 409 case kGroupByWeek: 410 query += Form(", DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%x%%v') AS %s ", named.Data(), valued.Data()); 411 break; 412 case kGroupByMonth: 413 query += Form(", DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m') AS %s ", named.Data(), valued.Data()); 414 break; 415 case kGroupByYear: 416 query += Form(", DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y') AS %s ", named.Data(), valued.Data()); 417 break; 418 } 419 420 query += Form("FROM %s ", tabled.Data()); 421 422 TString where(fCondition); 423 424 if (!where.IsNull()) 425 where += " AND "; 426 427 where += fCondition; 428 where += " "; 429 430 // ------------------------------ 431 432 query += fServer.GetJoins(tabled, query+" "+where); 433 434 if (!where.IsNull()) 435 { 436 query += "WHERE "; 437 query += where; 438 } 439 440 if (fGroupBy!=kNone) 441 { 442 query += Form("GROUP BY %s ", valued.Data()); 443 //query += Form(" HAVING COUNT(%s)=(COUNT(*)+1)/2 ", valuev.Data()); 444 } 445 query += Form("ORDER BY %s ", fPrimary.Data()); 446 447 448 // ------------------------------ 381 449 382 450 TSQLResult *res = fServer.Query(query); … … 396 464 void plotall(MPlot &plot, TString source) 397 465 { 466 plot.SetPrimary("OpticalData.fTimeStamp"); 467 plot.SetSecondary("fZenithDistance"); 468 469 470 398 471 TString cond = "fStatusKEY=13"; 399 472 if (!source.IsNull()) … … 402 475 if (key<0) 403 476 return; 404 cond += Form(" andfObjectKEY=%d", key);477 cond += Form(" AND Object.fObjectKEY=%d", key); 405 478 406 479 } … … 418 491 plot.SetDescription("Aperture Radius;R_{A}", "ApRad"); 419 492 plot.Plot("OpticalData.fApertureRadius", 0, 10, 1); 420 /* 421 plot.SetDescription("Instrumental Magnitude;M_{I}\\cdot s^{-1}", "InstMag/s"); 422 plot.Plot("OpticalData.fInstrumentalMag/OpticalData.fExposure", 0, 0.2, 0.005); 423 424 plot.SetDescription("Instrumental Magnitude Error;\\sigma_{M}\\cdot s^{-1}", "MagErr/s"); 425 plot.Plot("OpticalData.fInstrumentalMagErr/OpticalData.fExposure", 0, 0.01, 0.0002); 426 427 plot.SetDescription("Instrumental Magnitude;M_{I}", "InstMag"); 428 plot.Plot("OpticalData.fInstrumentalMag", 0, 30, 0.5); 429 430 plot.SetDescription("Instrumental Magnitude Error;\\sigma_{M}", "MagErr"); 431 plot.Plot("OpticalData.fInstrumentalMagErr", 0, 1, 0.01); 432 */ 493 494 /* 495 plot.SetDescription("Instrumental Magnitude;M_{I}\\cdot s^{-1}", "InstMag/s"); 496 plot.Plot("OpticalData.fInstrumentalMag/OpticalData.fExposure", 0, 0.2, 0.005); 497 498 plot.SetDescription("Instrumental Magnitude Error;\\sigma_{M}\\cdot s^{-1}", "MagErr/s"); 499 plot.Plot("OpticalData.fInstrumentalMagErr/OpticalData.fExposure", 0, 0.01, 0.0002); 500 501 plot.SetDescription("Instrumental Magnitude;M_{I}", "InstMag"); 502 plot.Plot("OpticalData.fInstrumentalMag", 0, 30, 0.5); 503 504 plot.SetDescription("Instrumental Magnitude Error;\\sigma_{M}", "MagErr"); 505 plot.Plot("OpticalData.fInstrumentalMagErr", 0, 1, 0.01); 506 */ 507 433 508 plot.SetDescription("m_{1};m_{1}", "M1"); 434 509 plot.Plot("OpticalData.fInstrumentalMag+2.5*log10(OpticalData.fExposure)", 10, 35, 0.2); 435 510 436 cond += " and Object.fObjectName not like '%/BL' and not IsNull(Object.fMagnitude) ";511 cond += " AND Object.fObjectName NOT LIKE '%/BL' AND NOT ISNULL(Object.fMagnitude) "; 437 512 plot.SetCondition(cond); 438 513 439 514 TString ext("3080/25.0*pow(10, (OpticalData.fInstrumentalMag+2.5*log10(OpticalData.fExposure)-Object.fMagnitude)/-2.5)"); 440 515 ext += "+0.0028*fZenithDistance-0.08"; 441 /* 442 plot.SetDescription("m_{1}-m_{true} (Extinction per Object);m_{1}-m_{true}", "ExtObj"); 443 plot.Plot(ext, 0.5, 1.2, 0.01); 444 */ 445 446 plot.EnableGroupBy(); 516 517 plot.SetGroupBy(MPlot::kGroupByPrimary); 447 518 plot.SetDescription("m_{1}-m_{true} (Extinction per Image);m_{1}-m_{true}", "ExtImg"); 448 plot.Plot(Form("AVG(%s)", ext.Data()), 0.05, 1.2, 0.01); 449 450 plot.SetDescription("Error m_{1}-m_{true} (Extinction per Image);ERR m_{1}-m_{true}", "ExtImgErr"); 451 plot.Plot(Form("STD(%s)", ext.Data()), 0, 0.3, 0.005); 452 519 plot.Plot(ext/*Form("AVG(%s)", ext.Data())*/, 0.05, 1.2, 0.01); 520 521 plot.SetGroupBy(MPlot::kGroupByHour); 453 522 plot.SetDescription("m_{1}-m_{true} (Extinction per Hour);m_{1}-m_{true}", "ExtHour"); 454 plot.Plot( Form("AVG(%s), date_format(fTimeStamp, '%%Y-%%m-%%d %%H') as fTimeStamp", ext.Data()),523 plot.Plot(ext/*Form("AVG(%s), date_format(fTimeStamp, '%%Y-%%m-%%d %%H') as fTimeStamp", ext.Data())*/, 455 524 0.5, 1.2, 0.01); 456 525 526 plot.SetGroupBy(MPlot::kGroupByNight); 457 527 plot.SetDescription("m_{1}-m_{true} (Extinction per Night);m_{1}-m_{true}", "ExtNight"); 458 plot.Plot( Form("AVG(%s), date_format(adddate(fTimeStamp,Interval 12 hour),'%%Y-%%m-%%d') as fTimeStamp", ext.Data()),528 plot.Plot(ext/*Form("AVG(%s), date_format(adddate(fTimeStamp,Interval 12 hour),'%%Y-%%m-%%d') as fTimeStamp", ext.Data())*/, 459 529 0.5, 1.2, 0.01); 460 530 }
Note:
See TracChangeset
for help on using the changeset viewer.