Skip to content

Instantly share code, notes, and snippets.

View robintw's full-sized avatar

Robin Wilson robintw

View GitHub Profile
from scipy.odr import Model, Data, ODR
from orthoregress import f
mod = Model(f)
dat = Data(mcr.sample.B1, mcr.sample.B3)
od = ODR(dat, mod, beta0=[1.22,0.5])
od.run().beta
from orthoregress import orthoregress
import numpy as np
x = np.arange(5).astype(np.float64)
y = np.array([3.5, 2.7, 6.8, 5.6, 9.7]).astype(np.float64)
orthoregress(x, y)
# Copyright (c) 2013, Robin Wilson
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
import sys
import numpy as np
import gdal
from mycanny import mycanny
input_image = sys.argv[1]
print(input_image)
def make_ellipse(x, x0, y, y0, theta, a, b):
"""Creates an ellipse in an array.
Parameters:
x: Array resulting from meshgrid function
x0: Unused
y: Array resulting from meshgrid function
y0: Unused
theta: Angle of rotation of the ellipse, in radians
@robintw
robintw / bokeh_utils.py
Created December 1, 2015 22:04
Utilities for bokeh plotting
from bokeh.plotting import figure, ColumnDataSource
from bokeh.models import HoverTool
def scatter_with_hover(df, x, y,
fig=None, cols=None, name=None, marker='x', **kwargs):
"""
Plots an interactive scatter plot of `x` vs `y` using bokeh, with automatic
tooltips showing columns from `df`.
@robintw
robintw / bokeh_utils.py
Created December 2, 2015 19:03
Utilities for bokeh plotting
from bokeh.plotting import figure, ColumnDataSource
from bokeh.models import HoverTool
def scatter_with_hover(df, x, y,
fig=None, cols=None, name=None, marker='x', **kwargs):
"""
Plots an interactive scatter plot of `x` vs `y` using bokeh, with automatic
tooltips showing columns from `df`.
@robintw
robintw / bokeh_utils.py
Last active January 21, 2019 07:07
Bokeh Utils
from bokeh.plotting import figure, ColumnDataSource
from bokeh.models import HoverTool
def scatter_with_hover(df, x, y,
fig=None, cols=None, name=None, marker='x',
fig_width=500, fig_height=500, **kwargs):
"""
Plots an interactive scatter plot of `x` vs `y` using bokeh, with automatic
tooltips showing columns from `df`.
<a tabindex="-1" href="#" onclick="showTab1()">
<table id="t2">
<tbody><tr><td>
<button type="button" class="btn btn-primary" data-loading-text="Loading...">Academic or Research</button>
<button class="btn">Craft or Manual</button>
<button class="btn">Clerical</button>
<button class="btn">Master</button>
<button class="btn">PHD</button>
<button class="btn">Professional or Mangerial</button>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.