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
# condensed version of Larkin's delentropy modification from | |
# https://gist.github.com/mxmlnkn/5a225478bc576044b035ad4a45c54f73 | |
import numpy as np | |
def delentropy(image): | |
# Using a 2x2 difference kernel [[-1,+1],[-1,+1]] results in artifacts! | |
# In tests the deldensity seemed to follow a diagonal because of the | |
# assymetry introduced by the backward/forward difference |
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
# -*- coding: utf-8 -*- | |
import pandas as pd | |
import sqlalchemy | |
def dump_table_to_sqllite(srcEngine, srcTable, dest_path, | |
chunksize = 20): | |
"""Dump a table from a source DB to a sqllite DB. Useful to cache often-used-data locally. | |
Parameters | |
---------- |
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
from shapely.ops import cascaded_union, polygonize | |
from scipy.spatial import Delaunay | |
import numpy as np | |
import math | |
import shapely.geometry as geometry | |
import matplotlib.pyplot as plt | |
#Source: https://sgillies.net/2012/10/13/the-fading-shape-of-alpha.html | |
class ConcaveHull(): |