Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

import math 

 

__all__ = ["ObservatoryPosition"] 

 

class ObservatoryPosition(object): 

"""Class for providing base pointing position information. 

""" 

 

def __init__(self, time=0.0, ra_rad=0.0, dec_rad=0.0, ang_rad=0.0, 

band_filter='r', tracking=False, alt_rad=1.5, az_rad=0.0, 

pa_rad=0.0, rot_rad=0.0): 

"""Initialize the class. 

 

Parameters 

---------- 

time : float 

The UTC timestamp (seconds) for the given pointing position 

information. 

ra_rad : float 

The right ascension (radians) for the pointing position. 

dec_rad : float 

The declination (radians) for the pointing position. 

ang_rad : float 

 

band_filter : str 

The band filter being used during the pointing. 

tracking : bool 

The tracking state of the pointing. 

alt_rad : float 

The altitude (radians) of the pointing. 

az_rad : float 

The azimuth (radians) of the pointing. 

pa_rad : float 

The parallactic angle (radians) of the pointing. 

rot_rad : float 

 

""" 

self.time = time 

self.ra_rad = ra_rad 

self.dec_rad = dec_rad 

self.ang_rad = ang_rad 

self.filter = band_filter 

self.tracking = tracking 

self.alt_rad = alt_rad 

self.az_rad = az_rad 

self.pa_rad = pa_rad 

self.rot_rad = rot_rad 

 

def __str__(self): 

"""str: The string representation of the instance.""" 

return "t=%.1f ra=%.3f dec=%.3f ang=%.3f filter=%s track=%s alt=%.3f "\ 

"az=%.3f pa=%.3f rot=%.3f" % \ 

(self.time, self.ra, self.dec, self.ang, self.filter, 

self.tracking, self.alt, self.az, self.pa, self.rot) 

 

@property 

def alt(self): 

"""float: Return the altitude (degrees) of the pointing position.""" 

return math.degrees(self.alt_rad) 

 

@property 

def ang(self): 

return math.degrees(self.ang_rad) 

 

@property 

def az(self): 

"""float: Return the azimuth (degrees) of the pointing position.""" 

return math.degrees(self.az_rad) 

 

@property 

def dec(self): 

"""float: Return the declination (degrees) of the pointing 

position.""" 

return math.degrees(self.dec_rad) 

 

@property 

def pa(self): 

"""float: Return the parallactic angle (degrees) of the pointing 

position.""" 

return math.degrees(self.pa_rad) 

 

@property 

def ra(self): 

"""float: Return the right ascension (degrees) of the pointing 

position.""" 

return math.degrees(self.ra_rad) 

 

@property 

def rot(self): 

return math.degrees(self.rot_rad)