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
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.
@kapadia
kapadia / landsat-pds-policy.json
Created July 15, 2016 18:18
landsat-pds bucket policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::000000000000:root"
},
"Action": [
"s3:ListBucket",
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Transfer L8 scenes on a periodic basis from USGS to S3 (landsat-pds).",
"Parameters": {
"Name": {
"Description": "Name used throughout the Cloudformation stack for various resource (e.g. Lambda Function, SQS).",
"Type": "String"
},
"Owner": {
"Description": "Owner of this application within an organization.",
#!/bin/bash
source /etc/profile
set -eou pipefail
function usage() {
echo ""
echo "Download a Landsat scene from USGS."
echo ""
echo "Usage: ./download-landsat [scene id]"
@kapadia
kapadia / l8-duplicates.ipynb
Created May 23, 2016 21:49
Examine duplicate L8 scenes
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.
@kapadia
kapadia / get_coordinates.py
Created April 29, 2016 20:42
Transform from pixel-space to world-space.
#!/usr/bin/env python
import argparse
import rasterio as rio
import rasterio.warp
def get_coordinates(srcpath, pixel):
with rio.open(srcpath) as src:
#!/bin/bash
set -eou pipefail
function usage() {
echo ""
echo "For a given L8 scene, get the top of atmosphere RGB image."
echo ""
echo "Usage: ./l8-toa.sh [entityId] [dstpath]"
echo ""
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.