Just wanted to point out that NCRA will happily average over character variables as well as numeric variables, which can lead to some unexpected consequences. We had a bunch of hourly output from an ocean model where the time was represented as a CF compliant double, but also as a character string variable
char Times(time, DateStrLen) ;
Times:time_zone = "UTC" ;
with values like
We used NCRA to compute monthly averages, and then used NCML on a THREDDS server to virtually aggregate these into a single dataset, which was worked great.
Except that it turned out that someone had developed code that was reading that Times character variable, which after being averaged by NCRA produced goofy values like:
"1878-01-14T03:009//-500000", "1868-02-14T03:009//-000000", "1878-03-14T03:009//-000000"
So just a heads up that if you want times as character strings to work after being NCRA, you might have to do some correction.
I am unable to reproduce the problem you describe.
The NCO arithmetic operators like ncra are designed to ignore character variables, and to just copy them instead.
Please post a full use case that shows ncra altering character variables and we will look into it.
Here is my example with the latest snapshot that shows ncra does not fiddle with character variables:
ncra -O -v time,date_rec,fl_nm_rec ~/nco/data/in.nc ~/foo.nc
I am using ncra to split the netcdf file into 3 based on time. Typically it works on other files but when I type the command
ncra -d time,0,1119 nyf.ncep.T62.050923_1980.nc jjjj.nc
it gives me the jjjj.nc file with only 1 timestep. Do you any suggestions on how to fix it? I am guessing that this error is due to the time format which is double.
ncra averages files into a file with only one timestep, exactly as you have described.
to split files into multiple files use ncks not ncra.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.