surveys.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:sims_featureScheduler 作者: lsst 项目源码 文件源码
def _spin_fields(self, lon=None, lat=None):
        """Spin the field tesselation
        """
        if lon is None:
            lon = np.random.rand()*np.pi*2
        if lat is None:
            lat = np.random.rand()*np.pi*2
        # rotate longitude
        ra = (self.fields['RA'] + lon) % (2.*np.pi)
        dec = self.fields['dec'] + 0

        # Now to rotate ra and dec about the x-axis
        x, y, z = thetaphi2xyz(self.fields['RA'], self.fields['dec']+np.pi/2.)
        xp, yp, zp = rotx(lat, x, y, z)
        theta, phi = xyz2thetaphi(xp, yp, zp)
        dec = phi - np.pi/2
        ra = theta + np.pi

        self.fields['RA'] = ra
        self.fields['dec'] = dec
        # Rebuild the kdtree with the new positions
        # XXX-may be doing some ra,dec to conversions xyz more than needed.
        self._hp2fieldsetup(ra, dec)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号