Project

General

Profile

remap a grid with laea projection

Added by Natalia L over 5 years ago

Hello,

I am trying to regrid a grid (netcdf file) with a lambert azimuthal equal area projection to a lambert conformal conic projection grid.

At first, I am trying to create a scrip file and it gives the following error:

cdo remapcon (Abort): proj error: major axis or radius = 0 or not given
cdo setgridtype: Started child process "setgrid,…. (pipe1.1)".

Could anyone help me on how I could remap a LAEA grid?

Thank you!


Replies (4)

RE: remap a grid with laea projection - Added by Karin Meier-Fleischer over 5 years ago

Hi Natalia,

I'm not an expert on SCRIP but the radius (earth_radius in meter) seems to be undefined in your scrip file. If you already have a lambert conformal conic projection file you can retrieve the grid description with the griddes operator.

cdo griddes lambert_conf_file > gridfile.txt

The grid description file gridfile.txt will be something like

#
# gridID 1
#
gridtype  = projection
gridsize  = 67725
xsize     = 301
ysize     = 225
xname     = x
xunits    = "m" 
yname     = y
yunits    = "m" 
xfirst    = 0
xinc      = 20318
yfirst    = 0
yinc      = 20318
uvRelativeToGrid = 1
grid_mapping = Lambert_Conformal
grid_mapping_name = lambert_conformal_conic
standard_parallel = 25.
longitude_of_central_meridian = 265.
latitude_of_projection_origin = 25.
earth_radius = 6367470.
longitudeOfFirstGridPointInDegrees = 233.862
latitudeOfFirstGridPointInDegrees = 16.281
With the grid description file you can remap your data
cdo remapbil,gridfile.txt infile outfile

-Karin

RE: remap a grid with laea projection - Added by Natalia L over 5 years ago

Hi Karin,

thank you.

Well, I have the file land_use.nc which is a grid in Lambert Azimuthal Equal Area (LAEA) projection.
I have also a database.nc which is in Lambert Conic Conformal (LCC) projection.
I want to remap the land_use.nc to the LCC projection.

In my initial script, I defined the grid description of the target grid (i.e. the LCC projection of land_use.nc). So, I had already defined the earth radius as following:

cat > $Database_outdir/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 = $dx
ysize = $dy
a = 6370000
lon_0 = $central_lon
lat_0 = $central_lat
lat_1 = $standard_parallel_1
lat_2 = $standard_parallel_2
xfirst = $ORIGX
xinc = $RESX
yfirst = $ORIGY
yinc = $RESY

Do you mean that I have to define also the projection of land_use.nc (LAEA)? Or that I have to use the command -griddes before the scrip file generation?

thank you!
N.

RE: remap a grid with laea projection - Added by Natalia L over 5 years ago

Also,

I tried the following

cat > $Database_outdir/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 = $dx
ysize = $dy
a = 6370000.
lon_0 = $central_lon
lat_0 = $central_lat
lat_1 = $standard_parallel_1
lat_2 = $standard_parallel_2
xfirst = $ORIGX
xinc = $RESX
yfirst = $ORIGY
yinc = $RESY
EOF

  1. CREATE SCRIP FILE
    cdo griddes $Database_outdir/land_use.nc > $Database_outdir/mygrid.txt

cdo remapbil,$Database_outdir/mygrid.txt $Database_outdir/g250_clc12_V18_5.nc $Database_outdir/tmpdom_land_use.nc
cdo setgridtype,curvilinear -setgrid,$Database_outdir/mygrid.txt $Database_outdir/tmpdom_g250_clc12_V18_5.nc $Database_outdir/Regrid_g250_clc12_V18_5.nc

and it gets the following error

cdo griddes: Processed 1 variable ( 0.00s )
Warning (gridInqLaea) : LAEA grid undefined (gridID = 23)
Warning (gridInqLaea) : LAEA grid undefined (gridID = 23)

cdo remapbil (Abort): proj error: major axis or radius = 0 or not given

RE: remap a grid with laea projection - Added by Natalia L over 5 years ago

Natalia L wrote:

Also,

I tried the following

cat > $Database_outdir/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 = $dx
ysize = $dy
a = 6370000.
lon_0 = $central_lon
lat_0 = $central_lat
lat_1 = $standard_parallel_1
lat_2 = $standard_parallel_2
xfirst = $ORIGX
xinc = $RESX
yfirst = $ORIGY
yinc = $RESY
EOF

  1. CREATE SCRIP FILE
    cdo griddes $Database_outdir/land_use.nc > $Database_outdir/mygrid.txt

cdo remapbil,$Database_outdir/mygrid.txt $Database_outdir/land_use.nc $Database_outdir/tmpdom_land_use.nc
cdo setgridtype,curvilinear -setgrid,$Database_outdir/mygrid.txt $Database_outdir/tmpdom_land_use.nc $Database_outdir/Regrid_land_use.nc

and it gets the following error

cdo griddes: Processed 1 variable ( 0.00s )
Warning (gridInqLaea) : LAEA grid undefined (gridID = 23)
Warning (gridInqLaea) : LAEA grid undefined (gridID = 23)

cdo remapbil (Abort): proj error: major axis or radius = 0 or not given

    (1-4/4)