用于聚合netcdf数据的实用程序。
ncagg的Python项目详细描述
tl;dr
使用pip安装实用程序:
pip install ncagg
在命令行上,使用 ncagg :
Usage: ncagg [OPTIONS] DST [SRC]... Options: -v, --version Show the version and exit. --generate_template PATH Print the default template generated for PATH and exit. -u TEXT Give an Unlimited Dimension Configuration as udim:ivar[:hz[:hz]] -b TEXT If -u given, specify bounds for ivar as min:max or Tstart[:[T]stop]. min and max are numerical, otherwise T indicates start and stop are times.start and stop are of the form YYYY[MM[DD[HH[MM]]]] and of stop is omitted,it will be inferred to be the least significantly specified date + 1. -l [DEBUG|INFO|WARNING|ERROR|CRITICAL] log level -t FILENAME Specify a configuration template --help Show this message and exit.
注意:
- dst是netcdf输出的文件名,不应该是 存在,或将被覆盖。
- src是要聚合的输入netcdf文件的列表,可以传递给 命令行或管道发送到NCAGG。
- -你应该指定一个不受限制的维度配置。见下文 详细信息。
- 一天花几十分钟是正常的,进度条会 指示剩余时间。
- 对于输出的细粒度控制,请指定配置 模板(-t)。详情见下文。
示例:
# explicitly list files to aggregate ncagg output_filename.nc file_0.nc file_02.nc #... # aggregate by globbing all files in some directory ncagg output_filename.nc path_to_files/*.nc # sort the unlimited dimension record_number, according to the variable time ncagg -u record_number:time output_filename.nc path_to_files/*.nc # sort the unlimited dimension record_number, according to the variable time, and insert # or remove fill values to ensure time occurrs at 10hz. ncagg -u record_number:time:10 output_filename.nc path_to_files/*.nc # only include time values between 2017-06-01 to 2017-06-02 (bounds), including # sorting and filling, as above ncagg -u record_number:time:10 -b T20170601:T20170602 output_filename.nc path_to_files/*.nc # or equivalently, if only one bound is specified, the end is inferred to be most significant + 1 ncagg -u record_number:time:10 -b T20170601 output_filename.nc path_to_files/*.nc # aggregate more files than fit on the command line... (in case of: Argument list too long) find /path/to/files -type f -name "*.nc" | ncagg output.nc
有关更多信息,请参阅下面的无限维度配置。 ncagg命令行界面(cli)基于 指定的参数。