def get_converted_psd(self, sides):
if sides == self.sides:<EOL><INDENT>return self.__psd<EOL><DEDENT>if self.datatype == '<STR_LIT>':<EOL><INDENT>assert sides != '<STR_LIT>',"<STR_LIT>"<EOL><DEDENT>if self.sides == '<STR_LIT>':<EOL><INDENT>logging.debug('<STR_LIT>')<EOL>if sides == '<STR_LIT>':<EOL><INDENT>logging.debug('<STR_LIT>')<EOL>newpsd = numpy.concatenate((self.psd[<NUM_LIT:0>:-<NUM_LIT:1>]/<NUM_LIT>, list(reversed(self.psd[<NUM_LIT:0>:-<NUM_LIT:1>]/<NUM_LIT>))))<EOL>newpsd[-<NUM_LIT:1>] = self.psd[-<NUM_LIT:1>]<EOL>newpsd[<NUM_LIT:0>] *= <NUM_LIT><EOL><DEDENT>elif sides == '<STR_LIT>':<EOL><INDENT>logging.debug('<STR_LIT>')<EOL>P0 = self.psd[<NUM_LIT:0>]<EOL>P1 = self.psd[-<NUM_LIT:1>]<EOL>newpsd = numpy.concatenate((self.psd[-<NUM_LIT:1>:<NUM_LIT:0>:-<NUM_LIT:1>]/<NUM_LIT>, self.psd[<NUM_LIT:0>:-<NUM_LIT:1>]/<NUM_LIT>))<EOL>newpsd[<NUM_LIT:0>] = P1<EOL><DEDENT><DEDENT>elif self.sides == '<STR_LIT>':<EOL><INDENT>logging.debug('<STR_LIT>')<EOL>if sides == '<STR_LIT>':<EOL><INDENT>logging.debug('<STR_LIT>')<EOL>midN = (len(self.psd)-<NUM_LIT:2>) / <NUM_LIT:2><EOL>newpsd = numpy.array(self.psd[<NUM_LIT:0>:int(midN)+<NUM_LIT:2>]*<NUM_LIT:2>)<EOL>newpsd[<NUM_LIT:0>] /= <NUM_LIT:2><EOL>newpsd[-<NUM_LIT:1>] = self.psd[-<NUM_LIT:1>]<EOL><DEDENT>elif sides == '<STR_LIT>':<EOL><INDENT>newpsd = stools.twosided_2_centerdc(self.psd)<EOL><DEDENT><DEDENT>elif self.sides == '<STR_LIT>': <EOL><INDENT>logging.debug('<STR_LIT>')<EOL>if sides == '<STR_LIT>':<EOL><INDENT>logging.debug('<STR_LIT>')<EOL>midN = int(len(self.psd) / <NUM_LIT:2>)<EOL>P1 = self.psd[<NUM_LIT:0>]<EOL>newpsd = numpy.append(self.psd[midN:]*<NUM_LIT:2>, P1)<EOL><DEDENT>elif sides == '<STR_LIT>':<EOL><INDENT>newpsd = stools.centerdc_2_twosided(self.psd)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>return newpsd<EOL>
This function returns the PSD in the **sides** format

        :param str sides: the PSD format in ['onesided', 'twosided', 'centerdc']
        :return: the expected PSD.

        .. doctest::

            from spectrum import *
            p = pcovar(marple_data, 15)
            centerdc_psd = p.get_converted_psd('centerdc')

        .. note:: this function does not change the object, in particular, it
            does not change the :attr:`psd` attribute. If you want to change
            the psd on the fly, change the attribute :attr:`sides`.