Ignore:
Timestamp:
10/07/07 22:12:37 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 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
Note: See TracChangeset for help on using the changeset viewer.