Changeset 8601 for trunk/MagicSoft


Ignore:
Timestamp:
06/24/07 17:31:59 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8599 r8601  
    1919                                                 -*-*- END OF LINE -*-*-
    2020
     21
     22 2007/06/23 Thomas Bretz
     23
     24   * mbadpixels/MBadPixelsCam.cc:
     25     - fixed some Print output
     26
     27   * mhflux/MHAlpha.cc:
     28     - added the missing include of MHillas.h
     29     - removed the obsolete ClassImp(MAlphaFitter)
     30
     31   * mhflux/MHFalseSource.cc, mimage/MHillasSrc.cc:
     32     - added the missing include MHillas.h
     33
     34   * mimage/MHHillasSrc.cc, mimage/MHillasSrc.h:
     35     - removed obsolete include of MHillas.h
     36
     37   * mpointing/MPointingDevCalc.[h,cc]:
     38     - added the real starguider calibration using a pointing model
     39       for the strguider. The dates for which the model is valid
     40       can still be tuned.
     41
     42   * mpointing/MSrcPosCalc.cc, mreport/MReportStarguider.cc:
     43     - added some comment
     44
     45
     46
     47 2007/06/23 Thomas Bretz
     48
     49   * mpointing/MPointing.cc:
     50     - improved output
     51
     52
     53
    2154 2007/06/23 Daniela Dorner
    2255
     
    5184   * mhflux/MHThetaSqN.cc:
    5285     - fixed optimization (it just didn't work)
     86
     87   * mpointing/MPointing.[h,cc]:
     88     - added some checks in Load
     89     - fixed a problem with the constructors (the pointers MUST be
     90       initialized to 0)
     91     - renamed fNumPar to fgNumPar
     92     - Load and Save now return kTRUE or kFALSE
    5393
    5494
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc

    r8580 r8601  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MBadPixelsCam.cc,v 1.51 2007-06-18 14:35:39 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MBadPixelsCam.cc,v 1.52 2007-06-24 16:31:57 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    455455  *fLog << endl;
    456456
    457   // TO BE FIXED!!!
    458 
    459457  PrintBadPixels(MBadPixelsPix::kPreviouslyExcluded,"Previously excluded");
    460458  PrintBadPixels(MBadPixelsPix::kChargeIsPedestal,"Signal smaller 3 Pedestal RMS");
     
    468466  PrintBadPixels(MBadPixelsPix::kLoGainOverFlow,"Low-Gain Histogram Overflow");
    469467  PrintBadPixels(MBadPixelsPix::kDeadPedestalRms,"Presumably dead from Ped. Rms");
    470 //  PrintBadPixels(MBadPixelsPix::kFluctuatingArrivalTimes,"Fluctuating Pulse Arrival Times");
     468  PrintBadPixels(MBadPixelsPix::kDeviatingAbsTimeResolution,"Deviating abs. time resolution");
     469  PrintBadPixels(MBadPixelsPix::kDeviatingRelTimeResolution,"Deviating rel. time resolution");
     470  //  PrintBadPixels(MBadPixelsPix::kFluctuatingArrivalTimes,"Fluctuating Pulse Arrival Times");
    471471
    472472  *fLog << endl;
    473473  *fLog << all << "Unreliable pixels statistics:" << endl;
    474474  *fLog << endl;
    475 
    476   // TO BE FIXED!!!
    477475
    478476  PrintBadPixels(MBadPixelsPix::kChargeSigmaNotValid,"Signal Sigma smaller Pedestal RMS");
     
    634632      break;
    635633    case 6:
    636       if  (!(*this)[idx].GetUnsuitableCalLevel())
    637         return kFALSE;
    638634      val = (*this)[idx].GetUnsuitableCalLevel();
    639       break;
     635      return val>0;
    640636    case 7:
    641       if  (!(*this)[idx].GetUnreliableCalLevel())
    642         return kFALSE;
    643637      val = (*this)[idx].GetUnreliableCalLevel();
    644       break;
     638      return val>0;
    645639    case 8:
    646640      if  (!(*this)[idx].IsUncalibrated(MBadPixelsPix::kHiGainNotFitted))
  • trunk/MagicSoft/Mars/mhflux/MHAlpha.cc

    r8136 r8601  
    5555
    5656#include "MSrcPosCam.h"
     57#include "MHillas.h"
    5758#include "MHillasSrc.h"
    5859#include "MTime.h"
     
    7172
    7273ClassImp(MHAlpha);
    73 ClassImp(MAlphaFitter);
    7474
    7575using namespace std;
  • trunk/MagicSoft/Mars/mhflux/MHFalseSource.cc

    r8185 r8601  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MHFalseSource.cc,v 1.21 2006-11-01 08:29:45 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MHFalseSource.cc,v 1.22 2007-06-24 16:31:57 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    132132#include "MGeomCam.h"
    133133#include "MSrcPosCam.h"
     134#include "MHillas.h"
    134135#include "MHillasSrc.h"
    135136#include "MTime.h"
  • trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc

    r7170 r8601  
    4545#include "MParList.h"
    4646
    47 #include "MHillas.h"
    4847#include "MHillasSrc.h"
    4948
  • trunk/MagicSoft/Mars/mimage/MHillasSrc.cc

    r6869 r8601  
    7878
    7979#include "MGeomCam.h"
     80#include "MHillas.h"
    8081#include "MSrcPosCam.h"
    8182
  • trunk/MagicSoft/Mars/mimage/MHillasSrc.h

    r7103 r8601  
    22#define MARS_MHillasSrc
    33
    4 #ifndef MARS_MHillas
    5 #include "MHillas.h"
     4#ifndef MARS_MParContainer
     5#include "MParContainer.h"
    66#endif
    77
     8class TArrayF;
     9
     10class MHillas;
     11class MGeomCam;
    812class MSrcPosCam;
    913
  • trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc

    r8307 r8601  
    6565
    6666#include "MAstro.h"
     67#include "MPointing.h"
    6768#include "MPointingDev.h"
    6869#include "MRawRunHeader.h"
     
    7374using namespace std;
    7475
    75 // --------------------------------------------------------------------------
     76const TString MPointingDevCalc::fgFileName="resources/starguider.txt";
     77
     78// --------------------------------------------------------------------------
     79//
     80// Delete fPointing and set pointing to NULL
     81//
     82void MPointingDevCalc::Clear(Option_t *o)
     83{
     84    if (fPointing)
     85        delete fPointing;
     86
     87    fPointing = NULL;
     88}
     89
     90// --------------------------------------------------------------------------
     91//
     92// Clear the pointing model. If run-number >= 87751 read the new
     93// pointing model with fFileName
     94//
     95Bool_t MPointingDevCalc::ReadPointingModel(const MRawRunHeader &run)
     96{
     97    if (run.GetRunNumber()<87751)
     98    {
     99        Clear();
     100        return kTRUE;
     101    }
     102
     103    if (!fPointing)
     104        fPointing = new MPointing;
     105
     106    if (fFileName==fPointing->GetName())
     107    {
     108        *fLog << inf << fFileName << " already loaded." << endl;
     109        return kTRUE;
     110    }
     111
     112    return fPointing->Load(fFileName);
     113}
     114
     115// --------------------------------------------------------------------------
     116//
     117// Check the file/run type from the run-header and if it is a data file
     118// load starguider calibration.
    76119//
    77120Bool_t MPointingDevCalc::ReInit(MParList *plist)
     
    95138        if (!fReport)
    96139            *fLog << warn << "MReportStarguider not found... skipped." << endl;
    97         return kTRUE;
     140        return ReadPointingModel(*run);
    98141
    99142    case MRawRunHeader::kRTMonteCarlo:
     
    153196}
    154197
     198// --------------------------------------------------------------------------
     199//
     200// Do a full starguider calibration using a pointing model for the starguider.
     201//
     202void MPointingDevCalc::DoCalibration(Double_t devzd, Double_t devaz) const
     203{
     204    if (!fPointing)
     205    {
     206        // Do a simple starguider calibration using a simple offset in x and y
     207        fDeviation->SetDevZdAz(devzd, devaz);
     208
     209        // Linear starguider calibration taken from April/May data
     210        // For calibration add MDriveReport::GetErrorZd/Az !
     211        fDeviation->SetDevXY(fDx, fDy); // 1arcmin ~ 5mm
     212        //devzd -= 2.686/60;   
     213        //devaz -= 2.840/60;
     214
     215        return;
     216    }
     217
     218    // def?: 20.105, 773
     219    // 0/0 : 20.119, 763
     220    // -/- : 19.417  726
     221    // +mis: 19.80,  756
     222
     223    // Get the nominal position the star is at the sky
     224    // Unit: deg
     225    ZdAz nom(fReport->GetNominalZd(), fReport->GetNominalAz());
     226    nom *= TMath::DegToRad();
     227
     228    // Get the mispointing measured by the telescope. It is
     229    // calculate as follows:
     230    //
     231    // Position at which the starguider camera is pointing in real:
     232    //       pointing position = nominal position - mis
     233    ZdAz mis(devzd, devaz);
     234    mis *= TMath::DegToRad();
     235
     236    // The pointing mode is the conversion from the real pointing
     237    // position of the telescope into the pointing position measured
     238    // by the starguider.
     239    //
     240    //  --> To get the real poiting position of the telescope we have
     241    //      to convert the measured position back;
     242    //
     243
     244    // Position at which the starguider camera is pointing in real:
     245    //       pointing position = nominal position - dev
     246    //
     247    // The position measured as the starguider's pointing position
     248    ZdAz pos(nom);        // cpos = sao - dev
     249    pos -= mis;
     250
     251    // Now we convert the starguider's pointing position into the
     252    // telescope pointing position (the pointing model converts
     253    // the telescope pointing position into the starguider pointing
     254    // position)
     255    ZdAz point = fPointing->CorrectBack(pos);
     256
     257    // MSrcPosCalc uses the following condition to calculate the
     258    // source position in the camera:
     259    //    real pointing pos = nominal pointing pos - dev
     260    //
     261    // Therefor we calculate dev as follows:
     262    ZdAz dev(nom);
     263    dev -= point;
     264    dev *= TMath::RadToDeg();
     265
     266    // Set Measured mispointing and additional offset
     267    fDeviation->SetDevZdAz(dev.Zd(), dev.Az());
     268    fDeviation->SetDevXY(0, 0);
     269}
     270
    155271Int_t MPointingDevCalc::ProcessStarguiderReport()
    156272{
    157273    /************* CHECK STATUS!!! ******************/
    158274
    159     Double_t devzd = fReport->GetDevZd(); // [deg]
    160     Double_t devaz = fReport->GetDevAz(); // [deg]
     275    Double_t devzd = fReport->GetDevZd(); // [arcmin]
     276    Double_t devaz = fReport->GetDevAz(); // [arcmin]
    161277    if (devzd==0 && devaz==0)
    162278    {
     
    205321    }
    206322
     323    // >= 87751 (31.3.06 12:00)
     324
    207325    // Calculate absolute deviation
    208326    const Double_t dev = MAstro::GetDevAbs(fReport->GetNominalZd(), devzd, devaz);
     
    215333    }
    216334
    217     fDeviation->SetDevZdAz(devzd, devaz);
    218 
    219     // Linear starguider calibration taken from April/May data
    220     // For calibration add MDriveReport::GetErrorZd/Az !
    221     fDeviation->SetDevXY(fDx, fDy);
    222     //devzd -= 2.686/60;   // 1arcmin ~ 5mm
    223     //devaz -= 2.840/60;
     335    DoCalibration(devzd, devaz);
    224336
    225337    fSkip[0]++;
  • trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.h

    r8373 r8601  
    1010#endif
    1111
     12class MPointing;
    1213class MPointingDev;
     14class MRawRunHeader;
    1315class MReportStarguider;
    1416
     
    1618{
    1719private:
     20    static const TString fgFileName; //! default file name of pointing model
     21
    1822    MReportStarguider *fReport;    //! MReportStarguider to get mispointing
    1923    MPointingDev      *fDeviation; //! Output container to store pointing deviation
     24    MPointing         *fPointing;  //! MPointing, pointing model for the calibration
    2025
    2126    UShort_t fRunType;             //! Run Type to decide where to get pointing position from
     
    2732    TArrayI  fSkip;                //! Counter for execution statistics
    2833    Double_t fLastMjd;             //! Time of last processed report
     34
     35    TString fFileName;             // File name of pointing model
    2936
    3037    UInt_t  fNumMinStars;          // Minimum number of identified stars
     
    3946
    4047    // MPointingDevCalc
     48    void DoCalibration(Double_t devzd, Double_t devaz) const;
     49
     50    Bool_t ReadPointingModel(const MRawRunHeader &run);
     51
    4152    Int_t ProcessStarguiderReport();
    4253    void  Skip(Int_t i);
     
    5263
    5364public:
    54     MPointingDevCalc() : fReport(0), fDeviation(0), fSkip(7), fNumMinStars(8),
    55         fNsbLevel(3), fNsbMin(30), fNsbMax(60), fMaxAbsDev(15), fMaxAge(1), fDx(-7), fDy(16)
     65    MPointingDevCalc() : fReport(0), fDeviation(0), fPointing(0),
     66        fSkip(7), fFileName(fgFileName), fNumMinStars(8),
     67        fNsbLevel(3), fNsbMin(30), fNsbMax(60), fMaxAbsDev(15),
     68        fMaxAge(1), fDx(-7), fDy(16)
    5669    {
    5770        fName  = "MPointingDevCalc";
     
    6073        AddToBranchList("MReportStarguider.*");
    6174    }
     75    ~MPointingDevCalc()
     76    {
     77        Clear();
     78    }
     79
     80    void Clear(Option_t *o="");
    6281
    6382    void SetNumMinStars(UInt_t n)  { fNumMinStars=n; }
  • trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc

    r7287 r8601  
    375375    pos0 *= conv;
    376376
    377     TVector2 vx;
     377    //TVector2 vx;
    378378    if (fDeviation)
    379379    {
     380        // Position at which the starguider camera is pointing in real:
     381        //       pointing position = nominal position - dev
     382        //
    380383        //vx = CalcXYinCamera(pos0, pos)*fGeom->GetCameraDist()*1000;
    381384        pos0.SetZdAz(pos0.Theta()-fDeviation->GetDevZdRad(),
  • trunk/MagicSoft/Mars/mreport/MReportStarguider.cc

    r7731 r8601  
    3838// The sky brightness and the number of identified stars since 2005/03/17
    3939//
     40// Position at which the starguider camera is pointing in real:
     41//       pointing position = nominal position - dev
    4042//
    4143// Class Version 1:
Note: See TracChangeset for help on using the changeset viewer.