Skip to content

Instantly share code, notes, and snippets.

View jfallon1997's full-sized avatar

James Fallon jfallon1997

View GitHub Profile
@lgloege
lgloege / area_grid.py
Last active May 27, 2025 21:44
All the files necessary to calculate the area-weighted mean of geospatial data are here.
def area_grid(lat, lon):
"""
Calculate the area of each grid cell
Area is in square meters
Input
-----------
lat: vector of latitude in degrees
lon: vector of longitude in degrees
@hugke729
hugke729 / rasterize_and_save.py
Last active February 24, 2025 19:15
Simplify export of matplotlib figures when both raster and vector components are desired in output
# A function to rasterize components of a matplotlib figure while keeping
# axes, labels, etc as vector components
# https://brushingupscience.wordpress.com/2017/05/09/vector-and-raster-in-one-with-matplotlib/
from inspect import getmembers, isclass
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
def rasterize_and_save(fname, rasterize_list=None, fig=None, dpi=None,
@dz0ny
dz0ny / 99java
Created July 7, 2012 10:23
Install java,flash,mp3,mp4 to Chromium OS
## Setup java
if [ `uname -m` == 'x86_64' ]; then
PATH="/usr/lib64/jvm/java-7-oracle/jre/bin/"
JAVA_HOME="/usr/lib64/jvm/java-7-oracle/"
else
PATH="/usr/lib/jvm/java-7-oracle/jre/bin/"
JAVA_HOME="/usr/lib/jvm/java-7-oracle/"
fi