photutils/aperture/rectangle.py
def to_pixel(self, wcs):
        """
        Convert the aperture to a `RectangularAperture` 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.unit.physical_type == 'angle':
            w = (scale * self.w).to(u.pixel).value
            h = (scale * self.h).to(u.pixel).value
        else:
            # pixels
            w = self.w.value
            h = self.h.value

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

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

        return RectangularAperture(pixel_positions, w, h, theta)

        Convert the aperture to a `RectangularAperture` instance in
        pixel coordinates.
        
Convert the aperture to a `RectangularAperture` instance in
pixel coordinates.
Convert the aperture to a ` RectangularAperture ` 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.unit.physical_type == 'angle':
            w = (scale * self.w).to(u.pixel).value
            h = (scale * self.h).to(u.pixel).value
        else:
            w = self.w.value
            h = self.h.value
        theta = (angle + self.theta).to(u.radian).value
        pixel_positions = np.array([x, y]).transpose()
        return RectangularAperture(pixel_positions, w, h, 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 . unit . physical_type == 'angle' : w = ( scale * self . w ) . to ( u . pixel ) . value h = ( scale * self . h ) . to ( u . pixel ) . value else : w = self . w . value h = self . h . value theta = ( angle + self . theta ) . to ( u . radian ) . value pixel_positions = np . array ( [ x , y ] ) . transpose ( ) return RectangularAperture ( pixel_positions , w , h , theta )
Convert the aperture to a `RectangularAperture` instance in
pixel coordinates.
Convert the aperture to a ` RectangularAperture ` instance in pixel coordinates .
"""
        Convert the aperture to a `RectangularAperture` instance in
        pixel coordinates.
        """ # pixels
self
wcs