<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_position(self, skydir):
 """ Set the position of the source. Parameters skydir : `~astropy.coordinates.SkyCoord` """


        if not isinstance(skydir, SkyCoord):
            skydir = SkyCoord(ra=skydir[0], dec=skydir[1], unit=u.deg)

        if not skydir.isscalar:
            skydir = np.ravel(skydir)[0]

        radec = np.array([skydir.icrs.ra.deg, skydir.icrs.dec.deg])
        self._set_radec(radec)