@testing.requires_testing_data
def test_acqparser_averaging():
 raw = read_raw_fif(fname_raw_elekta, preload=True)
 acqp = AcqParserFIF(raw.info)
 for cat in acqp.categories:
  cond = acqp.get_condition(raw, cat)
  eps = Epochs(raw, baseline=((-0.05), 0), **cond)
  ev = eps.average()
  ev_ref = read_evokeds(fname_ave_elekta, cat['comment'], baseline=((-0.05), 0), proj=False)
  ev_mag = ev.copy()
  ev_mag.pick_channels(['MEG0111'])
  ev_grad = ev.copy()
  ev_grad.pick_channels(['MEG2643', 'MEG1622'])
  ev_ref_mag = ev_ref.copy()
  ev_ref_mag.pick_channels(['MEG0111'])
  ev_ref_grad = ev_ref.copy()
  ev_ref_grad.pick_channels(['MEG2643', 'MEG1622'])
  assert_allclose(ev_mag.data, ev_ref_mag.data, rtol=0, atol=1e-15)
  assert_allclose(ev_grad.data, ev_ref_grad.data, rtol=0, atol=1e-13)

@ testing . requires_testing_data def test_acqparser_averaging ( ) : raw = read_raw_fif ( fname_raw_elekta , preload = True ) acqp = AcqParserFIF ( raw . info ) for cat in acqp . categories : cond = acqp . get_condition ( raw , cat ) eps = Epochs ( raw , baseline = ( ( - 0.05 ) , 0 ) , ** cond ) ev = eps . average ( ) ev_ref = read_evokeds ( fname_ave_elekta , cat [ 'comment' ] , baseline = ( ( - 0.05 ) , 0 ) , proj = False ) ev_mag = ev . copy ( ) ev_mag . pick_channels ( [ 'MEG0111' ] ) ev_grad = ev . copy ( ) ev_grad . pick_channels ( [ 'MEG2643' , 'MEG1622' ] ) ev_ref_mag = ev_ref . copy ( ) ev_ref_mag . pick_channels ( [ 'MEG0111' ] ) ev_ref_grad = ev_ref . copy ( ) ev_ref_grad . pick_channels ( [ 'MEG2643' , 'MEG1622' ] ) assert_allclose ( ev_mag . data , ev_ref_mag . data , rtol = 0 , atol = 1e-15 ) assert_allclose ( ev_grad . data , ev_ref_grad . data , rtol = 0 , atol = 1e-13 )
test averaging with acqparserfif vs .