def _onset_to_seconds(raw, onset):
 meas_date = raw.info['meas_date']
 if (meas_date is None):
  meas_date = 0
 elif (not np.isscalar(meas_date)):
  if (len(meas_date) > 1):
   meas_date = (meas_date[0] + (meas_date[1] / 1000000.0))
  else:
   meas_date = meas_date[0]
 if (raw.annotations.orig_time is None):
  orig_time = meas_date
 else:
  orig_time = (raw.annotations.orig_time - raw._first_time)
 annot_start = ((orig_time - meas_date) + onset)
 return annot_start

def _onset_to_seconds ( raw , onset ) : meas_date = raw . info [ 'meas_date' ] if ( meas_date is None ) : meas_date = 0 elif ( not np . isscalar ( meas_date ) ) : if ( len ( meas_date ) > 1 ) : meas_date = ( meas_date [ 0 ] + ( meas_date [ 1 ] / 1000000.0 ) ) else : meas_date = meas_date [ 0 ] if ( raw . annotations . orig_time is None ) : orig_time = meas_date else : orig_time = ( raw . annotations . orig_time - raw . _first_time ) annot_start = ( ( orig_time - meas_date ) + onset ) return annot_start
helper function for adjusting onsets in relation to raw data .