Project

General

Profile

transfer data with lambert conformal projection to a regular lon-lat grid

Added by Delei Li over 10 years ago

Dear all,

I’d like to interpolate a forecast data with lambert conformal projection to a regular lon-lat grid. The file is in grib format. Firstly I transferred it to nc format and used ncdump to get the file information.

ncl_convert2nc 2006123112.grib
ncdump –h 2006123112.nc

I found that u and v componets of vector quantities are resolved relative to grid. I have no idea about the grid-relative wind speeds. I searched it online and got information that “When you do a display of a pre-projected vector field, you must know whether the original vector components are defined relative to the data grid or relative to the Earth. If the data are grid-relative, they must be rotated to Earth-relative coordinates in order for the interpolation to work properly.”
Does it mean I should transfer the wind fields to earth-relative firstly?

ncap -h -O -v –s "U=float(sin(g3_rot_2)*V_GRD_GDS3_HTGL+cos(g3_rot_2)*U_GRD_GDS3_HTGL)" 2006123112.nc U.nc
ncap -h -O -v –s "V=float(cos(g3_rot_2)*V_GRD_GDS3_HTGL-sin(g3_rot_2)*U_GRD_GDS3_HTGL)" 2006123112.nc V.nc

After this, the long and lati information of U.nc and V.nc is lost. Therefore,

ncks -h -A -v g3_lon_1,g3_lat_0 2006123112.nc U.nc
ncks -h -A -v g3_lon_1,g3_lat_0 2006123112.nc V.nc
ncatted -h -a coordinates,U,c,c,'g3_lon_1 g3_lat_0' U.nc
ncatted -h -a coordinates,V,c,c,'g3_lon_1 g3_lat_0' V.nc

At last,
I used remapbil to interpolate the U and V to our target grid: targetgrid.txt

cdo remapbil,targetgrid.txt U.nc U_lonlat.nc
cdo remapbil,targetgrid.txt V.nc V_lonlat.nc

I feel unconfident with the output. I wonder is there any problem during this process, is the variable U of U_lonlat.nc in west-east direction and V of V_lonlat.nc in north-south direction? Any help and suggestion?
Thanks very much in advance.

Best regards,
Delei


Replies (4)

RE: transfer data with lambert conformal projection to a regular lon-lat grid - Added by Jaison-Thomas Ambadan over 10 years ago

Hi,

If you want to interpolate the original data, you can simply do it straight forward, like:

cdo -f nc remapbil,targetgrid.txt 2006123112.grib ofile.nc

Cheers,
J

RE: transfer data with lambert conformal projection to a regular lon-lat grid - Added by Delei Li over 10 years ago

Thanks J for your answer.
One more question here, If I want to calculate the wind direction of each original point of 2006123112.grib , should I do the above mentioned process (as the U and V are not in x and y directions) to get the right direction?
Thank you and have a nice weekend.

Best regards,
Delei

RE: transfer data with lambert conformal projection to a regular lon-lat grid - Added by Jaison-Thomas Ambadan over 10 years ago

As far as I know, inorder to calculate the cartesian components: first you need to covert the lat and lon degree to radians, and then the x,y,z component can be calculated as:

xc = -sine(lon)*U - cosine(lon)*sine(lat)*V
yc = cosine(lon)*U - sine(lon)*sine(lat)*V
zc = cosine(lat)*V

Cheers,
J

RE: transfer data with lambert conformal projection to a regular lon-lat grid - Added by Poulomi Ganguli about 10 years ago

Hi,

I tried to interpolate my data according to the code: cdo -f nc remapbil,targetgrid.txt 2006123112.grib ofile.nc but I am getting error as Unsupported grid type: generic. Any clue how to regrid NARR data, which is in lambert Conformal format to regular grid type?

    (1-4/4)