我对在 R 中使用 stars 包很陌生,我无法弄清楚如何创建一个包含来自对象 A 的值但对象 B 的范围的 stars 对象 C。具体来说,我有一张平均弹簧图欧洲的温度(对象 A),我想使用包含落叶阔叶林(对象 B)的单独星星对象来裁剪它。
对象 A:https ://i.stack.imgur.com/DQsZn.jpg
> CRU.SpringT.2009.2018_EU
stars object with 2 dimensions and 1 attribute
attribute(s):
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
CRU.SpringT.2009.2018_EU.tif -15.81895 1.201286 5.480992 4.979221 8.204463 17.55605 310479
dimension(s):
from to offset delta refsys point values x/y
x 1 1440 -10 0.0416667 WGS 84 FALSE NULL [x]
y 1 672 65 -0.0416667 WGS 84 FALSE NULL [y]
对象 B:https ://i.stack.imgur.com/6dons.jpg
> Dec.BL_EU3
stars_proxy object with 1 attribute in 1 file(s):
$Consensus_reduced_class_3.tif
[1] "[...]/Consensus_reduced_class_3.tif"
dimension(s):
from to offset delta refsys point values x/y
x 20401 27600 -180 0.00833333 +proj=longlat +datum=WGS8... FALSE NULL [x]
y 3001 6360 90 -0.00833333 +proj=longlat +datum=WGS8... FALSE NULL [y]
call_list:
[[1]]
x[i = i, drop = drop, crop = crop]
attr(,".Environment")
<environment: 0x000002a17a1ecac0>
[[2]]
x[i = i, drop = drop, crop = crop]
attr(,".Environment")
<environment: 0x000002a178d61dc0>
[[3]]
e1/e2
attr(,".Environment")
<environment: 0x000002a177987b10>
两个对象都使用相同的 bbox 进行裁剪。目标是生成的对象(对象 C)具有 B 的范围,但具有来自 A 的温度值。
tif 文件的 Dropbox 链接:
对象 A:https ://www.dropbox.com/s/lwvdxnis7k38e18/CRU.SpringT.2009.2018_EU.tif?dl=0
对象 B:https ://www.dropbox.com/s/uybxk40z853mu7a/EU%20Dec%20Broadleaf.tif?dl=0