Skip to content

Instantly share code, notes, and snippets.

View pblankenau2's full-sized avatar

Philip Blankenau pblankenau2

  • Idaho Department of Water Resources
View GitHub Profile
@sgillies
sgillies / geo_interface.rst
Last active March 4, 2025 10:09
A Python Protocol for Geospatial Data

Author: Sean Gillies Version: 1.0

Abstract

This document describes a GeoJSON-like protocol for geo-spatial (GIS) vector data.

Introduction

@seberg
seberg / rolling_window.py
Created October 10, 2012 14:38
Multidimensional rolling_window for numpy
def rolling_window(array, window=(0,), asteps=None, wsteps=None, axes=None, toend=True):
"""Create a view of `array` which for every point gives the n-dimensional
neighbourhood of size window. New dimensions are added at the end of
`array` or after the corresponding original dimension.
Parameters
----------
array : array_like
Array to which the rolling window is applied.
window : int or tuple
@schwehr
schwehr / gdal_geotiff_metadata.ipynb
Created February 22, 2013 19:57
Using gdal to read/write the metadata fields for a geotiff and for specific bands within the geotiff.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jqtrde
jqtrde / modern-geospatial-python.md
Last active August 1, 2023 14:50
Modern remote sensing image processing with Python
@lgarrison
lgarrison / high_performance_python.ipynb
Last active December 12, 2024 08:21
High-Performance Python, or When to Write For Loops in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@levand
levand / data-modeling.md
Last active January 1, 2025 10:49
Advice about data modeling in Clojure

Since it has come up a few times, I thought I’d write up some of the basic ideas around domain modeling in Clojure, and how they relate to keyword names and Specs. Firmly grasping these concepts will help us all write code that is simpler, cleaner, and easier to understand.

Clojure is a data-oriented language: we’re all familiar with maps, vectors, sets, keywords, etc. However, while data is good, not all data is equally good. It’s still possible to write “bad” data in Clojure.

“Good” data is well defined and easy to read; there is never any ambiguity about what a given data structure represents. Messy data has inconsistent structure, and overloaded keys that can mean different things in different contexts. Good data represents domain entities and a logical model; bad data represents whatever was convenient for the programmer at a given moment. Good data stands on its own, and can be reasoned about without any other knowledge of the codebase; bad data is deeply and tightly coupled to specific generating and

@sgillies
sgillies / advanced_rasterio_features.ipynb
Last active October 19, 2024 17:20
Advanced Rasterio features notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jakebrinkmann
jakebrinkmann / download_m2m.py
Last active April 12, 2024 12:42
Python module for straight-forward EarthExplorer Machine-to-Machine
"""
Data download script for EarthExplorer Machine-to-Machine
download_m2m('/path/to/downloads', username='user1234', dataset='ARD_TILE',
products='TOA,BT,SR,PQA', threads=40,
fields={'Region': 'CU', 'Spacecraft': 'LANDSAT_8'})
More M2M documentation: https://earthexplorer.usgs.gov/inventory/documentation
Author: Jake Brinkmann <[email protected]>
import sys
import httplib2
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
from oauth2client.service_account import ServiceAccountCredentials
from apiclient.http import MediaFileUpload
KEY_FILE='/.config/gclib/sa_key.json'
FT_SCOPE = 'https://www.googleapis.com/auth/fusiontables'
DRIVE_SCOPE = 'https://www.googleapis.com/auth/drive'
@mwaskom
mwaskom / palettes.png
Last active July 9, 2024 20:35
Show all seaborn palettes and simulate what they look like with various color vision deficiencies. (The 10-element seaborn palettes will be part of the forthcoming 0.9 release).
palettes.png