【问题标题】:How to extract historical weather data based on specific longitudes and latitudes?如何根据特定的经纬度提取历史天气数据?
【发布时间】:2019-08-28 17:56:52
【问题描述】:

我需要根据欧洲的特定位置(所有位置都在海中),每月提取 2001 年到 2018 年的历史天气数据。我将经度和纬度存储在不同的列中:

longitude    latitude

55.2000       6.8500
52.6450       1.7870
53.1350       1.1470
55.3430       10.95580

我查看了 R 中的 RNCEP 包,它存储了天气数据。但是要提取它,我必须插入纬度和经度的间隔(例如从 0 到 60),它以 2.5 的增量获取纬度和经度的天气数据。如何提取它以获得我需要的精确纬度和经度?

这是以 2.5 为增量提取天气数据的代码。

#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)

我的结果只是提取了整个地区的历史天气数据,设置了经度和纬度的范围。但是我需要根据我所有年份(2001 年到 2018 年)每个月的经度和纬度列的精确位置的天气条件(例如当月的平均温度)。是否可以使用 RNCEP 包做到这一点?或者我可以尝试哪些其他选择?

最终结果应该是这样的:

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

...

我愿意接受任何可能更接近解决方案的建议,而不仅仅是问题的最终解决方案。谢谢。

【问题讨论】:

    标签: r weather


    【解决方案1】:

    使用RNCEP 无法获得更精细的信息。该模块正在从NCEP/NCAR Reanalysisreanalysis 2 数据集进行查询,并通过这些站点进行挖掘,看起来您无法使用表面级别数据获得比2.5 x 2.5 更细的粒度:Reanalysis 2/Reanalysis

    如果您filter the NOAA data sets for temperature, and select the attribute view,您可能还可以使用一些其他数据集。有些有不同的时间粒度,有些跟不上现在。 我将根据我的需要尝试这个 GHCNCAMS 数据集,因为它的粒度为 0.5x0.5 度。要直接访问数据(您需要通过ftp 访问NOAA,然后阅读netCDF 文件格式/工具。NOAA 的site 上也有很多链接/页面

    还可以查看this opendata.stackexchange 的答案,了解其他可以找到这些数据的地方。

    【讨论】:

      猜你喜欢
      • 2019-04-10
      • 2018-01-02
      • 1970-01-01
      • 1970-01-01
      • 2019-02-18
      • 1970-01-01
      • 2013-11-27
      • 2021-05-11
      • 2012-06-18
      相关资源
      最近更新 更多