我有一个包含 60 多个 netCDF (*.nc) 文件的文件夹。我需要找到所有 60 多个数据文件的平均值,但我在终端中遇到了错误。
因此,我只需要知道如何平均所有 60 多个文件并将结果保存在一个output.nc
文件中(我知道如何一次处理 2 或 3 个文件,但有没有办法处理所有 60 多个文件?)
这是我尝试过'ncra data_ncfiles/* dataaverage.nc
的: -->*
应该告诉 Linux 文件夹中的所有 60 个文件要平均。
我得到的错误是:ncra: ERROR nco_sng_sntz() reports character '' from unsanitized user-input string "CbPM_ncfiles/" is not on whitelist of acceptable characters. For security purposes NCO restricts the set of characters appearing in user input, including filenames, to: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_-.@ :%/". NB: This restriction was first imposed in NCO 4.7.3 (February, 2018), and may cause breakage of older workflows. Please contact NCO if you have a real-world use-case that shows why the character '*' should be white-listed. HINT: Re-try command after replacing transgressing characters with innocuous characters.
我也试过不带星号,但没用
更新:我又试了一次:
ncra data_ncfiles/* dataaverage.nc
并得到这个错误:
ncra: ERROR no variables fit criteria for processing ncra: HINT Extraction list must contain at least one record variable that is not NC_CHAR or NC_STRING. A record variable is a variable defined with a record dimension. Often the record dimension, aka unlimited dimension, refers to time. To change an existing dimension from a fixed to a record dimensions see http://nco.sf.net/nco.html#mk_rec_dmn or to add a new record dimension to all variables see http://nco.sf.net/nco.html#ncecat_rnm