@@ -34,8 +34,7 @@ class Telescope(object):
3434 )
3535
3636 Attributes:
37- latitude (astropy.coordinates.Latitude): Latitude of array
38- longitude (astropy.coordinates.Longitude): Longitude of array
37+ centre (astropy.coordinates.EarthLocation): Centre of the array
3938 ant_labels (list): Antennae labels
4039 ant_itrf_xyz (numpy.ndarray): Antennae xyz_positions in ITRF frame.
4140 [dtype: ``np.float_``, shape ``(n_antennae,3,)``.
@@ -46,8 +45,7 @@ class Telescope(object):
4645 baseline_labels (list): Baseline labels.
4746 (See also :func:`generate_baselines_and_labels`)
4847 """
49- latitude = attrib (validator = attr .validators .instance_of (Latitude ))
50- longitude = attrib (validator = attr .validators .instance_of (Longitude ))
48+ centre = attrib (validator = attr .validators .instance_of (EarthLocation ))
5149 ant_labels = attrib (default = None )
5250 ant_itrf_xyz = attrib (default = None , validator = _validator_optional_ndarray )
5351 ant_local_xyz = attrib (default = None , validator = _validator_optional_ndarray )
@@ -62,6 +60,21 @@ def __attrs_post_init__(self):
6260 self .ant_local_xyz , self .ant_labels
6361 )
6462
63+ @property
64+ def lat (self ):
65+ lon , lat , height = self .centre .to_geodetic ()
66+ return lat
67+
68+ @property
69+ def lon (self ):
70+ lon , lat , height = self .centre .to_geodetic ()
71+ return lon
72+
73+ @property
74+ def height (self ):
75+ lon , lat , height = self .centre .to_geodetic ()
76+ return height
77+
6578 @staticmethod
6679 def from_itrf (ant_itrf_xyz , ant_labels ):
6780 """
@@ -80,20 +93,20 @@ def from_itrf(ant_itrf_xyz, ant_labels):
8093 Telescope: A telescope class with the given array co-ords.
8194 """
8295 mean_posn = np .mean (ant_itrf_xyz , axis = 0 )
83- lon , lat , alt = EarthLocation .from_geocentric (mean_posn [0 ],
84- mean_posn [1 ],
85- mean_posn [2 ],
86- unit = u .m ,
87- ).to_geodetic ()
96+ centre = EarthLocation .from_geocentric (mean_posn [0 ],
97+ mean_posn [1 ],
98+ mean_posn [2 ],
99+ unit = u .m ,
100+ )
101+ lon , lat , height = centre .to_geodetic ()
88102
89103 mean_subbed_itrf = ant_itrf_xyz - mean_posn
90104
91105 rotation = z_rotation_matrix (lon )
92106 ant_local_xyz = np .dot (rotation , mean_subbed_itrf .T ).T
93107
94108 return Telescope (
95- latitude = lat ,
96- longitude = lon ,
109+ centre = centre ,
97110 ant_labels = ant_labels ,
98111 ant_itrf_xyz = ant_itrf_xyz ,
99112 ant_local_xyz = ant_local_xyz ,
@@ -124,7 +137,7 @@ def lst(self, time):
124137 an angle-Quantity.
125138 """
126139 return time .sidereal_time ('apparent' ,
127- longitude = self .longitude )
140+ longitude = self .lon )
128141
129142 def next_transit (self , target_ra , start_time , ):
130143 """
@@ -140,7 +153,7 @@ def next_transit(self, target_ra, start_time, ):
140153 astropy.time.Time: Approximate time of the next transit
141154
142155 """
143- return time_of_next_transit (observer_longitude = self .longitude ,
156+ return time_of_next_transit (observer_longitude = self .lon ,
144157 target_ra = target_ra ,
145158 start_time = start_time )
146159
@@ -213,7 +226,7 @@ def uvw_tracking_skycoord(self, pointing_centre, obs_times,
213226 """
214227 n_baselines = len (self .baseline_local_xyz )
215228 uvw_array = np .zeros ((len (obs_times ) * n_baselines , 3 ),
216- dtype = np .float_ )* self .baseline_local_xyz .unit
229+ dtype = np .float_ ) * self .baseline_local_xyz .unit
217230
218231 for idx , time in enumerate (obs_times ):
219232 lha = self .lha (pointing_centre .ra , time )
0 commit comments