Skip to content

Instantly share code, notes, and snippets.

View cjayb's full-sized avatar

Christopher J. Bailey cjayb

  • Norlys
  • Denmark
View GitHub Profile
@cjayb
cjayb / obsidian-web-clipper.js
Last active January 24, 2022 15:53 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
"""
===================================
08. Record extracellular potentials
===================================
The main output of HNN simulations is the 'dipole' waveform, i.e., the net
intracellular current flowing in pyramidal cell apical dendrites. At the large
distances between cells and M/EEG sensors, this 'primary' current is the main
contributor to the measured fields. Close to the cells, the local field
potential (LFP) is the result of intracellular current leaking into the
# %%
# %matplotlib widget
import matplotlib.pyplot as plt
from matplotlib.colors import SymLogNorm
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import numpy as np
from neuron import h
from hnn_core.network_builder import load_custom_mechanisms
from hnn_core.lfp import _LFPElectrode
# %%
# %matplotlib widget
import matplotlib.pyplot as plt
from matplotlib.colors import SymLogNorm
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import numpy as np
from neuron import h
from hnn_core.network_builder import load_custom_mechanisms
from hnn_core.lfp import _LFPElectrode
import os.path as op
import tempfile
import hnn_core
from hnn_core import simulate_dipole, read_params, Network
hnn_core_root = op.dirname(hnn_core.__file__)
params_fname = op.join(hnn_core_root, 'param', 'default.json')
params = read_params(params_fname)
import os.path as op
import hnn_core
from hnn_core import read_params, Network
import matplotlib.pyplot as plt
from hnn_core.network_builder import NetworkBuilder
from hnn_core.network_builder import _simulate_single_trial
from neuron import h
import numpy as np
from scipy.optimize import curve_fit
@cjayb
cjayb / demo_baseline_renormalize.py
Last active February 12, 2021 11:10
Demonstrating effects of 'baseline_renormalize' in hnn-core
import numpy as np
import matplotlib.pyplot as plt
TSTOP = 5000.
recalc = True
m = 3.4770508e-3
b = -51.231085
# these values were fit over the range [750., 5000]
@cjayb
cjayb / psychopy_env.yaml
Last active January 5, 2017 11:38
Conda environment package specification for PsychoPy development
# NB on OS X, see psychopy/psychopy PR #1325 and Issue #1315
# To run psychopyApp.py, we need a framework python:
# python.app `which psychopyApp.py`
name: psychopy
channels: !!python/tuple
- defaults
- conda-forge
dependencies:
- CogSci::pygame=1.9.2a0=py27_0
- alabaster=0.7.9=py27_0
@cjayb
cjayb / walkthrough_PR_3461.ipynb
Created July 27, 2016 09:25
walkthrough_PR_3461 (notebook)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cjayb
cjayb / simulate_dipoles_to_evoked.py
Last active February 10, 2016 15:13
Dipole modeling and topomaps
from os import path as op
import numpy as np
# from scipy import linalg
import mne
data_path = mne.datasets.sample.data_path()
subjects_dir = op.join(data_path, 'subjects')
fname_ave = op.join(data_path, 'MEG', 'sample', 'sample_audvis-ave.fif')
fname_cov = op.join(data_path, 'MEG', 'sample', 'sample_audvis-cov.fif')