Skip to content

Instantly share code, notes, and snippets.

View jdbcode's full-sized avatar

Justin Braaten jdbcode

View GitHub Profile
@jdbcode
jdbcode / ee_zonal_stats_demo.ipynb
Last active January 13, 2022 17:19
Demo for calculating raster zonal statistics for many zones in parallel using Google Earth Engine.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdbcode
jdbcode / colab_to_markdown.ipynb
Last active September 2, 2024 05:46
Convert a Colab notebook to Markdown with nbconvert
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// Get the fire/hotspot characterization dataset.
var fdcCol = ee.ImageCollection('NOAA/GOES/17/FDCF')
.filterDate('2020-09-05T15:00', '2020-09-06T02:00');
// Identify fire-detected pixels of medium to high confidence.
var fireMaskCodes = [10, 30, 11, 31, 12, 32, 13, 33, 14, 34, 15, 35];
var confVals = [1.0, 1.0, 0.9, 0.9, 0.8, 0.8, 0.5, 0.5, 0.3, 0.3, 0.1, 0.1];
var defaultConfVal = 0;
var fdcVisCol = fdcCol.map(function(img) {
var confImg = img.remap(fireMaskCodes, confVals, defaultConfVal, 'Mask');
// Change display bands to false color.
visParams.bands = ['CMI_C05', 'CMI_C03', 'CMI_GREEN'];
print(ui.Thumbnail(geosVisCol, visParams));
// Get CMI image collection and process it for visualization.
var geosVisCol = ee.ImageCollection('NOAA/GOES/17/MCMIPF')
.filterDate('2020-09-05T15:00', '2020-09-06T02:00')
.map(processForVis);
// Set display parameters and render the animation.
var visParams = {
bands: ['CMI_C02', 'CMI_GREEN', 'CMI_C01'],
min: 0,
max: 0.8,
// Applies scaling factors.
var applyScaleAndOffset = function(img) {
var getFactorImg = function(factorNames) {
var factorList = img.toDictionary().select(factorNames).values();
return ee.Image.constant(factorList);
};
var scaleImg = getFactorImg(['CMI_C.._scale']);
var offsetImg = getFactorImg(['CMI_C.._offset']);
var scaled = img.select('CMI_C..').multiply(scaleImg).add(offsetImg);
return img.addBands({srcImg: scaled, overwrite: true});
@jdbcode
jdbcode / ee_cartopy_polar_coordinate_ndvi.ipynb
Last active October 12, 2021 17:35
ee_cartopy_polar_coordinate_ndvi.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdbcode
jdbcode / ee_goes_bootleg_fire_progression.js
Last active July 21, 2021 15:45
Earth Engine GOES Bootleg fire progression
/**
* This script generates a GOES animation of MCMIP overlayed with FDC to
* show fire progression.
*/
// #############################################################################
// ### INPUTS ###
// #############################################################################
// Area of interest.
@jdbcode
jdbcode / ee_dataset_latency_calculator.js
Created July 16, 2021 18:18
Earth Engine dataset latency calculator
// #############################################################################
// ### INPUTS ###
// #############################################################################
var COL_ID = ee.ImageCollection("COPERNICUS/S1_GRD");
var PERIOD = 0.1; // Today to PERIOD months prior
// #############################################################################
@jdbcode
jdbcode / ee_landtrendr_ftv_deck_viz.ipynb
Last active April 1, 2025 06:12
Earth Engine LandTrendr FTV image time series deck visualization
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.