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 / 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 / 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]
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
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)
# %%
# %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
"""
===================================
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
@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/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */