def from_pixel(cls, rectangle, wcs):
"""
This function ...
:param rectangle:
:param wcs:
:return:
"""
center = SkyCoordinate.from_pixel(rectangle.center, wcs)
# Get the pixelscale
radius = rectangle.radius * Unit("pix") * wcs.average_pixelscale
# Create a new SkyRectangle
return cls(center, radius, rectangle.angle, meta=rectangle.meta)
# -----------------------------------------------------------------
评论列表
文章目录