How to change longitude range in a NetCDF

梦想的初衷 提交于 2019-12-06 11:13:30

This is what I found:

ncap2 -O -s 'where(lon>180) lon=lon-360' ifile ofile

I am not sure yet it doesn't change anything else but it seems work.

I realise this is an old thread, but as I had a very similar problem recently I thought I'd add my solution as I didn't manage to find it elsewhere...

I used the cdo package (https://code.zmaw.de/projects/cdo) command sellonlatbox to translate my input data from [0, 360) longitude range to be [-180, 180), and also reorder latitudes to be [-90, 90] (i.e. S -> N):

cdo sellonlatbox,-180,180,-90,90 infile.nc outfile.nc
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!