使用R

时间:2019-03-29 00:12:38

标签: r github netcdf remotes

这是我在这里的第一篇文章,我对R还很陌生。

我正在尝试使用链接到此处(http://cersat.ifremer.fr/data/tools-and-services/quicklooks/sea-ice/ssm-i-sea-ice-concentration-maps)的R包“ blueant”从以下网页(https://github.com/AustralianAntarcticDivision/blueant)下载数据。

我以这种方式下载了多个包含.nc文件的数据集,以从这些文件中提取特定南极地区的元数据。直到我开始下载该数据集:“ CERSAT SSM / I海冰浓度”,它一直没有问题。

我正在使用“ High Sierra”操作系统的2014年的MacBook Pro上的R Studio版本1.1.453中运行此代码。我已经成功下载了“ 2007”和“ 2008”年份的数据,但是如果使用“ accept_follow”命令,则现在不适用于“ 2009”或任何其他年份。如果我在没有“ accept_follow”命令的情况下运行以下代码,它也不会下载整个数据集。

我使用的代码如下:

`#### Setup db Sea Ice ####

mysrc2 <- sources("CERSAT SSM/I sea ice concentration") 

## First make sure that the data source doesn't already have an 
accept_follow parameter defined
"accept_follow" %in% names(mysrc2$method[[1]])

## nope, so we can safely go ahead and impose our own
mysrc2$method[[1]]$accept_follow <- "2009"

# Download the data to local folder
cf <- bb_config(local_file_root = "./Data") %>% bb_add(mysrc2)
bb_sync(cf, verbose = TRUE)

运行代码时出现的错误消息如下:

Fri Mar 29 09:56:32 2019
Synchronizing dataset: CERSAT SSM/I sea ice concentration
Source URL ftp://ftp.ifremer.fr/ifremer/cersat/products/gridded/psi- 
concentration/data/antarctic/daily/netcdf/
------------------------------------------------------------------------------- 
-------------

this dataset path is: 

/用户/ jasmin4689 /文档/ Uni / Data / JG_PhD_Data / JG_R / Temporal_Comparison / Data / ftp     .ifremer.fr / ifremer / cersat / products / gridded / psi-     浓度/数据/极速/每日/ netcdf     建立档案清单...完成。     前往ftp://ftp.ifremer.fr/ifremer/cersat/products/gridded/psi-     浓度/数据/极速/每日/ netcdf / ...     bb_rget退出并发生错误(RETR响应:425)     下载失败或被中断:未运行后处理步骤

Fri Mar 29 09:57:39 2019 dataset synchronization complete: CERSAT SSM/I sea ice 
concentration
# A tibble: 1 x 5
name                   id        source_url                                                    
status files      
 <chr>                  <chr>     <chr>                                                         
 <lgl>  <list>     
 1 CERSAT SSM/I sea ice … CERSAT_S… 
ftp://ftp.ifremer.fr/ifremer/cersat/products/gridded/psi-con… FALSE  <tibble 
[0…`

如果代码成功运行,结果将如下所示:

 Fri Mar 29 10:04:28 2019
 Synchronizing dataset: George V bathymetry
 Source URL https://data.aad.gov.au/eds/file/4494/
 ------------------------------------------------------------------------------ 
 --------------

 this dataset path is: 

/ Users / jasmin4689 / Documents / Uni / Data / JG_PhD_Data / JG_R / Temporal_Comparison / Data / data      .aad.gov.au / eds / file / 4494      建立档案清单...完成。      正在下载文件1(共1个):https://data.aad.gov.au/eds/file/4494/ ...
  | ================================================= ================================================ ====== | 100%   | ================================================= ================================================ ====== | 100%

done.
decompressing: 

/Users/jasmin4689/Documents/Uni/Data/JG_PhD_Data/JG_R/Temporal_Comparison/Data/data.aad.gov.au/eds/file/4494/download.zip ...将4个文件提取到/ Users / jasmin4689 /Documents/Uni/Data/JG_PhD_Data/JG_R/Temporal_Comparison/Data/data.aad.gov.au/eds/file/4494 ...完成。

Fri Mar 29 10:04:35 2019 dataset synchronization complete: George V bathymetry
# A tibble: 1 x 5
name                id         source_url                             status 
files           
  <chr>               <chr>      <chr>                                  <lgl>  
  <list>          
1 George V bathymetry GVdem_2008 https://data.aad.gov.au/eds/file/4494/ TRUE   
 <tibble [5 × 3]>

0 个答案:

没有答案