<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def make_wcs(self, naxis=2, proj='CAR', energies=None, oversample=2):
 """ Make a WCS projection appropirate for this HPX pixelization """

        w = WCS(naxis=naxis)
        skydir = self.get_ref_dir(self._region, self.coordsys)

        if self.coordsys == 'CEL':
            w.wcs.ctype[0] = 'RA---%s' % (proj)
            w.wcs.ctype[1] = 'DEC--%s' % (proj)
            w.wcs.crval[0] = skydir.ra.deg
            w.wcs.crval[1] = skydir.dec.deg
        elif self.coordsys == 'GAL':
            w.wcs.ctype[0] = 'GLON-%s' % (proj)
            w.wcs.ctype[1] = 'GLAT-%s' % (proj)
            w.wcs.crval[0] = skydir.galactic.l.deg
            w.wcs.crval[1] = skydir.galactic.b.deg
        else:
            raise Exception('Unrecognized coordinate system.')

        pixsize = get_pixel_size_from_nside(self.nside)
        roisize = self.get_region_size(self._region)
        allsky = False
        if roisize > 45:
            roisize = 90
            allsky = True

        npixels = int(2. * roisize / pixsize) * oversample
        crpix = npixels / 2.

        if allsky:
            w.wcs.crpix[0] = 2 * crpix
            npix = (2 * npixels, npixels)
        else:
            w.wcs.crpix[0] = crpix
            npix = (npixels, npixels)

        w.wcs.crpix[1] = crpix
        w.wcs.cdelt[0] = -pixsize / oversample
        w.wcs.cdelt[1] = pixsize / oversample

        if naxis == 3:
            w.wcs.crpix[2] = 1
            w.wcs.ctype[2] = 'Energy'
            if energies is not None:
                w.wcs.crval[2] = 10 ** energies[0]
                w.wcs.cdelt[2] = 10 ** energies[1] - 10 ** energies[0]

        w = WCS(w.to_header())
        wcs_proj = WCSProj(w, npix)
        return wcs_proj