我正在尝试使用 rCurl
下载 ncdf
文件。任何人都可以就为什么这不起作用提供任何建议吗?
require(RCurl)
require(ncdf4)
url <- "https://oceandata.sci.gsfc.nasa.gov/MODIS-Aqua/Mapped/Seasonal_Climatology/4km/sst/"
filename <-"A20021722014263.L3m_SCSU_NSST_sst_4km.nc"
download.file(paste0(url, filename),destfile = paste0("~/Desktop/", filename), method="curl")
setwd("~/Desktop/")
files<-dir(pattern="*.nc")
f<-nc_open(files[1])
Error in R_nc4_open: NetCDF: Unknown file format
Error in nc_open(files[1]) :
Error in nc_open trying to open file A20021722014263.L3m_SCSU_NSST_sst_4km.nc
最佳答案
看来下载的文件是XML格式的错误文件?如果你用记事本打开它,你会看到它包含类似
的内容Sorry, an error has occurred. Use the back button to return to the previous page or go to the Ocean Color Home Page
您确定要下载的文件名确实存在于该 URL 中吗?
https://stackoverflow.com/questions/58251325/
相关文章:
angular - 运行 karma 测试时出现错误无法读取 null 的属性 'extras'
reactjs - React Native - SetTimeout() 不工作。 t.apply
firebase - 使用 react-native-firebase 在 React Native
c# - 是否可以动态更改 ToolbarItem 的图标?
aws-lambda - 如何使用 CloudFormation 添加订阅过滤器?
objective-c - 无法编译使用 Objective-C 包的 Swift 包