Changeset 8140


Ignore:
Timestamp:
10/20/06 19:26:01 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8139 r8140  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20 2006/10/20 Thomas Bretz
     21
     22   * datacenter/macros/plotoptical.C:
     23     - improved with more interesting values
     24
     25   * mastro/MAstro.h:
     26     - added new constant for conversion from and into hours
     27
     28   * mbadpixels/MBadPixelsIntensityCam.[h,cc],
     29     mcalib/MCalibrationIntensityCam.[h,cc]:
     30     - added a RemoveOldCam member function
     31     - commented out unused GetCam functions
     32
     33   * mcalib/MCalibCalcFromPast.cc:
     34     - removed some obsolete output in the case FindCreateObj fains
     35     - if a new cam is added to the intensity cam list the old
     36       cam is deleted now which fixes the bigges memory leak in callisto
     37
     38
     39
    2040 2006/10/20 Daniela Dorner
    2141
  • trunk/MagicSoft/Mars/NEWS

    r8136 r8140  
    77   - database: For sequences there is now also the stoptime available on the
    88     websites.
    9 
    10    - database: Order-by is now working also on printtable.php and when
    11      group-by is chosen.
    129
    1310   - database: Removed ManuallyChanged flag from sequence-info websites,
     
    3330     over all possible set of weights. This also gives correct numbers
    3431     for the lo-gains which were totally wrong before.
     32
     33   - callisto: drastically reduced memory consumption by not storing
     34     all intermediate calibration results in memory anymore (we might
     35     write them into a file in the future)
    3536
    3637   - ganymed: To get a nice Theta-Sq plot (instead of the all-information
  • trunk/MagicSoft/Mars/datacenter/macros/plotoptical.C

    r8134 r8140  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1.1 2006-10-19 18:45:51 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: plotoptical.C,v 1.2 2006-10-20 18:26:00 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    101101
    102102    TString fCondition;
     103    Bool_t  fGroupBy;
    103104
    104105    void PlotTable(TSQLResult &res, TString name, Float_t fmin, Float_t fmax, Float_t resolution)
     
    298299
    299300        gz.DrawClone("AP");
     301
    300302        if (gz0.GetN()>0)
    301303            gz0.DrawClone("P");
     
    306308public:
    307309    MPlot(MSQLMagic &server) : fServer(server), fDataSet(NULL),
    308         fRequestPeriod(-1), fPlotMin(0), fPlotMax(-1), fHistMin(0), fHistMax(-1)
     310        fRequestPeriod(-1), fPlotMin(0), fPlotMax(-1), fHistMin(0), fHistMax(-1), fGroupBy(kFALSE)
    309311    {
    310312    }
     
    335337    { fCondition = cond; }
    336338    void SetDescription(const char *d, const char *t=0) { fDescription = d; fNameTab = t; }
     339    void EnableGroupBy(Bool_t b=kTRUE) { fGroupBy=b; }
    337340
    338341    Int_t QueryKeyOfSource(TString src)
     
    343346    Bool_t Plot(const char *value, Float_t min=0, Float_t max=-1, Float_t resolution=0)
    344347    {
    345         TString named  = "OpticalData.fTimestamp";
    346         TString named2 = "fSkyLevel";
     348        TString named  = "OpticalData.fTimeStamp";
     349        TString named2 = fGroupBy ? "AVG(fZenithDistance)" : "fZenithDistance";
    347350        TString namev  = value;
    348351        TString join   = "fSequenceFirst";
     
    355358
    356359        TString query;
    357         query  = Form("select %s, %s, %s ", valued.Data(), named2.Data(), valuev.Data());
     360        query  = Form("select %s, %s, %s ", valued.Data(), named2.Data(), value);
    358361        query += Form("from %s ",           tabled.Data());
    359362
    360         const Bool_t interval = !fRequestFrom.IsNull() && !fRequestTo.IsNull();
    361 
    362         if (!fDataSet && !interval && tabled=="Star")
    363         {
    364             if (!query.Contains("Star.fSequenceFirst"))
    365                 query += "left join Star on Sequences.fSequenceFirst=Star.fSequenceFirst ";
    366             query += "where Star.fEffOnTime>300 ";
    367         }
    368 
    369         if (interval)
    370         {
    371             query += query.Contains(" where ") ? "and " : "where ";
    372             query += Form("fRunStart between '%s' and '%s' ",
    373                           fRequestFrom.Data(), fRequestTo.Data());
     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 ";
    374368        }
    375369
     
    381375        }
    382376
    383         query += "order by fTimestamp";
     377        if (fGroupBy)
     378            query += " GROUP BY fTimeStamp ";
     379
     380        query += "order by fTimeStamp";
    384381
    385382        TSQLResult *res = fServer.Query(query);
     
    421418    plot.SetDescription("Aperture Radius;R_{A}", "ApRad");
    422419    plot.Plot("OpticalData.fApertureRadius", 0, 10, 1);
    423 
     420/*
    424421    plot.SetDescription("Instrumental Magnitude;M_{I}\\cdot s^{-1}", "InstMag/s");
    425422    plot.Plot("OpticalData.fInstrumentalMag/OpticalData.fExposure",  0, 0.2, 0.005);
     
    433430    plot.SetDescription("Instrumental Magnitude Error;\\sigma_{M}", "MagErr");
    434431    plot.Plot("OpticalData.fInstrumentalMagErr",  0, 1, 0.01);
     432  */
     433    plot.SetDescription("m_{1};m_{1}", "M1");
     434    plot.Plot("OpticalData.fInstrumentalMag+2.5*log10(OpticalData.fExposure)", 10, 35, 0.2);
     435
     436    cond += " and Object.fObjectName not like '%/BL' and not IsNull(Object.fMagnitude) ";
     437    plot.SetCondition(cond);
     438
     439    TString ext("3080/25.0*pow(10, (OpticalData.fInstrumentalMag+2.5*log10(OpticalData.fExposure)-Object.fMagnitude)/-2.5)");
     440    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();
     447    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
     453    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()),
     455              0.5, 1.2, 0.01);
     456
     457    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()),
     459              0.5, 1.2, 0.01);
    435460}
    436461
  • trunk/MagicSoft/Mars/mastro/MAstro.h

    r8066 r8140  
    2828    static Double_t Parsec2Lighyear() { return 3.2615644; }
    2929
     30    static Double_t DegToHor()        { return 15; }
     31    static Double_t HorToDeg()        { return 1./15; }
     32
     33    static Double_t RadToHor()        { return 15/TMath::TwoPi(); }
     34    static Double_t HorToRad()        { return TMath::TwoPi()/15; }
    3035
    3136    // Angle/Time conversion functions
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsIntensityCam.cc

    r7804 r8140  
    234234  return static_cast<MBadPixelsCam*>(i==-1 ? fCams->Last() : fCams->At(i));
    235235}
    236 
     236/*
    237237// --------------------------------------------------------------------------
    238238//
     
    252252  return static_cast<MBadPixelsCam*>(fCams->FindObject(name));
    253253}
    254 
     254*/
    255255// --------------------------------------------------------------------------
    256256//
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsIntensityCam.h

    r7189 r8140  
    1515#endif
    1616
    17 class TOrdCollection;
     17#ifndef ROOT_TOrdCollection
     18#include <TOrdCollection.h>
     19#endif
     20
    1821class TGraph;
    1922class MHCamera;
     23
    2024class MBadPixelsIntensityCam : public MParContainer, public MCamEvent
    2125{
     
    4246        MBadPixelsCam *GetCam     ( Int_t i=-1);
    4347  const MBadPixelsCam *GetCam     ( Int_t i=-1) const;
    44 
     48  /*
    4549        MBadPixelsCam *GetCam     ( const char *name );
    4650  const MBadPixelsCam *GetCam     ( const char *name ) const;
     51  */
     52
     53  // The "DeleteOldCam" function must not delete the first entry in
     54  // the array because it is a special cam from the MParList. (see above)
     55  void DeleteOldCam(MBadPixelsCam *cam) {/* if (fCams->IndexOf(cam)>0) delete fCams->Remove(cam);*/ }
    4756
    4857        MBadPixelsPix &operator[] ( Int_t i );
  • trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.cc

    r7829 r8140  
    167167    fIntensConst  = (MCalibrationIntensityConstCam*) pList->FindCreateObj("MCalibrationIntensityConstCam");
    168168
     169    if (!fIntensCharge)
     170        return kFALSE;
     171    if (!fIntensQE)
     172        return kFALSE;
     173    if (!fIntensConst)
     174        return kFALSE;
     175   
     176
    169177    MCalibrationChargeCam *chargeinit = (MCalibrationChargeCam*)pList->FindObject("MCalibrationChargeCam");
    170178    MCalibrationQECam     *qeinit     = (MCalibrationQECam*)    pList->FindObject("MCalibrationQECam");
     
    190198    *fLog << inf << "Found MHCalibrationChargeCam ... " << flush;
    191199
    192     if (!fIntensCharge)
    193       {
    194         *fLog << err << "Could not find nor create MCalibrationIntensityChargeCam abort... " << endl;
    195         return kFALSE;
    196       }
    197    
    198     if (!fIntensQE)
    199       {
    200         *fLog << err << "Could not find nor create MCalibrationIntensityQECam abort... " << endl;
    201         return kFALSE;
    202       }
    203    
    204200    if (!fChargeCalc)
    205201      {
     
    388384  const Int_t runnumber = fRunHeader->GetRunNumber();
    389385
     386  // The "DeleteOldCam" function must not delete the first entry in
     387  // the array because it is a special cam from the MParList. (see above)
     388
    390389  if (fIntensBad)
    391     {
     390  {
     391      *fLog << "MBadPixelsCam...";
     392      MBadPixelsCam *cold = fIntensBad->GetCam();
    392393      fIntensBad->AddToList(Form("MBadPixelsCam%04d",fNumCam),*fGeom);
    393       *fLog << "MBadPixelsCam...";
    394     }
     394      if (cold)
     395          fIntensBad->DeleteOldCam(cold);
     396  }
    395397
    396398  if (fIntensCharge)
    397     {
     399  {
     400        *fLog << "MCalibrationChargeCam...";
    398401        MCalibrationChargeCam *cold = (MCalibrationChargeCam*)fIntensCharge->GetCam();
    399402
     
    404407
    405408        if (cold)
     409        {
    406410            cnew->MergeHiLoConversionFactors(*cold);
    407 
    408       *fLog << "MCalibrationChargeCam...";
    409     }
     411            fIntensCharge->DeleteOldCam(cold);
     412        }
     413  }
     414
    410415  if (fIntensQE)
    411     {
     416  {
     417      *fLog << "MCalibrationQECam...";
     418      MCalibrationCam *cold = fIntensQE->GetCam();
    412419      fIntensQE->AddToList(Form("MCalibrationQECam%04d",fNumCam),*fGeom);
    413420      fIntensQE->GetCam()->SetRunNumber(runnumber);
    414       *fLog << "MCalibrationQECam...";
    415     }
     421      if (cold)
     422          fIntensQE->DeleteOldCam(cold);
     423  }
    416424  if (fIntensBlind)
    417     {
     425  {
     426      *fLog << "MCalibrationBlindCam...";
     427      MCalibrationCam *cold = fIntensBlind->GetCam();
    418428      fIntensBlind->AddToList(Form("MCalibrationBlindCam%04d",fNumCam),*fGeom);
    419429      fIntensBlind->GetCam()->SetRunNumber(runnumber);
    420       *fLog << "MCalibrationBlindCam...";
    421     }
     430      if (cold)
     431          fIntensBlind->DeleteOldCam(cold);
     432  }
    422433
    423434  *fLog << endl;
  • trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.cc

    r7804 r8140  
    289289// Get camera with name 'name'
    290290//
     291/*
    291292MCalibrationCam *MCalibrationIntensityCam::GetCam(const char *name)
    292293{
     
    302303  return static_cast<MCalibrationCam*>(fCams->FindObject(name));
    303304}
    304 
     305*/
    305306// --------------------------------------------------------------------------
    306307//
  • trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.h

    r7189 r8140  
    4242  void AddHist(const MHCalibrationCam *cam);
    4343
    44   Int_t CountNumEntries(const MCalibrationCam::PulserColor_t col) const; 
     44  Int_t CountNumEntries(const MCalibrationCam::PulserColor_t col) const;
    4545
    4646  const Int_t GetSize() const  { return fCams->GetSize();  }
     
    5757  const MBadPixelsPix   &GetAverageBadSector ( UInt_t i )  const   { return GetCam()->GetAverageBadSector(i); }
    5858
    59         MCalibrationCam *GetCam              ( Int_t i=-1)       {
    60         return static_cast<MCalibrationCam*>(i==-1 ? fCams->Last() : fCams->At(i)); }
    61   const MCalibrationCam *GetCam              ( Int_t i=-1) const {
    62         return static_cast<MCalibrationCam*>(i==-1 ? fCams->Last() : fCams->At(i)); }
     59  MCalibrationCam *GetCam              ( Int_t i/*=-1*/)       {
     60      return static_cast<MCalibrationCam*>(i==-1 ? fCams->Last() : fCams->At(i)); }
     61  const MCalibrationCam *GetCam              ( Int_t i/*=-1*/) const {
     62      return static_cast<MCalibrationCam*>(i==-1 ? fCams->Last() : fCams->At(i)); }
    6363
    64         MCalibrationCam *GetCam              ( const char *name );
    65   const MCalibrationCam *GetCam              ( const char *name ) const;
     64  MCalibrationCam *GetCam() { return static_cast<MCalibrationCam*>(fCams->Last()); }
     65  const MCalibrationCam *GetCam() const { return static_cast<MCalibrationCam*>(fCams->Last()); }
     66
     67//        MCalibrationCam *GetCam              ( const char *name );
     68//  const MCalibrationCam *GetCam              ( const char *name ) const;
     69
     70  // The "DeleteOldCam" function must not delete the first entry in
     71  // the array because it is a special cam from the MParList. (see above)
     72  void DeleteOldCam(MCalibrationCam *cam) { /* if (fCams->IndexOf(cam)>0) delete fCams->Remove(cam);*/ }
    6673
    6774        MHCalibrationCam *GetHist            ( Int_t i=-1);     
Note: See TracChangeset for help on using the changeset viewer.