Project

General

Profile

Remap generic grid using lat lon stored as variable

Added by Andreas Westergaard over 2 years ago

Hi all

I have a netCDF file with climate data in a generic grid. Two of the variables in the file are the lat and lon coordinates stored as 2D grids. I have struggled a bit with remapping the climate data to a latlon grid, but so far only found solutions where I need an existing grid-file from another corresponding dataset.
I hope someone is willing to share their ideas for a solution? Thanks a lot in advance!
I have attached an example file.


Replies (2)

RE: Remap generic grid using lat lon stored as variable - Added by Karin Meier-Fleischer over 2 years ago

Hi Andreas,

the coordinates attribute for variable ST is missing.

cdo -setattribute,ST@coordinates="LON LAT" ST012015.nc ST012015_with_coordinates.nc
cdo -remapbil,r360x180 ST012015_with_coordinates.nc ST012015_with_coordinates_lonlat.nc

-Karin

RE: Remap generic grid using lat lon stored as variable - Added by Andreas Westergaard over 2 years ago

Fantastic - that seems to have done the trick! For the record, my alternative was to create a grid description file (griddes.txt) for a curvilinear grid with all the lat lon corrdinates inside, and then assign the grid to the netCDF file using setgrid. But your solution is very neat, thanks again!

    (1-2/2)