Beispiel #1
0
 def get_baseline(self, i, j, src='z'):
     """Return the baseline corresponding to i,j in various coordinate 
     projections: src='e' for current equatorial, 'z' for zenith 
     topocentric, 'r' for unrotated equatorial, or a RadioBody for
     projection toward that source."""
     bl = self[j] - self[i]
     if type(src) == str:
         if src == 'e': return n.dot(self._eq2now, bl)
         elif src == 'z': return n.dot(self._eq2zen, bl)
         elif src == 'r': return bl
         else: raise ValueError('Unrecognized source:' + src)
     try:
         if src.alt < 0:
             raise PointingError('%s below horizon' % src.src_name)
         m = src.map
     except(AttributeError):
         ra,dec = coord.eq2radec(src)
         m = coord.eq2top_m(self.sidereal_time() - ra, dec)
     return n.dot(m, bl).transpose()
Beispiel #2
0
 def get_baseline(self, i, j, src='z'):
     """Return the baseline corresponding to i,j in various coordinate 
     projections: src='e' for current equatorial, 'z' for zenith 
     topocentric, 'r' for unrotated equatorial, or a RadioBody for
     projection toward that source."""
     bl = self[j] - self[i]
     if type(src) == str:
         if src == 'e': return n.dot(self._eq2now, bl)
         elif src == 'z': return n.dot(self._eq2zen, bl)
         elif src == 'r': return bl
         else: raise ValueError('Unrecognized source:' + src)
     try:
         if src.alt < 0:
             raise PointingError('%s below horizon' % src.src_name)
         m = src.map
     except (AttributeError):
         ra, dec = coord.eq2radec(src)
         m = coord.eq2top_m(self.sidereal_time() - ra, dec)
     return n.dot(m, bl).transpose()
Beispiel #3
0
 def set_jultime(self, t=None):
     """Set current time as a Julian date."""
     phs.AntennaArray.set_jultime(self, t=t)
     self.eq2top_m = coord.eq2top_m(-self.sidereal_time(), self.lat)
     self._cache = None
Beispiel #4
0
 def compute(self, observer):
     """Update coordinates relative to the provided observer.  Must be
     called at each time step before accessing information."""
     # Generate a map for projecting baselines to uvw coordinates
     self.map = coord.eq2top_m(observer.sidereal_time()-self.ra, self.dec)
Beispiel #5
0
 def _update_eq2zen(self):
     self._eq2zen = coord.eq2top_m(0., self.lat)
Beispiel #6
0
 def compute(self, observer):
     """Update coordinates relative to the provided observer.  Must be
     called at each time step before accessing information."""
     # Generate a map for projecting baselines to uvw coordinates
     self.map = coord.eq2top_m(observer.sidereal_time() - self.ra, self.dec)
Beispiel #7
0
 def _update_eq2zen(self):
     self._eq2zen = coord.eq2top_m(0., self.lat)