Reputation: 21
I need to extract historical weather data at a monthly basis, from 2001 to 2018, based on specific locations in Europe (all locations are in the sea). I have the longitude and latitude stored in separate columns:
longitude latitude
55.2000 6.8500
52.6450 1.7870
53.1350 1.1470
55.3430 10.95580
I looked into RNCEP package in R, which stores weather data. But to extract it I have to insert the interval for latitude and longitude (for example from 0 to 60), which gets the weather data at increments of 2.5 for latitude and longitude. How can I extract it for the precise latitude and longitude I need?
This is the code that extracts the weather data at the 2.5 increment.
#Define limits for latitude and longitude
min_lat <- min(data$latitude, na.rm = TRUE)
max_lat <- max(data$latitude, na.rm = TRUE)
min_lon <- min(data$longitude, na.rm = TRUE)
max_lon <- max(data$longitude, na.rm = TRUE)
# define arguments for latitude and longitude
lat_range <- c(min_lat, max_lat)
lon_range <-c(min_lon, max_lon)
# get monthly air temperature between 2001 and 2018
weather <- NCEP.gather(variable = "air.sig995", level = "surface", months.minmax = c(1,12),
years.minmax = c(2001,2018), lat.southnorth =lat_range,
lon.westeast = lon_range)
# dimensions (obs. at time 00:00, 6:00, 12:00, 18:00 each day)
dim(weather) #creates 3 dimensions [lat, lon, time]
# extract date and time based on created weather dataset
date_time <- dimnames(weather)[[3]]
# format UTC date
date_time <- ymd_h(date_time)
# extract longitude & latitude based on created weather dataset
lat <- dimnames(weather)[[1]] # in increments of 2.5
lon <- dimnames(weather)[[2]] # in increments of 2.5
#Calculate the mean daily air temp. of the different times of day
w <- NCEP.aggregate(weather, YEARS = TRUE, MONTHS = TRUE, HOURS = FALSE, fxn='mean')
#Visualize temperature as heatmap for 1 day
NCEP.vis.area(w, layer = 1, show.pts = TRUE, draw.contours = TRUE, cols = heat.colors(64), transparency = 0.4)
My result just extracts the historical weather data for the entire region, setting the range for longitude and latitude. But I need the weather conditions (such as mean temperature for the month) for the precise locations, based on my longitude and latitude columns for each month for all the years (2001 to 2018). Is it possible to do this with RNCEP package? Or what other options could I try?
Final results should be similar to this:
longitude latitude month year temperature
55.2000 6.8500 1 2001 20
55.2000 6.8500 2 2001 20
55.2000 6.8500 3 2001 20
...
55.2000 6.8500 1 2018 20
...
52.6450 1.7870 2
...
I am open to any suggestion that could bring be closer to the solution, not only the final solution to the problem. Thanks.
Upvotes: 2
Views: 3570
Reputation: 1390
It is not possible to get more granular with RNCEP
. That module is querying from the NCEP/NCAR Reanalysis and reanalysis 2 data set, and digging through those sites it looks like you cannot get more granular than 2.5 x 2.5 with the surface level data: Reanalysis 2/Reanalysis.
If you filter the NOAA data sets for temperature, and select the attribute view there are a handful of other data sets that you may be able to use. Some have different time granularity, and some are not kept up to the present. I am going to try this GHCNCAMS data set for my needs because it has a grainularity of 0.5x0.5 degrees. To access the data directly(, you need to access NOAA via ftp, then read about netCDF file format/tools. There are a a lot of links/pages on NOAA's site as well
Also check out this opendata.stackexchange answers for some other places you could find this data.
Upvotes: 1