Changeset 8752 for trunk/MagicSoft/Mars/datacenter/macros
- Timestamp:
- 10/07/07 22:12:37 (17 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/macros
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/plotoptical.C
r8707 r8752 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1. 7 2007-08-24 14:37:58tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1.8 2007-10-07 21:11:01 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 438 438 case kNone: 439 439 case kGroupByPrimary: 440 query += valued;440 query += Form("%s AS %s", valued.Data(), valued.Data()+1); 441 441 break; 442 442 case kGroupByHour: 443 query += Form("DATE_FORMAT(%s, '%%Y-%%m-%%d %%H:30:00') AS %s ", fPrimaryDate.Data(), valued.Data() );443 query += Form("DATE_FORMAT(%s, '%%Y-%%m-%%d %%H:30:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 444 444 break; 445 445 case kGroupByNight: 446 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-%%d 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data() );446 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-%%d 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 447 447 break; 448 448 case kGroupByWeek: 449 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%x%%v') AS %s ", fPrimaryDate.Data(), valued.Data() );449 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%x%%v') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 450 450 break; 451 451 case kGroupByMonth: 452 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data() );452 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 453 453 break; 454 454 case kGroupBySeason: 455 //query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data() );455 //query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 456 456 break; 457 457 case kGroupByYear: 458 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-08-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data() );458 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-08-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 459 459 break; 460 460 } … … 515 515 if (fGroupBy!=kNone) 516 516 { 517 query += Form("GROUP BY %s ", valued.Data() );517 query += Form("GROUP BY %s ", valued.Data()+1); 518 518 //query += Form(" HAVING COUNT(%s)=(COUNT(*)+1)/2 ", valuev.Data()); 519 519 } 520 query += Form("ORDER BY %s ", valued.Data() );520 query += Form("ORDER BY %s ", valued.Data()+1); 521 521 522 522 // ------------------------------ … … 545 545 // This is the condition to take only the "ok" flagged data 546 546 // and to restrict the query to a given source (if any) 547 TString cond = "fStatusKEY=1 ";547 TString cond = "fStatusKEY=1 AND fTelescopeKEY=1 AND fCCDKEY=1 AND fFilterKEY=1"; 548 548 if (!source.IsNull()) 549 549 { … … 554 554 555 555 } 556 556 557 plot.SetCondition(cond); 557 558 -
trunk/MagicSoft/Mars/datacenter/macros/plotrundb.C
r8707 r8752 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: plotrundb.C,v 1. 3 2007-08-24 14:37:58tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: plotrundb.C,v 1.4 2007-10-07 21:12:15 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 414 414 case kNone: 415 415 case kGroupByPrimary: 416 query += valued;416 query += Form("%s AS %s", valued.Data(), valued.Data()+1); 417 417 break; 418 418 case kGroupByHour: 419 query += Form("DATE_FORMAT(%s, '%%Y-%%m-%%d %%H:30:00') AS %s ", fPrimaryDate.Data(), valued.Data() );419 query += Form("DATE_FORMAT(%s, '%%Y-%%m-%%d %%H:30:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 420 420 break; 421 421 case kGroupByNight: 422 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-%%d 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data() );422 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-%%d 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 423 423 break; 424 424 case kGroupByWeek: 425 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%x%%v') AS %s ", fPrimaryDate.Data(), valued.Data() );425 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%x%%v') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 426 426 break; 427 427 case kGroupByMonth: 428 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data() );428 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 429 429 break; 430 430 case kGroupBySeason: 431 //query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data() );431 //query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 432 432 break; 433 433 case kGroupByYear: 434 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-08-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data() );434 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-08-15 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 435 435 break; 436 436 } … … 490 490 if (fGroupBy!=kNone) 491 491 { 492 query += Form("GROUP BY %s ", valued.Data() );492 query += Form("GROUP BY %s ", valued.Data()+1); 493 493 //query += Form(" HAVING COUNT(%s)=(COUNT(*)+1)/2 ", valuev.Data()); 494 494 } 495 query += Form("ORDER BY %s ", valued.Data() );495 query += Form("ORDER BY %s ", valued.Data()+1); 496 496 497 497
Note:
See TracChangeset
for help on using the changeset viewer.