Ignore:
Timestamp:
10/07/07 22:12:37 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter/macros
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/macros/plotoptical.C

    r8707 r8752  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1.7 2007-08-24 14:37:58 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1.8 2007-10-07 21:11:01 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    438438        case kNone:
    439439        case kGroupByPrimary:
    440             query += valued;
     440            query += Form("%s AS %s", valued.Data(), valued.Data()+1);
    441441            break;
    442442        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);
    444444            break;
    445445        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);
    447447            break;
    448448        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);
    450450            break;
    451451        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);
    453453            break;
    454454        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);
    456456            break;
    457457        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);
    459459            break;
    460460        }
     
    515515        if (fGroupBy!=kNone)
    516516        {
    517             query += Form("GROUP BY %s ", valued.Data());
     517            query += Form("GROUP BY %s ", valued.Data()+1);
    518518            //query += Form(" HAVING COUNT(%s)=(COUNT(*)+1)/2 ", valuev.Data());
    519519        }
    520         query += Form("ORDER BY %s ", valued.Data());
     520        query += Form("ORDER BY %s ", valued.Data()+1);
    521521
    522522        // ------------------------------
     
    545545    // This is the condition to take only the "ok" flagged data
    546546    // 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";
    548548    if (!source.IsNull())
    549549    {
     
    554554
    555555    }
     556
    556557    plot.SetCondition(cond);
    557558
  • trunk/MagicSoft/Mars/datacenter/macros/plotrundb.C

    r8707 r8752  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: plotrundb.C,v 1.3 2007-08-24 14:37:58 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: plotrundb.C,v 1.4 2007-10-07 21:12:15 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    414414        case kNone:
    415415        case kGroupByPrimary:
    416             query += valued;
     416            query += Form("%s AS %s", valued.Data(), valued.Data()+1);
    417417            break;
    418418        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);
    420420            break;
    421421        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);
    423423            break;
    424424        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);
    426426            break;
    427427        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);
    429429            break;
    430430        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);
    432432            break;
    433433        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);
    435435            break;
    436436        }
     
    490490        if (fGroupBy!=kNone)
    491491        {
    492             query += Form("GROUP BY %s ", valued.Data());
     492            query += Form("GROUP BY %s ", valued.Data()+1);
    493493            //query += Form(" HAVING COUNT(%s)=(COUNT(*)+1)/2 ", valuev.Data());
    494494        }
    495         query += Form("ORDER BY %s ", valued.Data());
     495        query += Form("ORDER BY %s ", valued.Data()+1);
    496496
    497497
Note: See TracChangeset for help on using the changeset viewer.