Project

General

Profile

Remove bounds in file (i.e. "lat_bnds" and "lon_bnds")

Added by Oliver Angelil over 6 years ago

I've attached 2 files. One can see the difference between the two grids with the cdo griddes command. cdo griddes file_bnds.nc shows a long list of lat and lon bounds. I do not want this in my file. "file_no_bnds.nc" is an example of where this is not seen. I want to retain the very high resolution in file_bnds.nc so cdo remapbil,file_no_bnds.nc file_bnds.nc ofile.nc is not the right solution.

Thanks,
Oliver


Replies (3)

RE: Remove bounds in file (i.e. "lat_bnds" and "lon_bnds") - Added by Oliver Angelil over 6 years ago

I figured out a solution with NCO:

ncks -C -O -x -v lat_bnds,lon_bnds,time_bnds file_bnds.nc ofile.nc

:)

RE: Remove bounds in file (i.e. "lat_bnds" and "lon_bnds") - Added by Oliver Angelil over 6 years ago

Even easier is...

- First save the grid: cdo griddes file_bnds.nc > mygrid.txt

- Edit out lat_bnds and lon_bnds in mygrid.txt

- cdo setgrid,mygrid.txt file_bnds.nc ofile.nc

RE: Remove bounds in file (i.e. "lat_bnds" and "lon_bnds") - Added by Patrick McGuire about 1 year ago

This is a few years later.
I tried the ncks solution posted above. It works, but I think it uses a lot of memory sometimes.
I just tried this and it works (and it doesn't use as much memory on big files):

cdo delname,lat_bnds,lon_bnds file_bnds.nc ofile.nc

Patrick McGuire

    (1-3/3)