coganlab / IEEG_Pipelines

A repo of current preprocessing methods for the Cogan Lab
https://ieeg-pipelines.readthedocs.io/en/latest/
MIT License
4 stars 2 forks source link

wavelet_scaleogram typeerror #104

Closed jimzhang629 closed 7 months ago

jimzhang629 commented 7 months ago

wavelet_scaleogram function error https://github.com/coganlab/IEEG_Pipelines/blob/main/ieeg/timefreq/utils.py


TypeError Traceback (most recent call last) Cell In[4], line 74 72 # print("base trials shape is: " + str(trials._data.shape)) 73 outliers_to_nan(trials, outliers=10) ---> 74 base = wavelet_scaleogram(trials, n_jobs=1, decim=int(good.info['sfreq'] / 100)) 75 crop_pad(base, "0.5s") 78 print("done with base")

File :10, in wavelet_scaleogram(inst, f_low, f_high, k0, n_jobs, decim, verbose)

File ~\Desktop\GlobalLocal\IEEG_Pipelines\ieeg\timefreq\utils.py:152, in wavelet_scaleogram(inst, f_low, f_high, k0, n_jobs, decim, verbose) 96 @verbose 97 def wavelet_scaleogram(inst: BaseEpochs, f_low: float = 2, 98 f_high: float = 1000, k0: int = 6, n_jobs: int = 1, 99 decim: int = 1, verbose=10) -> EpochsTFR: 100 """Compute the wavelet scaleogram. 101 102 (...) 150 151 """ --> 152 data = inst.get_data(copy=False) 154 f = np.fft.fft(data - np.mean(data, axis=-1, keepdims=True)) 156 daughter, period = calculate_wavelets(inst.info['sfreq'], f_high, f_low, 157 data.shape[-1], k0)

TypeError: BaseEpochs.get_data() got an unexpected keyword argument 'copy'

need to set data = inst.get_data() instead of data = inst.get_data(copy=False) to make this work