Skip to content

Instantly share code, notes, and snippets.

View alexlib's full-sized avatar
:octocat:
Working

Alex Liberzon alexlib

:octocat:
Working
View GitHub Profile
This file has been truncated, but you can view the full file.
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@alexlib
alexlib / 0_reuse_code.js
Created June 5, 2014 05:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
{
"metadata": {
"name": "numpy_tricks"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexlib
alexlib / loadpivlabtxt.m
Created June 8, 2014 20:15
Load PIVLab txt files into PIVMAT toolbox, based on the original loadpivtxt.m by F. Moisy
function v = loadpivlabtxt(fname)
%LOADPIVLABTXT Load a vector field exported in text format
% V = LOADPIVLABTXT(FILENAME) loads a vector field FILENAME saved in text
% format (TXT or DAT) into the structure V. Accepted file formats are:
% .TXT, exported from DaVis (LaVision)
% .DAT, from VidPIV (Oxford Laser)
%
% The fields of the structure V are the same as for LOADVEC, except the
% field V.Attributes, which contains the first line of the text file
% FILENAME.
{
"metadata": {
"name": "",
"signature": "sha256:ae12cadbe088aa2df4c44761da5172223e468a824bc68e52b427b2314b428942"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
/* Change code font */
.CodeMirror pre{
font-family: 'Source Code Pro', Consolas, monocco, monospace;
}
/* Change input prompt size */
div.input{
/*width: 105ex;*/
}
@alexlib
alexlib / batch_processing_openpiv.py
Created July 7, 2014 08:18
batch processing of PIV images in several directories using multiprocessing, using OpenPIV (www.openpiv.net)
import sys, os, glob
sys.path.append(os.path.abspath(r'D:\OpenPIV\OpenPIV-0.11'))
import openpiv.tools
import openpiv.process
import openpiv.scaling
import openpiv.preprocess
import numpy as np
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexlib
alexlib / figimage.py
Last active August 29, 2015 14:06 — forked from letmaik/figimage.py
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
def loadFigImage(path):
im = mpimg.imread(path)
h,w = im.shape[0], im.shape[1]
dpi = 80
fig = plt.figure(figsize=(w/dpi, h/dpi), dpi=dpi)
ax = plt.Axes(fig, [0, 0, 1, 1])
ax.set_xlim(0, w)