Skip to content

Instantly share code, notes, and snippets.

View jhkennedy's full-sized avatar

Joseph H Kennedy jhkennedy

View GitHub Profile
@jhkennedy
jhkennedy / rotate.py
Last active February 6, 2024 21:18
NASA S3 Direct Access credential rotations
import boto3
import cachetools.func
import requests
# Set TTL to number of seconds to cache.
# For instance, 50 minutes so that credentials are refreshed at least 10 minutes
# before they're set to expire.
@cachetools.func.ttl_cache(ttl=60 * 50)
def get_s3_client(bearer_token):
@jhkennedy
jhkennedy / hydrosar-water-maps-on-demand.ipynb
Last active May 19, 2023 00:20
HydroSAR water extent and flood depth maps on demand
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jhkennedy
jhkennedy / using-hyp3-bgc-engineering.ipynb
Created February 1, 2023 16:48
HyP3 BGC Engineering Tutorial
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jhkennedy
jhkennedy / using-hyp3-cargill.ipynb
Created December 8, 2022 07:49
HyP3 Cargill tutorial
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jhkennedy
jhkennedy / using-azdwr-hyp3.ipynb
Created October 13, 2022 00:12
HyP3 AZ DWR tutorial
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jhkennedy
jhkennedy / asf-sbas-pairs.csv
Last active April 2, 2022 06:15
HyP3 AVO Tutorial
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 7 columns, instead of 2. in line 3.
Reference, Reference URL, Reference Perpendicular Baseline (meters),Secondary, Secondary URL, Secondary Perpendicular Baseline (meters),Pair Temporal Baseline (days)
S1A_IW_SLC__1SDV_20180102T043026_20180102T043054_019971_02203A_7C48,https://datapool.asf.alaska.edu/SLC/SA/S1A_IW_SLC__1SDV_20180102T043026_20180102T043054_019971_02203A_7C48.zip,73,S1B_IW_SLC__1SDV_20180108T042944_20180108T043012_009075_01038E_4D08,https://datapool.asf.alaska.edu/SLC/SB/S1B_IW_SLC__1SDV_20180108T042944_20180108T043012_009075_01038E_4D08.zip,-86,5
S1A_IW_SLC__1SDV_20180102T043026_20180102T043054_019971_02203A_7C48,https://datapool.asf.alaska.edu/SLC/SA/S1A_IW_SLC__1SDV_20180102T043026_20180102T043054_019971_02203A_7C48.zip,73,S1A_IW_SLC__1SDV_20180114T043026_20180114T043053_020146_0225C3_4FD5,https://datapool.asf.alaska.edu/SLC/SA/S1A_IW_SLC__1SDV_20180114T043026_20180114T043053_020146_0225C3_4FD5.zip,-1,12
S1B_IW_SLC__1SDV_20180108T042944_20180108T043012_009075_01038E_4D08,https://datapool.asf.alaska.edu/SLC/SB/S1B_IW_SLC__1SDV_
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python3
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Yang Lei, Jet Propulsion Laboratory
#November 2017
import argparse
import isce
import isceobj
import numpy as np
import shelve
@jhkennedy
jhkennedy / example.py
Created September 29, 2021 23:02
interview example code
def get_user(username):
db = get_db_conn()
cur = db.cursor()
cur.execute("select * from users")
results = cur.fetchall()
cur.close()
for rec in results:
if rec[1] == username:
@jhkennedy
jhkennedy / README.md
Last active June 11, 2021 17:45
ISCE2 build from source into OpenSARlab conda env

NOTE: Major revisions for OpenSARlab upgrade on June 10, 2021

OpenSARlab was upgraded with much better support for conda environments, which significantly simplifies setting up development environments. These instructions have changed accordingly.

Open a new terminal in OpenSARlab

new_terminal

Get ISCE2 and install into an isce2 conda environment