Skip to content

Instantly share code, notes, and snippets.

View cboulay's full-sized avatar

Chadwick Boulay cboulay

  • The Ottawa Hospital Research Institute
  • Ottawa, Canada
  • X @chadBoulay
View GitHub Profile
@cboulay
cboulay / pylsl_flush_v_pull.py
Last active April 26, 2021 21:17
Test pylsl flush vs pull_chunks gets correct timestamps with postproc enabled
import pylsl
import numpy as np
import time
import sys, os
T_TOTAL = 70
T_SWITCH = 11.1
@cboulay
cboulay / test_trainable_prior.py
Last active June 19, 2024 15:50
Some testing code for tensorflow-probability trainable priors
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow.keras.layers as tfkl
from tensorflow.keras import backend as K
import tensorflow_probability as tfp
tfd = tfp.distributions
tfpl = tfp.layers
tfb = tfp.bijectors
@cboulay
cboulay / replay_pupil_data.py
Last active July 21, 2019 08:04
A script to replay pupil-labs/hmd-eyes data to trigger calibration and gaze processing
import os
import zmq
from time import sleep, time
import numpy as np
import sys
sys.path.append('E:\SachsLab\Tools\VR\Pupil\pupil')
import pupil_src.shared_modules.file_methods as fm
from pupil_src.shared_modules import zmq_tools
@cboulay
cboulay / scipy_filt_axes.py
Last active January 10, 2018 15:46
Example showing processing time difference for filtering numpy signals along different axes.
import numpy as np
from scipy import signal
fs = 30000 # Hz
n_chans = 100
sig_dur = 300.0 # seconds
lp_cutoff = 250 # Hz
lp_order = 8
sig_freq_low = 14 # Frequency of sine wave in signal
sig_amp_low = 10.0 # Amplitude of sine wave in signal