Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error trying to use the function raw_to_bids #22

Closed
romquentin opened this issue Feb 14, 2018 · 8 comments · Fixed by #23
Closed

error trying to use the function raw_to_bids #22

romquentin opened this issue Feb 14, 2018 · 8 comments · Fixed by #23
Labels

Comments

@romquentin
Copy link
Contributor

Hi,
When using raw_to_bids to convert my CTF data:
raw_to_bids(subject_id='01', run='01', task='WM', raw_fname=raw_fname, events_fname=events_fname, output_path=output_path, event_id=event_id, overwrite=True)
I experienced this error:

TypeError                                 Traceback (most recent call last)
<ipython-input-84-1502beb8bad4> in <module>()
      2                     raw_fname=raw_fname, events_fname=events_fname,
      3                     output_path=output_path, event_id=event_id,
----> 4                     overwrite=True)

/Applications/anaconda/lib/python2.7/site-packages/mne_bids/bids_meg.pyc in raw_to_bids(subject_id, run, task, raw_fname, output_path, events_fname, event_id, hpi, electrode, hsp, config, overwrite, verbose)
    287 
    288     # save stuff
--> 289     _scans_tsv(raw, raw_fname_bids, scans_fname, verbose)
    290     _fid_json(raw, unit, orient, manufacturer, fid_fname, verbose)
    291     _meg_json(raw, task, manufacturer, meg_fname, verbose)

/Applications/anaconda/lib/python2.7/site-packages/mne_bids/bids_meg.pyc in _scans_tsv(raw, raw_fname, fname, verbose)
    106         meas_date = meas_date[0]
    107 
--> 108     acq_time = datetime.fromtimestamp(meas_date
    109                                       ).strftime('%Y-%m-%dT%H:%M:%S')
    110 

TypeError: a float is required

Do you have any ideas?
Thanks a lot
Romain

@jasmainak
Copy link
Member

In your raw file, can you tell me what do you get when you do raw.info['meas_date']?

@romquentin
Copy link
Contributor Author

I have nothing in raw.info['meas_date']. The total info is:

bads : list | 0 items
  buffer_size_sec : float64 | 2.0
  ch_names : list | USPT001, SCLK01-177, BG1-1609, BG2-1609, BG3-1609, ...
  chs : list | 307 items (REF_MEG: 28, STIM: 1, MISC: 6, MAG: 272)
  comps : list | 5 items
  ctf_head_t : Transform | 3 items
  custom_ref_applied : bool | False
  dev_ctf_t : Transform | 3 items
  dev_head_t : Transform | 3 items
  dig : list | 3 items
  events : list | 0 items
  experimenter : unicode | 8 items
  highpass : float | 0.0 Hz
  hpi_meas : list | 0 items
  hpi_results : list | 1 items
  lowpass : float | 600.0 Hz
  meas_id : dict | 4 items
  nchan : int | 307
  proc_history : list | 0 items
  projs : list | 0 items
  sfreq : float | 1200.0 Hz
  subject_info : dict | 1 items
  acq_pars : NoneType
  acq_stim : NoneType
  description : NoneType
  file_id : NoneType
  gantry_angle : NoneType
  hpi_subsystem : NoneType
  kit_system_id : NoneType
  line_freq : NoneType
  meas_date : NoneType
  proj_id : NoneType
  proj_name : NoneType
  xplotter_layout : NoneType

@jasmainak
Copy link
Member

okay, thanks for that. I know what to fix now. I'll let you know when it's fixed :-)

@romquentin
Copy link
Contributor Author

Hi,
Did you have time to look at it?
Thank you for your help!
Romain

@jasmainak
Copy link
Member

see #23

@romquentin
Copy link
Contributor Author

Thanks!

@jasmainak
Copy link
Member

@romquentin would you mind sharing your problematic CTF file? Thanks

@romquentin
Copy link
Contributor Author

Yes, you can find one CTF-MEG run here:
https://www.dropbox.com/s/5qkd9eyl9v4kf2y/CTFrun_01.ds.zip?dl=0
Let me know if you need anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants