Skip to content

Commit

Permalink
script for querying NCEP/NCAR SLP data
Browse files Browse the repository at this point in the history
  • Loading branch information
mikelitzow committed Mar 13, 2017
1 parent f3847f7 commit 15288aa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ncep-ncar slp query.R
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

0 comments on commit 15288aa

Please sign in to comment.