Skip to content

Instantly share code, notes, and snippets.

View kapadia's full-sized avatar
💭
eating a pecan bar

Amit Kapadia kapadia

💭
eating a pecan bar
View GitHub Profile

Benchmark Coefficients

name rank runs mean sd timesBaseline
cython 1 5 21.58 1.012 1.0
numba 2 5 76.7 1.635 3.55484625395
import sys
import requests
from requests.auth import HTTPBasicAuth
def go(username, password):
"""
Example of programmatically accessing Sentinel data.
:param username:
@kapadia
kapadia / to_rect.py
Last active August 29, 2015 14:26
Extract corner points from a GeoJSON features. I'm looking for a 🏡
#!/usr/bin/env python
import json
import click
import numpy as np
def get_corner_points(coordinates):
coords = np.array(coordinates)
@kapadia
kapadia / viirs-resource.md
Created August 4, 2015 16:45
VIIRS Resources
@kapadia
kapadia / get-reprocessed-landsat-scenes.sh
Last active August 29, 2015 14:26
Get a list of reprocessed Landsat scenes for a specified date range
usgs search --node EE LANDSAT_8 --start-date 2015-05-24 --end-date 2015-05-25 --geojson | \
jq '[ .features[] | { entityId: .properties.entityId, acquisitionDate: .properties.acquisitionDate , modifiedDate: .properties.modifiedDate } ]' | \
jq '[ .[] | select((.modifiedDate | fromdate) - (.acquisitionDate | fromdate) > 86400) ]'
@kapadia
kapadia / landsat-low-cloud.sh
Created July 21, 2015 17:59
Lowest cloud cover Landsat scene
# Select the Landsat scene with lowest cloud coverage, sans postgis
ls -1 *.tif | parallel "rio bounds {} | usgs search --node EE LANDSAT_8 --geojson --start-date 2015-06-01 --extended | jq '[.features[].properties]' | jq 'min_by(.extended[\"Scene Cloud Cover\"] | tonumber)' | jq '{ entityId: .entityId, planet: \"{.}\", cloud: .extended[\"Scene Cloud Cover\"] | tonumber }'" > {.}.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
set -eou pipefail
function usage() {
echo ""
echo "Test USGS download limit."
echo ""
echo "Usage: ./test-usgs-download-limit.sh"
echo ""