source: trunk/MagicSoft/Mars/mtemp/MObservatory.cc@ 1832

Last change on this file since 1832 was 1784, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 2.9 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-2003
22!
23!
24\* ======================================================================== */
25
26/////////////////////////////////////////////////////////////////////////////
27// //
28// MObservatory //
29// //
30/////////////////////////////////////////////////////////////////////////////
31#include "MObservatory.h"
32
33#include "MLog.h"
34#include "MLogManip.h"
35
36ClassImp(MObservatory);
37
38void MObservatory::Init(const char *name, const char *title)
39{
40 fName = name ? name : "MObservatory";
41 fTitle = title ? title : "Storage container for coordinates of an observatory";
42}
43
44MObservatory::MObservatory(const char *name, const char *title)
45{
46 Init(name, title);
47
48 SetLocation(kMagic1);
49}
50
51MObservatory::MObservatory(LocationName_t key, const char *name=NULL, const char *title=NULL)
52{
53 Init(name, title);
54
55 SetLocation(key);
56}
57
58void MObservatory::SetLocation(LocationName_t name)
59{
60 switch (name)
61 {
62 case kMagic1:
63 fLatitude = Dms2Rad( 28, 45, 30.0);
64 fLongitude = Dms2Rad(-17, 52, 48.0);
65 fHeight = 2326; // m
66 fObservatoryName = "Observatorio del Roque de los Muchachos (Magic1)";
67 return;
68
69 case kWuerzburgCity:
70 fLatitude = Dms2Rad(51, 38, 48.0);
71 fLongitude = Dms2Rad( 9, 56, 36.0);
72 fHeight = 300;
73 fObservatoryName = "Wuerzburg City";
74 return;
75
76 }
77}
78
79void MObservatory::Print(Option_t *) const
80{
81 *fLog << all;
82 *fLog << fObservatoryName << endl;
83 *fLog << "Latitude " << (fLatitude > 0 ? (fLatitude*kRad2Deg) : -(fLatitude*kRad2Deg)) << " deg " << (fLatitude > 0 ? "W" : "E") << endl;
84 *fLog << "Longitude " << (fLongitude > 0 ? (fLongitude*kRad2Deg) : -(fLongitude*kRad2Deg)) <<" deg " << (fLongitude < 0 ? "N" : "S") << endl;
85 *fLog << "Height " << fHeight << "m" << endl;
86}
87
Note: See TracBrowser for help on using the repository browser.