-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
script for querying NCEP/NCAR SLP data
- Loading branch information
1 parent
f3847f7
commit 15288aa
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
setwd("/Users/MikeLitzow/Documents/R/FATE/fate-ewi") | ||
library(ncdf4) | ||
require(chron) | ||
require(zoo) | ||
require(dplyr) | ||
|
||
# dowload the latest version of the NCEP/NCAR Reanalysis | ||
# download.file(url="ftp://ftp.cdc.noaa.gov/Datasets/ncep.reanalysis.derived/surface/slp.mon.mean.nc", destfile= "/Users/MikeLitzow/Documents/R/NSF-GOA/slp.mon.mean.nc") | ||
|
||
# now load the file | ||
nc <- nc_open("/Users/MikeLitzow/Documents/R/NSF-GOA/slp.mon.mean.nc") | ||
|
||
# get date info - time is in hours since Jan. 1, 1800! | ||
raw <- ncvar_get(nc, "time") | ||
h <- raw/24 | ||
d <- dates(h, origin = c(1,1,1800)) | ||
d # we'll just use the entire time series - Jan 1948-present |