简体   繁体   English

有没有办法将 41 个 nc 文件合并为一个文件?

[英]Is there a way to merge 41 nc files into one file?

I have 41 nc files, all containing climate data for 41 separate years.我有 41 个 nc 文件,所有文件都包含 41 年的气候数据。 Is there a way to merge these files together on r?有没有办法在 r 上将这些文件合并在一起?

The stars package will do just that (and much more): Reading datasets from multiple files . stars package 将执行此操作(以及更多): Reading datasets from multiple files

A simple Google search will also give you lots of info and tutorials using the raster package ( for example ).一个简单的谷歌搜索也将为您提供大量使用raster package(例如)的信息和教程。

While you have tagged R, this is very easily done on the command line using CDO.虽然您已标记 R,但使用 CDO 在命令行上很容易完成此操作。 As simple as:就这么简单:

cdo mergetime *.nc out.nc

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

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