Ignore:
Timestamp:
03/15/04 12:04:09 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.