source: trunk/MagicSoft/Mars/mastro/MObservatory.cc@ 3326

Last change on this file since 3326 was 3326, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 2.8 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Robert Wagner 10/2002 <mailto:magicsoft@rwagner.de>
19! Author(s): Thomas Bretz 2/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
20!
21! Copyright: MAGIC Software Development, 2002-2004
22!
23!
24\* ======================================================================== */
25
26/////////////////////////////////////////////////////////////////////////////
27//
28// MObservatory
29//
30/////////////////////////////////////////////////////////////////////////////
31#include "MObservatory.h"
32
33#include "MAstro.h"
34
35#include "MLog.h"
36#include "MLogManip.h"
37
38ClassImp(MObservatory);
39
40using namespace std;
41
42void MObservatory::Init(const char *name, const char *title)
43{
44 fName = name ? name : "MObservatory";
45 fTitle = title ? title : "Storage container for coordinates of an observatory";
46}
47
48MObservatory::MObservatory(const char *name, const char *title)
49{
50 Init(name, title);
51
52 SetLocation(kMagic1);
53}
54
55MObservatory::MObservatory(LocationName_t key, const char *name, const char *title)
56{
57 Init(name, title);
58
59 SetLocation(key);
60}
61
62void MObservatory::SetLocation(LocationName_t name)
63{
64 switch (name)
65 {
66 case kMagic1:
67 // Values taken from the GPS Receiver (avg 20h)
68 // on 26/11/2003 at 17h30 in the counting house
69 fLatitude = MAstro::Dms2Rad(28, 45, 42.576, '+');
70 fLongitude = MAstro::Dms2Rad(17, 53, 26.460, '-');
71 fHeight = 2196.5; // m
72 fObservatoryName = "Observatorio del Roque de los Muchachos (Magic1)";
73 return;
74
75 case kWuerzburgCity:
76 fLatitude = MAstro::Dms2Rad(51, 38, 48.0);
77 fLongitude = MAstro::Dms2Rad( 9, 56, 36.0);
78 fHeight = 300;
79 fObservatoryName = "Wuerzburg City";
80 return;
81
82 }
83}
84
85void MObservatory::Print(Option_t *) const
86{
87 *fLog << all;
88 *fLog << fObservatoryName << endl;
89 *fLog << "Latitude " << (fLatitude > 0 ? (fLatitude*kRad2Deg) : -(fLatitude*kRad2Deg)) << " deg " << (fLatitude > 0 ? "W" : "E") << endl;
90 *fLog << "Longitude " << (fLongitude > 0 ? (fLongitude*kRad2Deg) : -(fLongitude*kRad2Deg)) <<" deg " << (fLongitude < 0 ? "N" : "S") << endl;
91 *fLog << "Height " << fHeight << "m" << endl;
92}
93
Note: See TracBrowser for help on using the repository browser.