Project

General

Profile

Need help to convert Lambert Conformal Conic Grids to longlat (WGS84)

Added by Arindan Mandal about 3 years ago

Hi,
I am working with HAR (.nc) datasets (https://www.klima.tu-berlin.de/index.php?show=daten_har). They are in Lambert Conformal Conic Grids, the map projection used by the WRF model.
But to work with them in R, I need to convert them into latlong (wgs84) as my other datasets are already in latlong. I want them as latitude longitude, so that I can play with them, e.g. crop, mask for several polygons, etc (in R).
I was using "cdo setgridtype,curvilinear" operator to convert them in latlon, but finally it shows same grid/axis, no latitude longitude.

I have attached a sample of data of the same.
Would be happy if one can guide me a little to overcome this. Also attached the figures before and after conversion (plotted in R).


Replies (4)

RE: Need help to convert Lambert Conformal Conic Grids to longlat (WGS84) - Added by Ralf Mueller about 3 years ago

hi Arindan!

I could interpolate you HAR file to a global lonlat-grid with

cdo -P 8 remapbil,global_0.1 HAR_v2_d10km_m_2d_prcp_2004.nc out.nc
for shrinking the grid an additional sellonlatbox like -sellonlatbox,61,111,23,48

Finally

cdo -L -P 8 -sellonlatbox,61,111,23,48 -remapbil,global_0.1 HAR_v2_d10km_m_2d_prcp_2004.nc t.nc 

plotted with psy-view

RE: Need help to convert Lambert Conformal Conic Grids to longlat (WGS84) - Added by Arindan Mandal about 3 years ago

Mr. Ralf Mueller,
This solves my requirement.
Thank you very much for the nice stuff.

RE: Need help to convert Lambert Conformal Conic Grids to longlat (WGS84) - Added by Fadel Muhammad over 2 years ago

Hello,

do you also know how to do this conersion in python?

Thank you.

RE: Need help to convert Lambert Conformal Conic Grids to longlat (WGS84) - Added by Karin Meier-Fleischer over 2 years ago

Hi Fadel,

for python-cdo:

from cdo import *
cdo = Cdo()

cdo.sellonlatbox('61,111,23,48', input='-remapbil,global_0.1 HAR_v2_d10km_m_2d_prcp_2004.nc', output='t.nc', options = '-P 8')

-Karin

    (1-4/4)