error invalid grid type - lambert conformal conic
Added by Natalia L almost 6 years ago
Hello,
I want to remap a latlon grid (land_use.nc) to a lambert conformal conic projection.
I define the lcc grid as following
#Set grid specification
cat > mygrid.txt <<EOF
gridtype = lcc2
gridsize = $GRDSIZE
xname = x
xlongname = x coordinate of projection
xunits = m
yname = y
ylongname = y coordinate of projection
yunits = m
xsize = 230
ysize = 180
a = 6370000.
lon_0 = 13
lat_0 = 26
lat_1 = 30
lat_2 = 60
xfirst = 3024467
xinc = 6000
yfirst = 354652
yinc = 6000
EOF
SO, I do the following
cdo remapcon mygrid.txt land_use.nc outfile.nc
cdo setgridtype,curvilinear -setgrid,mygrid.txt outfile.nc regrid.nc
and it gets the error
cdo remapcon (Abort): Invalid gridtype: lcc2 (grid description file: mygrid.txt)
I use cdo v.1.9.5
In case of defining the gritype as curvilinear then it does not recognise the parameter lon_0 etc.
Any help with this? How do I have to define the lcc projection?
Do I have to define the proj4_params? If so, how I could do that?
thank you
N.
Replies (5)
RE: error invalid grid type - lambert conformal conic - Added by Karin Meier-Fleischer almost 6 years ago
Hi Natalia,
see https://code.mpimet.mpg.de/projects/cdo/embedded/index.html#x1-150001.3.2. The gridtype should be projection and you have to add the grid_mapping_name lambert_conformal_conic.
This was already mentioned in one of your questions in the Support Forum https://code.mpimet.mpg.de/boards/1/topics/6986. There you can see an example grid description file.
-Karin
RE: error invalid grid type - lambert conformal conic - Added by Natalia L almost 6 years ago
Thank you very much.
in the grid description, the parameters longitudeOfFirstGridPointInDegrees, latitudeOfFirstGridPointInDegrees correspond to the lower left cell centres?
RE: error invalid grid type - lambert conformal conic - Added by Karin Meier-Fleischer almost 6 years ago
In my opinion yes.
RE: error invalid grid type - lambert conformal conic - Added by Natalia L almost 6 years ago
Hi Karin, thank you.
It seems that the remapping still does not work properly.
So, I am trying to remap with nearest neighbour (remapnn) a land use database (attached lu.nc) with a lat-lon projection to a lambert conformal conic projection grid.
I do the following :
cat > $Database_outdir/mygrid.txt <<EOF
gridtype = projection
gridsize = 38809
xname = x
xunits = "m"
yname = y
yunits = "m"
xsize = 394
ysize = 394
xfirst = 3574465
xinc = 1000
yfirst = 640651
yinc = 1000
uvRelativeToGrid = 1
grid_mapping = Lambert_Conformal
grid_mapping_name = lambert_conformal_conic
standard_parallel = 30 #true lat1
longitude_of_central_meridian = 13 #central longitude
latitude_of_projection_origin = 26 #central latitude
earth_radius = 6370000.
longitudeOfFirstGridPointInDegrees = 48.55109
latitudeOfFirstGridPointInDegrees =24.5468
EOF
cdo remapnn, mygrid.txt lu.nc outfile1.nc
cdo setgridtype,curvilinear -setgrid,mygrid.txt outfile1.nc regrid.nc
the remapnn does not work properly. I attach the outputs.
Is the grid definition correct?
thank you again.
N.
lu.nc (2.43 MB) lu.nc | |||
outfile1.nc (614 KB) outfile1.nc | |||
Regrid.nc (6.52 MB) Regrid.nc |
RE: error invalid grid type - lambert conformal conic - Added by Natalia L almost 6 years ago
Natalia L wrote:
Hi Karin, thank you.
It seems that the remapping still does not work properly.
So, I am trying to remap with nearest neighbour (remapnn) a land use database (attached lu.nc) with a lat-lon projection to a lambert conformal conic projection grid.
I do the following :
cat > $Database_outdir/mygrid.txt <<EOF
gridtype = projection
gridsize = 155236
xname = x
xunits = "m"
yname = y
yunits = "m"
xsize = 394
ysize = 394
xfirst = 3574465
xinc = 1000
yfirst = 640651
yinc = 1000
uvRelativeToGrid = 1
grid_mapping = Lambert_Conformal
grid_mapping_name = lambert_conformal_conic
standard_parallel = 30 #true lat1
longitude_of_central_meridian = 13 #central longitude
latitude_of_projection_origin = 26 #central latitude
earth_radius = 6370000.
longitudeOfFirstGridPointInDegrees = 48.55109
latitudeOfFirstGridPointInDegrees =24.5468
EOFcdo remapnn, mygrid.txt lu.nc outfile1.nc
cdo setgridtype,curvilinear -setgrid,mygrid.txt outfile1.nc regrid.ncthe remapnn does not work properly. I attach the outputs.
Is the grid definition correct?thank you again.
N.