#NEWLINE# @ verbose #NEWLINE# def whiten_evoked( evoked , noise_cov , picks = None , diag = False , rank = None , scalings = None , verbose = None ) : #NEWLINE# #INDENT# "Whiten evoked data using given noise covariance.\n\n    Parameters\n    ----------\n    evoked : instance of Evoked\n        The evoked data\n    noise_cov : instance of Covariance\n        The noise covariance\n    picks : array-like of int | None\n        The channel indices to whiten. Can be None to whiten MEG and EEG\n        data.\n    diag : bool (default False)\n        If True, whiten using only the diagonal of the covariance.\n    rank : None | int | dict (default None)\n        Specified rank of the noise covariance matrix. If None, the rank is\n        detected automatically. If int, the rank is specified for the MEG\n        channels. A dictionary with entries 'eeg' and/or 'meg' can be used\n        to specify the rank for each modality.\n    scalings : dict | None (default None)\n        To achieve reliable rank estimation on multiple sensors,\n        sensors have to be rescaled. This parameter controls the\n        rescaling. If dict, it will override the\n        following default dict (default if None):\n\n            dict(mag=1e12, grad=1e11, eeg=1e5)\n\n    verbose : bool, str, int, or None\n        If not None, override default verbose level (see mne.verbose).\n\n    Returns\n    -------\n    evoked_white : instance of Evoked\n        The whitened evoked data.\n    " #NEWLINE# evoked = cp . deepcopy ( evoked ) #NEWLINE# if ( picks is None ) : #NEWLINE# #INDENT# picks = pick_types ( evoked . info , meg = True , eeg = True ) #NEWLINE# #UNINDENT# W = _get_whitener_data ( evoked . info , noise_cov , picks , diag = diag , rank = rank , scalings = scalings ) #NEWLINE# evoked . data [ picks ] = ( np . sqrt ( evoked . nave ) * np . dot ( W , evoked . data [ picks ] ) ) #NEWLINE# return evoked