hexer is cool. It's a new project by Howard Butler that makes hexagon binned files out of point files.
This worked on my system (OSX 10.9, git
via homebrew
)
git clone https://github.com/hobu/hexer.git
# 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 | |
# | |
# _ _ __ | |
# __ _ __ _ _ __| |__ (_)/ _|_ _ | |
# / _` |/ _` | '__| '_ \| | |_| | | | | |
#| (_| | (_| | | | |_) | | _| |_| | | |
# \__, |\__,_|_| |_.__/|_|_| \__, | | |
# |___/ |___/ | |
# | |
# |
#in this the index is (container,object,time) | |
data.unstack(level=0).unstack(level=0).plot(legend=False) |
hexer is cool. It's a new project by Howard Butler that makes hexagon binned files out of point files.
This worked on my system (OSX 10.9, git
via homebrew
)
git clone https://github.com/hobu/hexer.git
# 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. |
# 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 |
# 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/ |