Need help to convert Lambert Conformal Conic Grids to longlat (WGS84)
Added by Arindan Mandal about 4 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).
HAR v2_d10km_m_2d_prcp_2004.nc (8.23 MB) HAR v2_d10km_m_2d_prcp_2004.nc | HAR sample data | ||
HAR_before convert.jpeg (35.2 KB) HAR_before convert.jpeg | plot before conversion | ||
HAR_after convert.jpeg (38.5 KB) HAR_after convert.jpeg | plot after conversion |
Replies (4)
RE: Need help to convert Lambert Conformal Conic Grids to longlat (WGS84) - Added by Ralf Mueller about 4 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.ncfor 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
Figure_1.png (28.8 KB) Figure_1.png |
RE: Need help to convert Lambert Conformal Conic Grids to longlat (WGS84) - Added by Arindan Mandal about 4 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 3 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 3 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