This file contains 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
# also: https://pcjericks.github.io/py-gdalogr-cookbook/vector_layers.html#load-data-to-memory | |
# another, maybe better approach to this is to use the gdal 'MEM' driver and then use | |
# sds.ReadRaster() and sds.WriteRaster() to get at the bytes. | |
# >>> from osgeo import gdal | |
# >>> driver = gdal.GetDriverByName('MEM') | |
# >>> sds = driver.Create('', 200, 300, 4) | |
# >>> sds.ReadRaster() | |
# If specifying gzip encoding and transferring the image results via body this way, |
This file contains 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
#!/bin/bash | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
This file contains 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
""" Functions to drive algorithm execution in Apache Spark. | |
All coordinates are handled according to GeoJSON specifications. | |
http://geojson.org/geojson-spec.html""" | |
import geojson | |
import itertools | |
import math | |
def bbox(multipoint): |
This file contains 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 datetime import datetime | |
import d2d.user | |
import d2d.user.search | |
import d2d.notifications.send | |
#################################################################### | |
# Method 1, detach interface from implementation | |
# Indirectly reference dependencies from vals | |
#################################################################### |
This file contains 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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; Copyright (c) Rich Hickey. All rights reserved. | |
; The use and distribution terms for this software are covered by the | |
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php) | |
; which can be found in the file CPL.TXT at the root of this distribution. | |
; By using this software in any fashion, you are agreeing to be bound by | |
; the terms of this license. | |
; You must not remove this notice, or any other, from this software. | |
;dimensions of square world |
This file contains 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
@entrypoint.command() | |
@click.option('--x', '-x', required=True) | |
@click.option('--y', '-y', required=True) | |
@click.option('--acquired', '-a', required=True) | |
@click.option('--number', '-n', required=False, default=2500) | |
def changedetection(x, y, acquired, number=2500): | |
"""Run change detection for a tile over a time range and save results to Cassandra. | |
Args: | |
x (int): tile x coordinate |
This file contains 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
""" Compute compound interest given a rate, period and periodic rate increase | |
Args: | |
start: starting number | |
periods: compounding period | |
rate_growth: compounding rate growth rate | |
rate: starting compounding rate | |
Returns: | |
Final compounded value |
This file contains 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
(ns tmpclj.changedetection | |
(:require [clojure.spec.alpha :as s]) | |
(:gen-class)) | |
(s/def ::dates (s/coll-of int?)) | |
(s/def ::reds (s/coll-of float?)) | |
(s/def ::greens (s/coll-of float?)) | |
(s/def ::blues (s/coll-of float?)) | |
(s/def ::nirs (s/coll-of float?)) | |
(s/def ::swir1s (s/coll-of float?)) |
This file contains 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
(ns davidvhill) | |
(defn same-length? | |
[seqs] | |
(->> seqs (map count) | |
(into #{}) | |
count | |
(= 1))) |
This file contains 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
(require '[clojure.edn :as edn]) | |
;; props to didibus https://clojuredocs.org/clojure.core/num | |
(defn numberize | |
[value] | |
(edn/read-string value)) |
OlderNewer