Overwriting data in noise covariance matrix

Hi,

I'd like to replace the data in a noise covariance matrix structure, but
both cov.data = newcov and cov._data = newcov don't seem to work. How can I
generate a noise covariance matrix structure with a covariance matrix of my
choice?

Thanks and Best Regards,
Gladia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180203/0e67dc7b/attachment.html

can you share some code?

cov._data[:] = newcov

should work provided it has the correct shape.

Alex

I think that the covariance data is stored in the cov['data'] entry (as
Covariance subclasses the native dict object) as either a 2d array (most
common) or 1d array for diagonal type (uncommon).

Eric

Hi Eric and Alex,

cov['data'] = newcov worked; thank you!

cov._[:] = newcov returned an error: 'Covariance' object has no attribute
'data'.

Thanks!

Best,
Gladia