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
# Extract an aggregation of pixels from geotifs using a multi-polygon shapefile | |
# Output: | |
# A csv file with one-row per polygon and as many columns as the number | |
# geotif files processed | |
# @USDA-ARS-Tucson, AZ | |
# @Date: 04/02/2016 | |
import os | |
import json | |
import pandas as pd | |
from rasterstats import zonal_stats, point_query |
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
GetSPEI_Rasters_from_IPCC <- function(path, dateStart, dateEnd) { | |
# Generate monthly SPEI rasters using IPCC PETnatveg and Precipitation | |
# Args: | |
# path: A string value with the directory where the .nc files are located | |
# dateStart: A string value with the starting date in the format: 2014-01-01 | |
# dateEnd: A string value with the ending date, same format | |
# Returns: | |
# SPEI Raster files as geotif for each model | |
# @USDA-ARS-Tucson, AZ | |
# @Date: 05/16/2016 |
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
ConvertIPCC_netcdf2geoTiff <- function (path, dateStart, dateEnd) { | |
# Converts IPCC netcdf time series into geotif files for the CONUS extent | |
# Args: | |
# path: A string value with the directory where the .nc files are located | |
# dateStart: A string value with the starting date in the format: 2014-01-01 | |
# dateEnd: A string value with the ending date, same format | |
# Returns: | |
# Raster files as geotif for each month/model | |
# @USDA-ARS-Tucson, AZ | |
# @Date: 05/10/2016 |