Skip to content

Instantly share code, notes, and snippets.

View kissmygritts's full-sized avatar
🚀

Mitchell Gritts kissmygritts

🚀
View GitHub Profile
from __future__ import annotations
from enum import Enum
from dataclasses import dataclass
from abc import ABC, abstractstaticmethod
import geopandas as gpd
# The current feature catalog class is doing a lot and feels overloaded.
# it's trying to be a factory/formatter class and a dataset class. I think
# we can split the dataset classes into a few separate concrete implementations
# of a FeatureCatalog abstract base class. This class will have it's own
@kissmygritts
kissmygritts / sqlalchemy_2_0.ipynb
Created September 4, 2023 18:28
sqlalchemy 2.0 changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kissmygritts
kissmygritts / masked_arrays.ipynb
Created August 25, 2023 18:23
example of masked and unmasked arrays and how they work with nodata values
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.
@kissmygritts
kissmygritts / ndvi-rewrite.ipynb
Created February 7, 2023 18:34
NDVI data wrangling
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.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kissmygritts
kissmygritts / alternate_raster_values.py
Created December 2, 2022 19:01
Create a raster with alternating 0 and 1 values for visualization
def alternate_raster_values(raster_filename, out_filename):
with rasterio.open(raster_filename, "r") as src:
data = src.read(1)
profile = src.profile
for i in range(data.shape[0]):
data[i] = 0
if i % 2 == 0:
data[i][1::2] = 1
else:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.