Skip to content

Instantly share code, notes, and snippets.

View WeatherGod's full-sized avatar

Benjamin Root WeatherGod

View GitHub Profile
@WeatherGod
WeatherGod / common_sigs.py
Created January 6, 2016 18:08
Common Sigs attempt
import numpy as np
import math
def CalcOffset(a, oom) :
if np.isinf(oom) :
return np.nan
minval = a.min()
if minval < 0.0 :
@WeatherGod
WeatherGod / check_env_AnatomyOfMatplotlib.py
Created July 2, 2014 14:40
Installation verification script for Anatomy of Matplotlib for SciPy 2014
from __future__ import print_function
import os
# make sure packages are available
import matplotlib
import numpy
if matplotlib.__version__ < "1.2.1":
print("Warning: mpl v1.2.1 or greater is desired."
@WeatherGod
WeatherGod / nxutils_leak_test.py
Created March 9, 2012 20:48
test script to demonstrate nxutils leak
import numpy as np
from matplotlib.nxutils import points_inside_poly
def polar2rect(azi, r) :
# trig is reversed because this is azimuth with 0 pointing north
x = np.sin(azi) * r
y = np.cos(azi) * r
return x, y
@WeatherGod
WeatherGod / README
Created March 6, 2012 22:05
finding sensible defaults for ffmpeg (aiming for cross-compatibility)
So, provided you have some image files of form "_tmp0000.png", you can run generate_movies.sh to create a "result.txt" file which contains a list of the files successfully generated.
Additional columns are used to indicate testing status: '1' (failed), '0' (successful), '0.5' (works, but serious artifacts), '?' (couldn't try).
The script will provide the first column by testing if the movie plays using ffplay. Note, no movie gets displayed to the screen, so this is fairly quick. I have included my "result.txt" file which contains testing results for additional platforms. Platforms are:
* LibreOffice Impress on Linux
* QuickTime on Mac
* MS Office PowerPoint on Mac
* OpenOffice Impress on Mac