Ignore:
Timestamp:
04/06/04 13:41:56 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mpointing
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mpointing/MPointingPos.cc

    r3568 r3666  
    7373Double_t MPointingPos::RotationAngle(const MObservatory &o, const MTime &t) const
    7474{
    75     return MAstroSky2Local(t, o).RotationAngle(fRa*TMath::DegToRad()*15, fDec*TMath::DegToRad());
     75    return MAstroSky2Local(t, o).RotationAngle(GetRaRad(), GetDecRad());
    7676}
  • trunk/MagicSoft/Mars/mpointing/MPointingPos.h

    r3568 r3666  
    1515    Double_t fAz;  // [deg] Azimuth
    1616
    17     Double_t fRa;  // [rad] Right ascension
    18     Double_t fHa;  // [rad] Hour angle
    19     Double_t fDec; // [rad] Declination
     17    Double_t fRa;  // [h]  Right ascension
     18    Double_t fHa;  // [h]  Hour angle
     19    Double_t fDec; // [deg] Declination
    2020
    2121public:
    22     MPointingPos()
     22    MPointingPos(const char *name=0, const char *title=0)
    2323    {
    24         fName  = "MPointingPos";
    25         fTitle = "Container storing the (corrected) telescope pointing position";
     24        fName  = name ? name   : "MPointingPos";
     25        fTitle = title ? title : "Container storing the (corrected) telescope pointing position";
    2626    }
    2727
     
    3535    Double_t GetDec() const { return fDec; }
    3636
     37    Double_t GetRaRad() const  { return fRa*TMath::DegToRad()*15; }
     38    Double_t GetDecRad() const { return fDec*TMath::DegToRad(); }
     39
    3740    Double_t RotationAngle(const MObservatory &o) const;
    3841    Double_t RotationAngle(const MObservatory &o, const MTime &t) const;
     42    Double_t RotationAngle(const MObservatory &o, const MTime *t) const
     43    {
     44        return t ? RotationAngle(o, *t) : RotationAngle(o);
     45    }
    3946
    4047    ClassDef(MPointingPos, 1) //Container storing the (corrected) telescope pointing position
  • trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc

    r3592 r3666  
    4646// To be done:
    4747//   - wobble mode missing
     48//   - a switch between using sky-coordinates and time or local-coordinates
     49//     from MPointingPos for determin the rotation angle
     50//   - the center of rotation need not to be the camera center
    4851//
    4952//////////////////////////////////////////////////////////////////////////////
     
    101104    {
    102105        *fLog << err << "MObservatory not found... aborting." << endl;
     106        return kFALSE;
     107    }
     108
     109    fTime = (MTime*)pList->FindObject("MTime");
     110    if (!fTime)
     111    {
     112        *fLog << err << "MTime not found... aborting." << endl;
    103113        return kFALSE;
    104114    }
     
    166176        return kTRUE;
    167177
     178    // rotate the source position by the current rotation angle
     179    const Double_t rho = fPointPos->RotationAngle(*fObservatory, *fTime);
     180
    168181    // Define source position in the camera plain
    169182    TVector2 v(fX, fY);
    170 
    171     // rotate the source position by the current rotation angle
    172     const Double_t rho = fPointPos->RotationAngle(*fObservatory);
    173     v=v.Rotate(-rho);
     183    v=v.Rotate(rho);
    174184
    175185    // Convert coordinates into camera plain (mm)
  • trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.h

    r3568 r3666  
    1010class MSrcPosCam;
    1111class MGeomCam;
     12class MTime;
    1213
    1314class MSrcPosCalc : public MTask
     
    1819    MSrcPosCam   *fSrcPos;
    1920    MGeomCam     *fGeom;
     21    MTime        *fTime;
    2022
    2123    Double_t fR;    // Distance of source to a fitted star
     
    3234    MSrcPosCalc(const char *name=NULL, const char *title=NULL);
    3335
     36    // Use is deprecated!
    3437    void SetOffset(Double_t r, Double_t drho)
    3538    {
Note: See TracChangeset for help on using the changeset viewer.