Skip to content

Instantly share code, notes, and snippets.

View jdbcode's full-sized avatar

Justin Braaten jdbcode

View GitHub Profile
@jdbcode
jdbcode / earth_engine_zonal_stats_by_lon.js
Created May 25, 2020 23:02
Calculate zonal statistics by longitude bin and chart the result in Earth Engine
// Load VIIRS NDVI - to be summarized by longitude bins.
var viirsNdvi = ee.ImageCollection("NOAA/VIIRS/001/VNP13A1")
.select('NDVI').first();
// Load lat/lon image - select the longitude band.
var latLon = ee.Image.pixelLonLat().select('longitude');
// Make a list of longitude bin start values.
var step = 5; // longitude step
var lonStarts = ee.List.sequence(-90, 90-step, step);
@jdbcode
jdbcode / get-hex-colors.py
Last active April 11, 2024 20:09
Get a list of n hex colors for a given matplotlib palette
# Source: https://stackoverflow.com/a/33597599/5391200
from pylab import *
cmap = cm.get_cmap('seismic', 5) # matplotlib color palette name, n colors
for i in range(cmap.N):
rgb = cmap(i)[:3] # will return rgba, we take only first 3 so we get rgb
print(matplotlib.colors.rgb2hex(rgb))
cmap = cm.get_cmap('plasma', 101)
@jdbcode
jdbcode / landsatlinkr-asset-manager.ipynb
Created October 1, 2020 16:07
LandsatLinkr Asset Manager
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdbcode
jdbcode / ee-thumbnail-as-np-array.ipynb
Created October 21, 2020 21:11
ee-thumbnail-as-np-array.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdbcode
jdbcode / ee-thumbnail-displayed-by-plt-imshow.ipynb
Created November 4, 2020 22:41
ee-thumbnail-displayed-by-plt-imshow.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdbcode
jdbcode / o-c-lands-from-the-perspective-of-sentinel-2.ipynb
Last active November 10, 2020 18:28
O&C Lands from the perspective of Sentinel-2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdbcode
jdbcode / pydeck_earthengine_layers_landsat_olym.ipynb
Last active November 11, 2020 14:34
Earth Engine visualization with pydeck / deck.gl
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdbcode
jdbcode / irrigated-fields-sentinel-2.ipynb
Last active January 10, 2023 00:54
Irrigated fields Sentinel-2
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.
@jdbcode
jdbcode / geemap_cartoee_global_cropland_robinson_proj.ipynb
Last active November 20, 2020 20:49
geemap_cartoee_global_cropland_robinson_proj.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.