Skip to content

Instantly share code, notes, and snippets.

View s-kganz's full-sized avatar

Keenan Ganz s-kganz

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@s-kganz
s-kganz / earthaccess_geo_interface.ipynb
Created January 14, 2026 17:40
Plotting granules from earthaccess with geopandas
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@s-kganz
s-kganz / profile_earthaccess.py
Created May 16, 2025 23:01
Script to recreate open_rasterio leak on HLSL30 granules
import xarray as xr
import rasterio
import rioxarray
import gc
import earthaccess
assert(earthaccess.login(strategy="netrc").authenticated)
# Find a granule, load it into memory, take mean, call gc
gdal_config = {
@s-kganz
s-kganz / windowing_demo.ipynb
Created January 6, 2025 18:36
Windowing xarray data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@s-kganz
s-kganz / gist:9dea2e03af23e7d5d12cd0a7dee4b40d
Created May 10, 2024 18:48
TFDS UnicodeDecodeError stack trace
---------------------------------------------------------------------------
UnicodeDecodeError Traceback (most recent call last)
Cell In[10], line 1
----> 1 b = Builder()
File ~\miniconda3\envs\gee\lib\site-packages\tensorflow_datasets\core\logging\__init__.py:289, in builder_init.<locals>.decorator(function, dsbuilder, args, kwargs)
287 _thread_id_to_builder_init_count[metadata.thread_id] += 1
288 try:
--> 289 return function(*args, **kwargs)
290 except Exception:
@s-kganz
s-kganz / tagee_test.js
Created February 13, 2022 16:00
Compare JS and Python TAGEE implementations
var TAGEE = require('users/joselucassafanelli/TAGEE:TAGEE-functions');
var srtm = ee.Image("USGS/SRTMGL1_003");
var geom = ee.FeatureCollection(ee.Geometry.Rectangle(-111, 40, -110.9, 40.1));
// smooth the DEM
var gaussianFilter = ee.Kernel.gaussian({
radius: 3, sigma: 2, units: 'pixels', normalize: true
});
var srtmSmooth = srtm.convolve(gaussianFilter).resample("bilinear");
#: kivy 1.11.1
<MainLayout@BoxLayout>:
palindrome_label: palindrome_label
prime_label: prime_label
prime: 100000000
palindrome: 10000001
orientation: 'vertical'
BoxLayout:
orientation: 'horizontal'
@s-kganz
s-kganz / async.kv
Created July 20, 2020 04:33
Blocking Kivy application
#: kivy 1.11.1
<MainLayout@BoxLayout>:
palindrome_label: palindrome_label
prime_label: prime_label
prime: 100000000
palindrome: 10000001
orientation: 'vertical'
BoxLayout:
orientation: 'horizontal'
@s-kganz
s-kganz / libs.py
Created April 12, 2020 17:36
Starter code for Mad Libs in Python
# Get input from the user
noun = input("Give me a noun: ")
# Add the input to a template
line1 = "It's dangerous to go alone. Here, take this {}!".format(line1)
# Print the formatted template
print(line1)