This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Accepts a results dictionary and writes an short analysis based on | |
# the stored results. Example: | |
# test_res_dict = { | |
# 'address' : '1460 Golden Gate Avenue, San Francisco, CA', | |
# 'sold_date' : '2008-04-21', | |
# # baseline level of vegetation or some other sort of indicator of | |
# # the property. | |
# 'pre_ndvi' : 100, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def landsatID(alert_date, coords, offset_days=30): | |
"""get the ID of the Landsat 8 image that is closest to the | |
supplied alert date within the supplied GEE-formatted polygon | |
""" | |
d = datetime.datetime.strptime(alert_date, '%Y-%m-%d') | |
begin_date = d - datetime.timedelta(days=offset_days) | |
poly = ee.Feature.Polygon(coords) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FORMA, Hammer et al. (2014) | |
// Objective: | |
// Alerts of forest disturbance from MODIS imagery | |
// GEE core assets: | |
// MOD44B_C4_TREE_2000 (Vegetation Continuous Fields, annual 250m) | |
// MOD13Q1 (Vegetation indices, 16-day 250m) | |
// NOAA/PRECL_05D (Precipitation Reconstruction over Land, monthly 0.5 degree) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FORMA, Hammer et al. (2014) | |
// Objective: | |
// Alerts of forest disturbance from MODIS imagery | |
// GEE core assets: | |
// MOD44B_C4_TREE_2000 (Vegetation Continuous Fields, annual 250m) | |
// MOD13Q1 (Vegetation indices, 16-day 250m) | |
// NOAA/PRECL_05D (Precipitation Reconstruction over Land, monthly 0.5 degree) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Normalized Burn Ratio | |
// Hammer, Kraft, and Steele (Data Lab at WRI) | |
// GFW-Fires, prototype | |
// Reference | |
// Escuin, S., R. Navarro, P. Fernandez. 2008. Fire severity assessment by | |
// using NBR (Normalized Burn Ratio) and NDVI (Normalized Difference | |
// Vegetation Index) derived from LANDSAT TM/ETM images. Int. J. Remote | |
// Sens. 29:1053-1073. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Normalized Burn Ratio | |
// Hammer, Kraft, and Steele (Data Lab at WRI) | |
// GFW-Fires, prototype | |
// Reference | |
// Escuin, S., R. Navarro, P. Fernandez. 2008. Fire severity assessment by | |
// using NBR (Normalized Burn Ratio) and NDVI (Normalized Difference | |
// Vegetation Index) derived from LANDSAT TM/ETM images. Int. J. Remote | |
// Sens. 29:1053-1073. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Normalized Burn Ratio | |
// Hammer, Kraft, and Steele (Data Lab at WRI) | |
// GFW-Fires, prototype | |
// Reference | |
// Escuin, S., R. Navarro, P. Fernandez. 2008. Fire severity assessment by | |
// using NBR (Normalized Burn Ratio) and NDVI (Normalized Difference | |
// Vegetation Index) derived from LANDSAT TM/ETM images. Int. J. Remote | |
// Sens. 29:1053-1073. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import multiprocessing | |
from datetime import datetime | |
ALERT_URL = 'http://forma-cs-validation.elasticbeanstalk.com/api/alerts' | |
def _screener(x): | |
try: | |
not_cached = x['cached'] is not True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scipy | |
from scipy import ndimage | |
import copy | |
import matplotlib | |
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from spaceknow.horik import tools | |