Skip to content

Instantly share code, notes, and snippets.

View daleroberts's full-sized avatar

Dale Roberts daleroberts

View GitHub Profile
@daleroberts
daleroberts / fixholes.py
Created September 25, 2018 01:14
Fill in holes in data.
#!/usr/bin/env python3
import numpy as np
import gdal
import sys
MV = 8500
gdal.UseExceptions()
@daleroberts
daleroberts / kde.png
Last active August 12, 2022 17:15
Two-dimensional kernel density estimate: comparing scikit-learn and scipy
kde.png
@daleroberts
daleroberts / testmask.py
Last active May 27, 2016 00:00
Benchmarking various ways to mask an array based on a bitmask
# 8=no_contiguity, 9=sea, 10=cloud_acca, 11=cloud_fmask,
# 12=cloudshadow_acca, 13=cloudshadow_fmask, 14=toposhadow
import numpy as np
xsize, ysize, nbands = 4000, 4000, 6
# generate some test data
pq = np.zeros((xsize, ysize), dtype=np.uint16)
for bit in [9,8,11]: