photutils/aperture/rectangle.py
def to_pixel(self, wcs):
        """
        Convert the aperture to a `EllipticalAnnulus` instance in pixel
        coordinates.
        """

        x, y = skycoord_to_pixel(self.positions, wcs,
                                 mode=skycoord_to_pixel_mode)
        central_pos = SkyCoord([wcs.wcs.crval], frame=self.positions.name,
                               unit=wcs.wcs.cunit)
        xc, yc, scale, angle = skycoord_to_pixel_scale_angle(central_pos, wcs)

        if self.w_in.unit.physical_type == 'angle':
            w_in = (scale * self.w_in).to(u.pixel).value
            w_out = (scale * self.w_out).to(u.pixel).value
            h_out = (scale * self.h_out).to(u.pixel).value
        else:
            # pixels
            w_in = self.w_in.value
            w_out = self.w_out.value
            h_out = self.h_out.value

        theta = (angle + self.theta).to(u.radian).value

        pixel_positions = np.array([x, y]).transpose()

        return RectangularAnnulus(pixel_positions, w_in, w_out, h_out, theta)

        Convert the aperture to a `EllipticalAnnulus` instance in pixel
        coordinates.
        
Convert the aperture to a `EllipticalAnnulus` instance in pixel
coordinates.
Convert the aperture to a ` EllipticalAnnulus ` instance in pixel coordinates .
def to_pixel(self, wcs):
        x, y = skycoord_to_pixel(self.positions, wcs,
                                 mode=skycoord_to_pixel_mode)
        central_pos = SkyCoord([wcs.wcs.crval], frame=self.positions.name,
                               unit=wcs.wcs.cunit)
        xc, yc, scale, angle = skycoord_to_pixel_scale_angle(central_pos, wcs)
        if self.w_in.unit.physical_type == 'angle':
            w_in = (scale * self.w_in).to(u.pixel).value
            w_out = (scale * self.w_out).to(u.pixel).value
            h_out = (scale * self.h_out).to(u.pixel).value
        else:
            w_in = self.w_in.value
            w_out = self.w_out.value
            h_out = self.h_out.value
        theta = (angle + self.theta).to(u.radian).value
        pixel_positions = np.array([x, y]).transpose()
        return RectangularAnnulus(pixel_positions, w_in, w_out, h_out, theta)
def to_pixel ( self , wcs ) : x , y = skycoord_to_pixel ( self . positions , wcs , mode = skycoord_to_pixel_mode ) central_pos = SkyCoord ( [ wcs . wcs . crval ] , frame = self . positions . name , unit = wcs . wcs . cunit ) xc , yc , scale , angle = skycoord_to_pixel_scale_angle ( central_pos , wcs ) if self . w_in . unit . physical_type == 'angle' : w_in = ( scale * self . w_in ) . to ( u . pixel ) . value w_out = ( scale * self . w_out ) . to ( u . pixel ) . value h_out = ( scale * self . h_out ) . to ( u . pixel ) . value else : w_in = self . w_in . value w_out = self . w_out . value h_out = self . h_out . value theta = ( angle + self . theta ) . to ( u . radian ) . value pixel_positions = np . array ( [ x , y ] ) . transpose ( ) return RectangularAnnulus ( pixel_positions , w_in , w_out , h_out , theta )
Convert the aperture to a `EllipticalAnnulus` instance in pixel
coordinates.
Convert the aperture to a ` EllipticalAnnulus ` instance in pixel coordinates .
"""
        Convert the aperture to a `EllipticalAnnulus` instance in pixel
        coordinates.
        """ # pixels
self
wcs