mne.datasets.megsim.data_path(url, path=None, force_update=False, update_path=None, verbose=None)

Get path to local copy of MEGSIM dataset URL

This is a low-level function useful for getting a local copy of a remote MEGSIM dataset.


url : str

The dataset to use.

path : None | str

Location of where to look for the MEGSIM data storing location. If None, the environment variable or config parameter MNE_DATASETS_MEGSIM_PATH is used. If it doesn’t exist, the “mne-python/examples” directory is used. If the MEGSIM dataset is not found under the given path (e.g., as “mne-python/examples/MEGSIM”), the data will be automatically downloaded to the specified folder.

force_update : bool

Force update of the dataset even if a local copy exists.

update_path : bool | None

If True, set the MNE_DATASETS_MEGSIM_PATH in mne-python config to the given path. If None, the user is prompted.

verbose : bool, str, int, or None

If not None, override default verbose level (see mne.verbose).


path : list of str

Local paths to the given data files. If URL was a .fif file, this will be a list of length 1. If it was a .zip file, it may potentially be many files.


For example, one could do:

>>> from mne.datasets import megsim
>>> url = ''
>>> megsim.data_path(url, os.getenv('HOME') + '/datasets') 

And this would download the given MEGSIM data file to the ‘datasets’ folder, and prompt the user to save the ‘datasets’ path to the mne-python config, if it isn’t there already.

The MEGSIM dataset is documented in the following publication:
Aine CJ, Sanfratello L, Ranken D, Best E, MacArthur JA, Wallace T, Gilliam K, Donahue CH, Montano R, Bryant JE, Scott A, Stephen JM (2012) MEG-SIM: A Web Portal for Testing MEG Analysis Methods using Realistic Simulated and Empirical Data. Neuroinform 10:141-158