从worldclim提取数据

问题描述 投票:0回答:1

我正在尝试从 Worldclim 下载当前气候数据和未来数据,但似乎我正在使用两种不同的代码下载相同的数据框。

我使用以下代码下载当前数据:

BIO1_current_data<- geodata::worldclim_country('ZAF', var='bio', 
                                               res=10, path = tempdir())
BIO1_current_data
class       : SpatRaster 
dimensions  : 1560, 2040, 19  (nrow, ncol, nlyr)
resolution  : 0.008333333, 0.008333333  (x, y)
extent      : 16, 33, -35, -22  (xmin, xmax, ymin, ymax)
coord. ref. : lon/lat WGS 84 (EPSG:4326) 
source      : ZAF_wc2.1_30s_bio.tif 
names       : wc2.1~bio_1, wc2.1~bio_2, wc2.1~bio_3, wc2.1~bio_4, wc2.1~bio_5, wc2.1~bio_6, ... 
min values  :    4.454167,    5.708333,    44.58333,    143.0743,        13.9,        -6.7, ... 
max values  :   24.941666,   18.741667,    68.93939,    707.2878,        39.3,        14.0, ...

当我尝试使用以下代码提取未来数据时

BIO1_forecast_future<-geodata::worldclim_country('South Africa', 'CMIP5', var='bio', 
                                               res=10,  
                                               year=80)

我得到了相同的数据。

我该如何解决这个问题?

r raster cdo-climate dismo
1个回答
0
投票

据我所知,没有直接选项可以按国家/地区下载 CMIP6 数据。而且 CMIP5 似乎也不容易获得。因此,根据您的评论,这将为您提供您想要裁剪到与 BIO1_current_data(南非)对象相同程度的预测数据:

library(geodata)
# Loading required package: terra
# terra 1.7.78

packageVersion("geodata")
# [1] ‘0.6.2’

# Download current data
BIO1_current_data <- worldclim_country("ZAF",
                                       var = "bio", 
                                       res = 10,
                                       path = tempdir())

BIO1_current_data
# class       : SpatRaster 
# dimensions  : 1560, 2040, 19  (nrow, ncol, nlyr)
# resolution  : 0.008333333, 0.008333333  (x, y)
# extent      : 16, 33, -35, -22  (xmin, xmax, ymin, ymax)
# coord. ref. : lon/lat WGS 84 (EPSG:4326) 
# source      : ZAF_wc2.1_30s_bio.tif 
# names       : wc2.1~bio_1, wc2.1~bio_2, wc2.1~bio_3, wc2.1~bio_4, wc2.1~bio_5, wc2.1~bio_6, ... 
# min values  :    4.454167,    5.708333,    44.58333,    143.0743,        13.9,        -6.7, ... 
# max values  :   24.941666,   18.741667,    68.93939,    707.2878,        39.3,        14.0, ... 

# Download world forecast data
Future_forecast_data <- cmip6_world(model = "CNRM-CM6-1",
                                    ssp = "585",
                                    time = "2061-2080",
                                    var = "bio",
                                    res = 10,
                                    version = "2.1",
                                    path = tempdir())

Future_forecast_data
# class       : SpatRaster 
# dimensions  : 1080, 2160, 19  (nrow, ncol, nlyr)
# resolution  : 0.1666667, 0.1666667  (x, y)
# extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
# coord. ref. : lon/lat WGS 84 (EPSG:4326) 
# source      : wc2.1_10m_bioc_CNRM-CM6-1_ssp585_2061-2080.tif 
# names       : bio01, bio02, bio03,  bio04, bio05, bio06, ... 
# min values  : -50.3,  -1.9, -12.8,   14.5, -25.5, -69.0, ... 
# max values  :  35.2,  22.0,  95.2, 2254.4,  54.0,  27.4, ... 

# Crop world forecat data to extent of BIO1_current_data
r <- crop(Future_forecast_data, BIO1_current_data)

r
# class       : SpatRaster 
# dimensions  : 78, 102, 19  (nrow, ncol, nlyr)
# resolution  : 0.1666667, 0.1666667  (x, y)
# extent      : 16, 33, -35, -22  (xmin, xmax, ymin, ymax)
# coord. ref. : lon/lat WGS 84 (EPSG:4326) 
# source(s)   : memory
# varname     : wc2.1_10m_bioc_CNRM-CM6-1_ssp585_2061-2080 
# names       : bio01, bio02, bio03, bio04, bio05, bio06, ... 
# min values  :  10.6,   8.4,  45.5, 221.7,  20.7,  -2.7, ... 
# max values  :  29.5,  19.4,  69.8, 729.0,  42.1,  16.5, ... 
© www.soinside.com 2019 - 2024. All rights reserved.