简体   繁体   English

使用 s2dverifications 包中的加载函数时 CDO 库不可用

[英]CDO libraries not available when using Load function from s2dverifications package

I'm trying to use climate data from Copernicus using the s2dverification package.我正在尝试使用 s2dverification 包使用来自哥白尼的气候数据。 The package requires CDO (Climate Data Operator) installed in the system for data manipulation.该软件包需要在系统中安装 CDO(气候数据操作员)以进行数据操作。 I have CDO version 1.9.5 installed on computer (windows 10) under cygwing but when I try to Load the data it fails.我在 cygwing 下的计算机(Windows 10)上安装了 CDO 1.9.5 版,但是当我尝试加载数据时它失败了。 I look for related issues but I found nothing.我寻找相关问题,但一无所获。 Any ideas?有任何想法吗? thanks in advance提前致谢

library(s2dverification) sdates <- paste0(1993:2015,'0301') library(s2dverification) sdates <- paste0(1993:2015,'0301')

Load(var="t2m",exp=list(list(path = "D:/Copernicus/seasonal_forecasts/cmcc_1993_2015/daily_mean/t2m/$VAR_NAME$_$START_DATE$.nc")),sdates=sdates,leadtimemax=180,storefreq="daily") Load(var="t2m",exp=list(list(path = "D:/Copernicus/seasonal_forecasts/cmcc_1993_2015/daily_mean/t2m/$VAR_NAME$_$START_DATE$.nc")),sdates=sdates,leadtimemax=180 ,storefreq="每日")

  • The load call you issued is:您发出的加载调用是:
  • Load(var = "t2m", exp = list(list(...)), obs = NULL, sdates = c('19930301', '19940301', ..., '20150301'), nmember = NULL, leadtimemin = 1, leadtimemax = 180, Load(var = "t2m", exp = list(list(...)), obs = NULL, sdates = c('19930301', '19940301', ..., '20150301'), nmember = NULL, Leadtimemin = 1, 最大交货期 = 180,
  • latmin = -90, latmax = 90, lonmin = 0, lonmax = 360, output = "areave", grid = NULL, storefreq = "daily", ...) latmin = -90, latmax = 90, lonmin = 0, lonmax = 360, 输出 = "area", grid = NULL, storefreq = "daily", ...)
  • See the full call in '$load_parameters' after Load() finishes. Load() 完成后,请参阅“$load_parameters”中的完整调用。
  • Fetching first experimental files to work out 'var_exp' size...正在获取第一个实验文件以计算出“var_exp”的大小...
  • Exploring dimensions... D:/Copernicus/seasonal_forecasts/cmcc_1993_2015/daily_mean/t2m/t2m_19930301.nc Error in .LoadDataFile(work_piece, explore_dims = TRUE, silent = silent) : Error: CDO libraries not available探索维度... D:/Copernicus/seasonal_forecasts/cmcc_1993_2015/daily_mean/t2m/t2m_19930301.nc Error in .LoadDataFile(work_piece, explore_dims = TRUE, silent = silent):错误:CDO 库不可用

Thanks Adrian for your suggestion but I found difficulties using the linux subsystem.感谢 Adrian 的建议,但我发现使用 linux 子系统有困难。

At the end I found that the problem was that the Load function searchs CDO with the function Sys.which("cdo"), which looks for CDO only in the folders listed by the function Sys.getenv("PATH").最后我发现问题是Load函数用函数Sys.which("cdo")搜索CDO,它只在函数Sys.getenv("PATH")列出的文件夹中查找CDO。 So the solution was to install CDO in one of those folders.因此,解决方案是在其中一个文件夹中安装 CDO。

Thanks谢谢

I think the best way to do this would be to install linux directly as a subsystem under windows 10, which is now very easy to do (no need to use cygwin any more).我认为最好的方法是在 Windows 10 下直接将 linux 作为子系统安装,这现在很容易做到(不再需要使用 cygwin)。 just search "install linux windows 10" on google and there are several blogs out there with the easy steps to follow.只需在谷歌上搜索“安装 linux windows 10”,就会有几个博客,可以按照简单的步骤进行操作。

you can then install cdo directly in the subsystem using然后您可以使用直接在子系统中安装 cdo

sudo apt-get install cdo

and use R within the linux subsystem as well.并在 linux 子系统中使用 R。 This is the way I did this if I need to use windows 10-based machines at workshops and training events.如果我需要在研讨会和培训活动中使用基于 Windows 10 的机器,我就是这样做的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM