This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am vgauthier on github. | |
* I am vgauthier (https://keybase.io/vgauthier) on keybase. | |
* I have a public key whose fingerprint is 2DFE B470 E2A1 97CB 4CE9 8CD2 9317 A153 5D11 CA80 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ipywidgets import FloatProgress | |
from IPython.display import display | |
import time | |
max_count = 100 | |
f = FloatProgress(min=0, max=max_count) # instantiate the bar | |
display(f) # display the bar | |
count = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def errorfill(x, y, yerr, color=None, alpha_fill=0.3, ax=None): | |
# Plot the standart error bar stolen from http://tonysyu.github.com/plotting-error-bars.html | |
ax = ax if ax is not None else plt.gca() | |
if color is None: | |
color = ax._get_lines.color_cycle.next() | |
if np.isscalar(yerr) or len(yerr) == len(y): | |
ymin = y - yerr | |
ymax = y + yerr | |
elif len(yerr) == 2: | |
ymin, ymax = yerr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def distance(lat1,lon1,lat2,lon2): | |
import math | |
# Earth Radius in KM | |
R = 6371 | |
dLat = math.radians(lat2-lat1); | |
dLon = math.radians(lon2-lon1); | |
lat1 = math.radians(lat1); | |
lat2 = math.radians(lat2); | |
a = math.sin(dLat/2) * math.sin(dLat/2) + math.sin(dLon/2) * math.sin(dLon/2) * math.cos(lat1) * math.cos(lat2) | |
c = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a)) |