Ignore:
Timestamp:
03/15/04 12:04:09 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mastro
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mastro/MObservatory.cc

    r3366 r3497  
    3434#include "MObservatory.h"
    3535
     36#include <TVector3.h>
     37
     38#include "MTime.h"
    3639#include "MAstro.h"
    3740
     
    169172    return TMath::ASin((fCosLatitude*sinp) / denom);
    170173}
     174
     175// --------------------------------------------------------------------------
     176//
     177// RotationAngle
     178//
     179// calculates the angle for the rotation of the sky image in the camera;
     180// this angle is a function of the sky coordinates, the observatory
     181// location and the time
     182//
     183//  ra  [rad]: Right ascension
     184//  dec [rad]: Declination
     185//
     186// Return RotationAngle in rad
     187//
     188Double_t MObservatory::RotationAngle(Double_t ra, Double_t dec, const MTime &t) const
     189{
     190    const Double_t alpha = t.GetGmst() + GetElong();
     191
     192    TVector3 v;
     193    v.SetMagThetaPhi(1, TMath::Pi()/2-dec, alpha-ra);
     194    v.RotateY(GetPhi()-TMath::Pi()/2);
     195
     196    return RotationAngle(v.Theta(), v.Phi());
     197}
  • trunk/MagicSoft/Mars/mastro/MObservatory.h

    r3366 r3497  
    55#include "MParContainer.h"
    66#endif
     7
     8class MTime;
    79
    810class MObservatory : public MParContainer
     
    5658    void RotationAngle(Double_t theta, Double_t phi, Double_t &sin, Double_t &cos) const;
    5759    Double_t RotationAngle(Double_t theta, Double_t phi) const;
     60    Double_t RotationAngle(Double_t ra, Double_t dec, const MTime &t) const;
    5861
    5962    LocationName_t GetObservatoryKey() const { return fObservatoryKey; }
Note: See TracChangeset for help on using the changeset viewer.