Changeset 7744


Ignore:
Timestamp:
05/24/06 19:00:45 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7742 r7744  
    3636       the status display
    3737
    38    * mpointing/MPointingDevCalc.cc:
     38   * mpointing/MPointingDevCalc.[h,cc]:
    3939     - if the mispointing is set to 0 due to missing mispointing
    4040       information also the starguider calibration is reset.
    41 
     41     - in the case the latest report is older than a default (currently
     42       one minute) and the current report will be skip the starguider
     43       correction and calibration will be reset.
     44
     45   * ganymed.rc, ganymed_onoff.rc, ganymed_wobble.rc:
     46     - updated
    4247
    4348
  • trunk/MagicSoft/Mars/NEWS

    r7742 r7744  
    5050      + Cut1.ThetaCut: None                 
    5151      + MHThetaSqN.SignificanceCutLevel: 2.0  (increase off-cut by 2.0/1.7)
     52
     53   - ganymed: in the case the latest report is older than a default (currently
     54       one minute) and the current report will be skip the starguider
     55       correction and calibration will be reset. The maximum age can be
     56       setup from ganymed.rc by (minutes):
     57         MPointingDevCalc.MaxAge: 1.5
    5258
    5359   - ganymed: A first implementation showing all size-bins for the theta-sq
  • trunk/MagicSoft/Mars/ganymed_wobble.rc

    r7656 r7744  
    5252#MPointingDevCalc.Dx           -7
    5353#MPointingDevCalc.Dy           16
     54#MPointingDevCalc.MaxAge       1.0
    5455
    5556# -------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc

    r7740 r7744  
    8484    }
    8585
    86     fNsbSum   = 0;
    87     fNsbSq    = 0;
    88     fNsbCount = 0;
     86    fNsbSum   =  0;
     87    fNsbSq    =  0;
     88    fNsbCount =  0;
    8989
    9090    fRunType = run->GetRunType();
     
    127127    // We use kRTNone here as a placeholder for data runs.
    128128    fRunType  = MRawRunHeader::kRTNone;
     129    fLastMjd  = -1;
    129130
    130131    fSkip.Reset();
    131132
    132133    return fDeviation ? kTRUE : kFALSE;
     134}
     135
     136// --------------------------------------------------------------------------
     137//
     138// Increase fSkip[i] by one. If the data in fDeviation is outdated (older
     139// than fMaxAge) and the current report should be skipped reset DevZdAz and
     140// DevXY and fSkip[5] is increased by one.
     141//
     142void MPointingDevCalc::Skip(Int_t i)
     143{
     144    fSkip[i]++;
     145
     146    const Double_t diff = (fReport->GetMjd()-fLastMjd)*1440; // [min] 1440=24*60
     147    if (diff<fMaxAge && fLastMjd>0)
     148        return;
     149
     150    fDeviation->SetDevZdAz(0, 0);
     151    fDeviation->SetDevXY(0, 0);
     152    fSkip[5]++;
    133153}
    134154
     
    142162        fDeviation->SetDevXY(0, 0);   //?!?
    143163        fSkip[1]++;
     164        fLastMjd = fReport->GetMjd();
    144165        return kTRUE;
    145166    }
     
    167188            if (nsb<sum-rms || nsb>sum+rms)
    168189            {
    169                 fSkip[2]++;
     190                Skip(2);
    170191                return kTRUE;
    171192            }
     
    174195        if (fReport->GetNumIdentifiedStars()<fNumMinStars)
    175196        {
    176             fSkip[3]++;
     197            Skip(3);
    177198            return kTRUE;
    178199        }
     
    185206    if (dev*60>fMaxAbsDev)
    186207    {
    187         fSkip[4]++;
     208        Skip(4);
    188209        return kTRUE;
    189210    }
     
    198219
    199220    fSkip[0]++;
     221    fLastMjd = fReport->GetMjd();
    200222
    201223    return kTRUE;
     
    238260    PrintSkipped(fSkip[3], Form("Number of identified stars < %d", fNumMinStars));
    239261    PrintSkipped(fSkip[4], Form("Absolute deviation > %.1farcmin", fMaxAbsDev));
     262    PrintSkipped(fSkip[5], Form("Events set to 0 because older than %.1fmin", fMaxAge));
    240263    *fLog << " " << (int)fSkip[0] << " (" << Form("%5.1f", 100.*fSkip[0]/GetNumExecutions()) << "%) Evts survived calculation!" << endl;
    241264    *fLog << endl;
     
    251274// MPointingDevCalc.NsbMax:      60
    252275// MPointingDevCalc.MaxAbsDev:   15
     276// MPointingDevCalc.MaxAge:      1.0
    253277//
    254278Int_t MPointingDevCalc::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     
    290314        rc = kTRUE;
    291315    }
     316    if (IsEnvDefined(env, prefix, "MaxAge", print))
     317    {
     318        fMaxAge = GetEnvValue(env, prefix, "MaxAge", fMaxAge);
     319        rc = kTRUE;
     320    }
    292321
    293322    return rc;
  • trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.h

    r7594 r7744  
    2626
    2727    TArrayI  fSkip;                //! Counter for execution statistics
     28    Double_t fLastMjd;             //! Time of last processed report
    2829
    2930    UInt_t  fNumMinStars;          // Minimum number of identified stars
     
    3233    Float_t fNsbMax;               // Maximum NSB to calc mean and rms
    3334    Float_t fMaxAbsDev;            // [arcmin] Maximum considered absolute deviation
     35    Float_t fMaxAge;               // [min] Maximum age of reports to be used without an update
    3436
    3537    Float_t fDx;                   // Starguider calibration dx
     
    3840    // MPointingDevCalc
    3941    Int_t ProcessStarguiderReport();
     42    void  Skip(Int_t i);
    4043
    4144    // MParContainer
     
    4952
    5053public:
    51     MPointingDevCalc() : fReport(0), fDeviation(0), fSkip(5), fNumMinStars(8),
    52         fNsbLevel(3), fNsbMin(30), fNsbMax(60), fMaxAbsDev(15), fDx(-7), fDy(16)
     54    MPointingDevCalc() : fReport(0), fDeviation(0), fSkip(6), fNumMinStars(8),
     55        fNsbLevel(3), fNsbMin(30), fNsbMax(60), fMaxAbsDev(15), fMaxAge(1), fDx(-7), fDy(16)
    5356    {
    5457        fName  = "MPointingDevCalc";
     
    6568    void SetDx(Float_t dx)         { fDx=dx; }
    6669    void SetDy(Float_t dy)         { fDy=dy; }
     70    void SetMaxAge(Float_t age)    { fMaxAge=age; }
    6771
    6872    ClassDef(MPointingDevCalc, 0) //Task calculating the pointing deviation
Note: See TracChangeset for help on using the changeset viewer.