<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def psd(self, fftlength=None, overlap=None, window='hann', method=DEFAULT_FFT_METHOD, **kwargs):
 """Calculate the PSD `FrequencySeries` for this `TimeSeries` Parameters fftlength : `float` number of seconds in single FFT, defaults to a single FFT covering the full duration overlap : `float`, optional number of seconds of overlap between FFTs, defaults to the recommended overlap for the given window (if given), or 0 window : `str`, `numpy.ndarray`, optional window function to apply to timeseries prior to FFT, see :func:`scipy.signal.get_window` for details on acceptable formats method : `str`, optional FFT-averaging method, see *Notes* for more details **kwargs other keyword arguments are passed to the underlying PSD-generation method Returns ------- psd : `~gwpy.frequencyseries.FrequencySeries` a data series containing the PSD. Notes ----- The accepted ``method`` arguments are: - ``'bartlett'`` : a mean average of non-overlapping periodograms - ``'median'`` : a median average of overlapping periodograms - ``'welch'`` : a mean average of overlapping periodograms """

        # get method
        method_func = spectral.get_method(method)

        # calculate PSD using UI method
        return spectral.psd(self, method_func, fftlength=fftlength,
                            overlap=overlap, window=window, **kwargs)