Skip to content

Instantly share code, notes, and snippets.

View brendanjmeade's full-sized avatar

Brendan Meade brendanjmeade

View GitHub Profile
@brendanjmeade
brendanjmeade / cartopy_coastlines.py
Created August 7, 2025 19:38
Plotting coastlines
import matplotlib.pyplot as plt
import cartopy.io.shapereader as shpreader
from shapely.geometry import Polygon, MultiPolygon, box
import matplotlib.patches as mpatches
import matplotlib.collections as mc
from shapely.geometry import LineString, MultiLineString, GeometryCollection
def plot_land(lon_min, lat_min, lon_max, lat_max):
"""Plot filled gray land within the given extent using plt."""
@brendanjmeade
brendanjmeade / shaded_relief.ipynb
Created July 10, 2025 17:11
shaded relief in matplotlib with srtm.py
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brendanjmeade
brendanjmeade / strain_energy.ipynb
Created May 5, 2025 22:01
Schematic distance scaling for stress and strain energy near a 2D infinitely long strike slip fault
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brendanjmeade
brendanjmeade / dem_inertial_vs_non_inertial.py
Created May 1, 2025 12:47
Inertial vs. non-inertial DEMs (gravitational settling)
"""
Inertial vs. non-inertial DEMs (gravitational settling)
This file implements a Discrete Element Method (DEM) simulation that
compares two fundamentally different approaches to particle dynamics:
1. An inertial model (F = ma)
Uses Newton's second law with Verlet integration, tracking
accelerations and velocities over time, allowing particles to
accumulate momentum and exhibit dynamic settling behavior with
some kinetic energy dissipation