Skip to content

Instantly share code, notes, and snippets.

View urschrei's full-sized avatar
💭
🌒

Stephan Hügel urschrei

💭
🌒
View GitHub Profile
# https://www.mapbox.com/blog/processing-landsat-8/
task :landsat_2014 => :environment do
dirs = Dir["#{Rails.root.to_s}/db/initial/raster/*"].reject {|q| q =~ /tar\.gz/ }
dirs.each do |dir|
scene_id = dir.split("/")[-1]
[4,3,2].each do |band|
`gdalwarp -t_srs EPSG:3857 #{dir}/#{scene_id}_B#{band}.TIF #{dir}/#{scene_id}_B#{band}-projected.tif`
end
`convert -combine #{dir}/#{scene_id}_B{4,3,2}-projected.tif #{dir}/#{scene_id}_RGB-projected.tif && \
convert -channel B -gamma 0.925 -channel R -gamma 1.03 -channel RGB -sigmoidal-contrast 50x16% #{dir}/#{scene_id}_RGB-projected.tif #{dir}/#{scene_id}_RGB-projected-corrected.tif && \
#!/bin/bash
#
# _ _ __
# __ _ __ _ _ __| |__ (_)/ _|_ _
# / _` |/ _` | '__| '_ \| | |_| | | |
#| (_| | (_| | | | |_) | | _| |_| |
# \__, |\__,_|_| |_.__/|_|_| \__, |
# |___/ |___/
#
#
@Jim-Holmstroem
Jim-Holmstroem / gist:3187378
Created July 27, 2012 10:39
plot multiindex dataframes in pandas
#in this the index is (container,object,time)
data.unstack(level=0).unstack(level=0).plot(legend=False)
@tmcw
tmcw / hexer.md
Last active December 28, 2015 03:38
Hexer is Cool

hexer is cool. It's a new project by Howard Butler that makes hexagon binned files out of point files.

Building hexer

This worked on my system (OSX 10.9, git via homebrew)

git clone https://github.com/hobu/hexer.git
@kjordahl
kjordahl / GeoDataFrame.ipynb
Created November 9, 2013 17:01
working with GeoDataFrames in GeoPandas
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kjordahl
kjordahl / GeoSeries.ipynb
Created November 9, 2013 17:02
Working with GeoSeries in GeoPandas
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danielballan
danielballan / leheny.mplstyle
Last active August 3, 2016 14:13
Leheny Lab "House Style" for Python matplotlib plots
# This is Dan Allan's setting of Professor Robert Leheny's plotting style preferences.
# Updated October 2014
#
# Invoke in Python matplotlib like so:
#
# import matplotlib as mpl
#
# mpl.style.use('https://gist.github.com/danielballan/be066529de85e87a5fe7/raw')
#
# This feature is only available in matplotlib version 1.4 or higher.
@sgillies
sgillies / even-more-functional.py
Created February 22, 2012 19:27
Functional style geoprocessing with Fiona, pyproj, Shapely
# Example of using Fiona, pyproj, and Shapely together in a functional
# style.
import functools
import itertools
import logging
import sys
import fiona
from pyproj import Proj, transform
@kjordahl
kjordahl / citibike.ipynb
Last active February 16, 2017 03:13
Citibike data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dwtkns
dwtkns / l8get
Last active October 1, 2017 20:19
A shell function to quickly grab the data for a given Landsat 8 tile ID from Google's servers
# This is a shell function to quickly grab the data for a given Landsat 8 tile ID from Google's servers
# For example:
# l8get LC81690352014169LGN00
# The echo at the end is to remind myself of the syntax for extracting bands 8, 4, 3, and 2. (Pansharp, Red, Green, Blue)
# On OSX this would go into your ~/.bash_profile file.
# Requires gsutil from https://developers.google.com/storage/docs/gsutil_install
# Most useful in conjunction with USGS' Earth Explorer: http://earthexplorer.usgs.gov/