Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netcdf averages time varable when averaging multiple .nc files

I have averaged a bunch of hourly netCDF files (for one year) to create one large netCDF file that contains an average daily value. The time variable represents hours since 2005-1-1 00:00:00 and looks like this:

time = 11.5, 35.5, 59.5, 83.5, 107.5, 131.5, 155.5, 179.5, 203.5, 227.5...;

However, I would like the time variable to represent the beginning of the day so that it looks like this:

time = 0, 24, 48...;

Is there a way to manipulate the time variable so that it represents the beginning of the day instead of the middle of the day?

Thanks!

like image 392
elyssac Avatar asked Nov 24 '25 19:11

elyssac


1 Answers

It seems as if this command may have solved my issue:

ncap2 -s "time=time-11.5" infile.nc -o outfile.nc
like image 85
elyssac Avatar answered Nov 27 '25 21:11

elyssac



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!