예제 #1
0
파일: map.py 프로젝트: SaulAryehKohn/aipy
def facet_centers(N, ncrd=2):
    """Return the coordinates of N points equally spaced around the sphere.
    Will return xyz or ra,dec depending on ncrd.  Shuffles the order of the
    pointing centers wrt pack_sphere so that widely spaced points are done 
    first, and then the gaps between them, and then the gaps between those.."""
    assert(ncrd == 2 or ncrd == 3)
    ind1 = n.arange(N); _local_shuffle(ind1)
    ind2 = _bit_reverse_order(N)
    ind = ind1.take(ind2)
    pnts = pack_sphere(N)
    pnts = pnts.take(ind, axis=1)
    if ncrd == 3: return pnts
    else: return coord.eq2radec(pnts)
예제 #2
0
def facet_centers(N, ncrd=2):
    """Return the coordinates of N points equally spaced around the sphere.
    Will return xyz or ra,dec depending on ncrd.  Shuffles the order of the
    pointing centers wrt pack_sphere so that widely spaced points are done 
    first, and then the gaps between them, and then the gaps between those.."""
    assert (ncrd == 2 or ncrd == 3)
    ind1 = n.arange(N)
    _local_shuffle(ind1)
    ind2 = _bit_reverse_order(N)
    ind = ind1.take(ind2)
    pnts = pack_sphere(N)
    pnts = pnts.take(ind, axis=1)
    if ncrd == 3: return pnts
    else: return coord.eq2radec(pnts)
예제 #3
0
파일: phs.py 프로젝트: DavidFMoore/aipy
 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()
예제 #4
0
파일: phs.py 프로젝트: zuoshifan/aipy
 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()