CoordHandler.py 文件源码

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

项目:CTAtools 作者: davidsanchez 项目源码 文件源码
def __init__(self,x,y, frame = FK5):
        ''' init function
        Parameters
        ---------
        x  : float, first coordinate of the source
        f  : float, second coordinate of the source
        frame   : Astropy coordinate frame ICRS, Galactic, FK4, FK5 , see astropy for more information
        '''
        self.frame = frame
        try :
            self.skycoord = SkyCoord(x, y, frame=frame)
        except:
            self.skycoord = SkyCoord(x*u.degree, y*u.degree, frame=frame)

        try :
            self.X = self.skycoord.ra
            self.Y = self.skycoord.dec
        except:
            self.X = self.skycoord.l
            self.Y = self.skycoord.b

        self.to_string = self.skycoord.to_string

        self.to_string = self.skycoord.to_string
        self.frame = self.skycoord.frame.name
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号