Skip to content

Instantly share code, notes, and snippets.

@pravsripad
pravsripad / jumeg.yml
Last active April 22, 2020 11:10
Conda jumeg environment (default)
name: jumeg
channels:
- defaults
dependencies:
- python<3.7
- pip
- ipython
- mkl
- numpy
- scipy
@pravsripad
pravsripad / jumeg_cuda.yml
Last active April 22, 2020 11:10
Conda jumeg environment (with GPU)
name: jumeg_cuda
channels:
- defaults
dependencies:
- python<3.7
- pip
- ipython
- mkl
- numpy
- scipy
@pravsripad
pravsripad / plot_show_ica_bug.py
Last active November 23, 2017 10:18
Example script showing the ctps / ica bug in mne-python
import mnedev as mne
from mnedev.preprocessing import ICA, create_ecg_epochs
from mnedev.datasets import sample
print(__doc__)
print mne.__version__
# Read and preprocess the data. Preprocessing consists of:
#
# -*- coding: utf-8 -*-
#!/usr/bin/env python
import telepot
import yaml
from rss_gumpu import parse_prep_feed
with open('/home/user/.my_config.yaml', 'r') as myfile:
uconfig = yaml.load(myfile)
@pravsripad
pravsripad / telegram_alerts.py
Created July 24, 2017 11:27
Telegram Alert
#!/usr/bin/env python
'''
Script to send alerts/messages to telegram.
e.g. ssh login alerts etc.
'''
import sys
import yaml
import telepot
@pravsripad
pravsripad / read_chop_raw_data.py
Created September 22, 2016 07:46
Script to read raw data, epoch it into arbitrary events and save it.
#!/usr/bin/env python
'''
Script to read raw data, epoch it into arbitrary events and save it.
- pravsripad@gmail.com
'''
import numpy as np
import mne
@pravsripad
pravsripad / psd_plot.py
Created September 22, 2016 07:44
Script to plot Power Spectral Density (PSD) from raw data.
#!/usr/bin/env python
# import the necessary packages
import numpy as np
import mne
import matplotlib.pyplot as pl
import sys
# turn interactive plotting on
pl.ion()
@pravsripad
pravsripad / visualize_3d_head_surfaces.py
Created November 12, 2015 08:52
Source space observations
#!/usr/bin/env python
'''
Load a surface and visualize it using Mayavi.
'''
import mne
from mayavi import mlab
# The surfaces are usually located in $SUBJECTS_DIR/$SUBJECT/surf/*
@pravsripad
pravsripad / mutual_information.py
Created October 1, 2015 15:59
Compute average mi and xcross across the data.
import numpy as np
import pyunicorn
import matplotlib.pyplot as pl
pl.ion()
data = np.load('all_fmri_data.npy')
mi_all = np.zeros((10, 90, 90))
xcorr_all = np.zeros((10, 90, 90))
from pyunicorn import funcnet
@pravsripad
pravsripad / fmri_recurrence.py
Created September 30, 2015 15:26
compute recurrence in networks
import numpy as np
from pyunicorn.timeseries import RecurrenceNetwork
from matplotlib import pyplot as pl
from mpl_toolkits.mplot3d import Axes3D
# Loading the data for 1 subject
data = np.load('all_fmri_data.npy')[0]
pl.plot(data)
pl.show()