How to change longitude range in a NetCDF

前端 未结 2 737
北海茫月
北海茫月 2020-12-19 20:10

My NetCDF file has 4 dimensions (longitude, latitude, time, level pressure) and several variables.

I want to replace the longitude data which is [340 342 344 ... 36

2条回答
  •  猫巷女王i
    2020-12-19 20:33

    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
    

提交回复
热议问题