MCPcopy
hub / github.com/mne-tools/mne-python / get_avg_op

Method get_avg_op

mne/preprocessing/maxwell.py:882–904  ·  view source on GitHub ↗

Apply an average transformation over the next interval.

(self, *, start, stop)

Source from the content-addressed store, hash-verified

880 self.last_avg_quat = np.nan * np.ones(6)
881
882 def get_avg_op(self, *, start, stop):
883 """Apply an average transformation over the next interval."""
884 n_positions, avg_quat = _trans_lims(self.pos, start, stop)[1:]
885 if not np.allclose(avg_quat, self.last_avg_quat, atol=1e-7):
886 self.last_avg_quat = avg_quat
887 avg_trans = np.vstack(
888 [
889 np.hstack([quat_to_rot(avg_quat[:3]), avg_quat[3:][:, np.newaxis]]),
890 [[0.0, 0.0, 0.0, 1.0]],
891 ]
892 )
893 S_decomp_st, _, pS_decomp_st, _, n_use_in_st = self.get_decomp(
894 avg_trans, t=start / self.sfreq
895 )
896 self.op_in_avg = np.dot(
897 S_decomp_st[:, :n_use_in_st], pS_decomp_st[:n_use_in_st]
898 )
899 self.op_resid_avg = (
900 np.eye(len(self.op_in_avg))
901 - self.op_in_avg
902 - np.dot(S_decomp_st[:, n_use_in_st:], pS_decomp_st[n_use_in_st:])
903 )
904 return self.op_in_avg, self.op_resid_avg, n_positions
905
906 def feed(self, data, good_mask, st_only):
907 n_samp = data.shape[1]

Callers 1

_do_tSSS_on_avg_transFunction · 0.80

Calls 2

_trans_limsFunction · 0.85
quat_to_rotFunction · 0.85

Tested by

no test coverage detected