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
STATE_NAME | COUNTY_NAME | NAMELSAD | xmin | ymin | xmax | ymax | GEOID | STATEFP | COUNTYFP | ||
---|---|---|---|---|---|---|---|---|---|---|---|
1 | Alabama | Autauga | Autauga County | -86.921237 | 32.307574 | -86.411172 | 32.708213 | 01001 | 01 | 001 | |
2 | Alabama | Baldwin | Baldwin County | -88.037309 | 30.146561 | -87.366591 | 31.319017 | 01003 | 01 | 003 | |
3 | Alabama | Barbour | Barbour County | -85.748433 | 31.617565 | -85.048825 | 32.148251 | 01005 | 01 | 005 | |
4 | Alabama | Bibb | Bibb County | -87.421989 | 32.831522 | -86.876023 | 33.246926 | 01007 | 01 | 007 | |
5 | Alabama | Blount | Blount County | -86.963358 | 33.765171 | -86.303516 | 34.260483 | 01009 | 01 | 009 | |
6 | Alabama | Bullock | Bullock County | -85.999258 | 31.880275 | -85.410042 | 32.305289 | 01011 | 01 | 011 | |
7 | Alabama | Butler | Butler County | -86.908939 | 31.523673 | -86.438341 | 31.964629 | 01013 | 01 | 013 | |
8 | Alabama | Calhoun | Calhoun County | -86.146225 | 33.55593 | -85.529432 | 33.96846 | 01015 | 01 | 015 | |
9 | Alabama | Chambers | Chambers County | -85.593653 | 32.72853 | -85.122189 | 33.109038 | 01017 | 01 | 017 |
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
returnBESTtemp <- function(tempFile) { | |
# tempFile: complete path to a netcdf BEST temperature file of daily records [need not be geographic subset] | |
ave <- brick(tempFile, var = "climatology") | |
anomalies <- brick(tempFile, var = "temperature") | |
# -- deal with absence of leap year in anomaly series | |
ave.dates <- as_date(as.numeric(unlist(lapply(strsplit(names(ave), "X"), function(x) x[[2]]))), origin = "1949-12-31") |
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
# Filename: IMD_convertRawData.py | |
# Author: Anthony Louis D'Agostino (ald at stanford dot edu) | |
# Date Created: 06/01/2017 | |
# Last Edited: 10/07/2017 | |
# Data: from NCC ZIP file | |
# Purpose: Reads in GRaDS data files, concatenates them, and then exports netCDF versions | |
# Notes: To be run after "convert_to_GrADS.R" | |
import os |
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
# Filename: convert_to_GrADS.R | |
# Author: Anthony Louis D'Agostino (ald at stanford dot edu) | |
# Date Created: September 16, 2015 | |
# Last Edited: October 07, 2017 | |
# Purpose: Modifies the NCC-provided CTL file and generates unique versions for each year of data, each type of temperature | |
# max, min, mean. | |
# Notes: While perhaps an overkill, this is generalizable to a setting where grids are file-specific. | |
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
STATEFP | STUSPS | NAME | xmin | ymin | xmax | ymax | ||
---|---|---|---|---|---|---|---|---|
1 | 01 | AL | Alabama | -88.473227 | 30.223334 | -84.88908 | 35.008028 | |
2 | 02 | AK | Alaska | -179.148909 | 51.214183 | 179.77847 | 71.365162 | |
3 | 60 | AS | American Samoa | -171.089874 | -14.548699 | -168.1433 | -11.046934 | |
4 | 04 | AZ | Arizona | -114.81651 | 31.332177 | -109.045223 | 37.00426 | |
5 | 05 | AR | Arkansas | -94.617919 | 33.004106 | -89.644395 | 36.4996 | |
6 | 06 | CA | California | -124.409591 | 32.534156 | -114.131211 | 42.009518 | |
7 | 08 | CO | Colorado | -109.060253 | 36.992426 | -102.041524 | 41.003444 | |
8 | 69 | MP | Commonwealth of the Northern Mariana Islands | 144.886331 | 14.110472 | 146.064818 | 20.553802 | |
9 | 09 | CT | Connecticut | -73.727775 | 40.980144 | -71.786994 | 42.050587 |
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
# -- DistrictNameMatching.py | |
# Author: Anthony Louis D'Agostino (ald2187 [at] columbia.edu) | |
# Purpose: Given CSV lists of district-state name pairs, identifies the best match given the fuzzywuzzy library | |
# Notes: Default number of matches currently set to 3, though can be modified as input argument. | |
import os | |
import numpy as np | |
from fuzzywuzzy import fuzz | |
from fuzzywuzzy import process | |
import pandas as pd |
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
/* | |
Filename: ZIP5_County_Lookup.do | |
Author: Anthony D'Agostino (ald at satanford dot edu) | |
Date Created: 02/09/2018 | |
Last Edited: 03/27/2018 | |
Purpose: Generate a merged zip5-county crosswalk that leverages the strengths of both the US Census and HUD ZCTA crosswalks. | |
*/ | |
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
# Filename: Find_nth_Degree_Neighbors.r | |
# Author: Anthony Louis D'Agostino | |
# Date Created: 01/18/2017 | |
# Last Edited: | |
# Purpose: Tutorial example of identifying n-th degree neighbors using North Carolina county boundaries | |
# Notes: Borrows from Edzer Pebesma's sf Vignette #5 (https://cran.r-project.org/web/packages/sf/vignettes/sf5.html) | |
# -- preamble; installs necessary packages | |
remove(list = ls(all.names = TRUE)) |