This file contains hidden or 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
Iä! |
This file contains hidden or 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
# This is the CMakeCache file. | |
# You'll have to modify all instances of /users/sth to your own user path | |
# Modified PYTHON_LIBRARY:FILEPATH setting: /Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib | |
# For build in directory: /Users/sth/dev/py_tesseract/release | |
# CMAKE_INSTALL_PREFIX:PATH=/usr/bin | |
# In order to use Python bindings, prepend /Users/sth/dev/py_tesseract/release:lib to $PYTHONPATH | |
# It was generated by CMake: /usr/local/Cellar/cmake/2.8.11.1/bin/cmake | |
# You can edit this file to change values found and used by cmake. | |
# If you do not want to change any of the values, simply exit the editor. | |
# If you do want to change a value, simply edit, save, and exit the editor. |
This file contains hidden or 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
import math | |
def bng(input_lat, input_lon): | |
""" | |
Convert WGS84 lat and long (ie. from GPS) to OSGB36 (BNG) | |
Expects two floats as input | |
Returns a tuple of Easting, Northing floats | |
Accurate to ~5m | |
For testing purposes: |
This file contains hidden or 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
# Courtesy of Charlie Loyd (@vruba), it's a black box for now | |
# Expects a dict of points, 'points' with keys 'Lat.', and 'Lon.' | |
from PIL import Image | |
from math import * | |
# these are London-specific | |
latrange = [51, 52] | |
lonrange = [-1, 1] | |
This file contains hidden or 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
""" | |
Extract GPS coordinates and filename, output to CSV file | |
Run this file from the same directory the images are in | |
run using ./process_exif.py or python process_exif.py, or | |
%run process_exif.py from an IPython instance | |
Ensure you have PIL installed | |
refer to http://www.exiv2.org/tags.html for a full detailed tag listing | |
This is what the GPSInfo dict looks like for an iPhone 5 jpg: |
This file contains hidden or 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
# requirements for Web-based iPython Notebook in Pylab mode | |
# includes all requirements for Pandas data analysis and plotting | |
# you should also easy_install readline | |
# USE A VIRTUALENV | |
# if on OS X, install XCode and command-line tools before attempting any of this | |
# I'm leaving out SciPy, because it's SUCH a pain to install | |
ipython | |
tornado | |
pyzmq | |
pandas |
This file contains hidden or 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
Traceback (most recent call last): | |
File "/Users/sth/dev/brockley_analytics/venv/bin/alembic", line 8, in <module> | |
load_entry_point('alembic==0.5.0', 'console_scripts', 'alembic')() | |
File "/Users/sth/dev/brockley_analytics/venv/lib/python2.7/site-packages/alembic/config.py", line 265, in main | |
CommandLine(prog=prog).main(argv=argv) | |
File "/Users/sth/dev/brockley_analytics/venv/lib/python2.7/site-packages/alembic/config.py", line 260, in main | |
self.run_cmd(cfg, options) | |
File "/Users/sth/dev/brockley_analytics/venv/lib/python2.7/site-packages/alembic/config.py", line 247, in run_cmd | |
**dict((k, getattr(options, k)) for k in kwarg) | |
File "/Users/sth/dev/brockley_analytics/venv/lib/python2.7/site-packages/alembic/command.py", line 123, in upgrade |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Output Elevation, Lat, Long, and Timestamp series from GPX to CSV | |
Requires gpxpy | |
This script expects your input GPX to be located in a subdir named 'data' | |
""" | |
import os |
This file contains hidden or 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 lazy_writer(): | |
with open("out.txt", "w") as o: | |
while True: | |
line = (yield) | |
# do whatever you like to line here | |
out = "%s%s\n" % (line, " added") | |
o.write(out) | |
wl = lazy_writer() | |
# initialise the coroutine before you send anything in |
This file contains hidden or 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
#!/usr/bin/env python | |
""" | |
2020 update: | |
- More iterators, fewer lists | |
- Python 3 compatible | |
- Processes files in parallel | |
(one thread per CPU, but that's not really how it works) | |
""" |