def test_calculate_head_pos_ctf(): """Test extracting of cHPI positions from CTF data.""" raw = read_raw_ctf(ctf_chpi_fname) chpi_locs = extract_chpi_locs_ctf(raw) quats = compute_head_pos(raw.info, chpi_locs) mc_quats = read_head_pos(ctf_chpi_pos_fname) mc_quats[:, 9] /= 10000 # had old factor in there twice somehow... _assert_quats(quats, mc_quats, dist_tol=0.004, angle_tol=2.5, err_rtol=1., vel_atol=7e-3) # 7 mm/s plot_head_positions(quats, info=raw.info) raw = read_raw_fif(ctf_fname) with pytest.raises(RuntimeError, match='Could not find'): extract_chpi_locs_ctf(raw)
def calculate_head_pos_ctf(raw): """Wrap to facilitate API change.""" chpi_locs = extract_chpi_locs_ctf(raw) return compute_head_pos(raw.info, chpi_locs)