Skip to content

Instantly share code, notes, and snippets.

import h5py
import numpy as np
def main():
data = read_segment_h5_files()
np.save("osc_data", data)
def read_segment_h5_files(input_basename="ch", n_channel=4):
def ellipse_fit(x, y):
def ellipse_err(p, x, y):
return (x-p[0])**2/p[2]**2 + (y-p[1])**2/p[3]**2 - 1
p = [0]*4
p[0] = np.mean(x)
p[1] = np.mean(y)
p[2] = np.max(np.max(x)-p[0], p[0]-np.min(x))
p[3] = np.max(np.max(y)-p[1], p[1]-np.min(y))
#!/bin/sh
for file in "$@"; do
if test "${file##*.}" = "svg" -a \( ! -e "${file%.svg}.eps" -o "$file" -nt "${file%.svg}.eps" \)
then
inkscape "$file" -E "${file%.svg}.eps"
fi
done