@staticmethod<EOL><INDENT>def sky_to_image(shape_list, header):<DEDENT>
for shape, comment in shape_list:<EOL><INDENT>if isinstance(shape, Shape) and(shape.coord_format not in image_like_coordformats):<EOL><INDENT>new_coords = convert_to_imagecoord(shape, header)<EOL>l1n = copy.copy(shape)<EOL>l1n.coord_list = new_coords<EOL>l1n.coord_format = "<STR_LIT:image>"<EOL>yield l1n, comment<EOL><DEDENT>elif isinstance(shape, Shape) and shape.coord_format == "<STR_LIT>":<EOL><INDENT>if header is None:<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>new_coordlist = convert_physical_to_imagecoord(shape, header)<EOL>l1n = copy.copy(shape)<EOL>l1n.coord_list = new_coordlist<EOL>l1n.coord_format = "<STR_LIT:image>"<EOL>yield l1n, comment<EOL><DEDENT>else:<EOL><INDENT>yield shape, comment<EOL><DEDENT><DEDENT>
Converts a `ShapeList` into shapes with coordinates in image coordinates

        Parameters
        ----------
        shape_list : `pyregion.ShapeList`
            The ShapeList to convert
        header : `~astropy.io.fits.Header`
            Specifies what WCS transformations to use.

        Yields
        -------
        shape, comment : Shape, str
            Shape with image coordinates and the associated comment

        Note
        ----
        The comments in the original `ShapeList` are unaltered