sources.py 文件源码

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

项目:CAAPR 作者: Stargrazer82301 项目源码 文件源码
def find_contour(box, mask, sigma_level):

    """
    This function ...
    :param box:
    :param mask:
    :param sigma_level:
    :return:
    """

    props = source_properties(box, mask)
    #tbl = properties_table(props)

    x_shift = box.x_min
    y_shift = box.y_min

    # Since there is only one segment in the self.source.mask (the center segment), the props
    # list contains only one entry (one galaxy)
    if len(props) == 0: return None
    properties = props[0]

    # Obtain the position, orientation and extent
    position = Position(properties.xcentroid.value + x_shift, properties.ycentroid.value + y_shift)
    a = properties.semimajor_axis_sigma.value * sigma_level
    b = properties.semiminor_axis_sigma.value * sigma_level
    angle = properties.orientation.value # in radians
    angle = Angle(angle, u.rad)

    radius = Extent(a, b)

    # Create and return the elliptical contour
    return Ellipse(position, radius, angle)

# -----------------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号