Project

General

Profile

Lambert Azimuthal Equal Area to Lat Lon grid [Unsupported generic coordinates]

Added by Brian Gaze almost 3 years ago

Hi,

I gave up trying to install CDO on Windows and stuck it on an Ubuntu box instead. It works fine, but I am now having a problem with the grib2 files that I am working with. They are using Lambert Azimuthal Equal Area and I would like to convert the grid to latitude - longitude. When I run sinfon against the grib the following is returned:

root@Tigger:/datadrive/nwp/uk# cdo sinfon agl10.grb
File format : GRIB2
-1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter name
1 : unknown unknown v instant 1 1 290745 1 P12 : 2d
2 : unknown unknown v instant 1 1 290745 1 P12 : cc
3 : unknown unknown v instant 1 1 290745 1 P12 : 2r
4 : unknown unknown v instant 1 1 290745 1 P12 : 2t
5 : unknown unknown v max 1 1 290745 1 P12 : 2t
6 : unknown unknown v min 1 1 290745 1 P12 : 2t
Grid coordinates :
1 : generic : points=290745
Vertical coordinates :
1 : height : levels=1
height : 1
Time coordinate : 1 step
RefTime = 2021-05-12 03:00:00 Units = hours Calendar = proleptic_gregorian
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
2021-05-12 13:00:00
cdo sinfon: Processed 6 variables over 1 timestep [0.03s 54MB]

If I use griddes to create a descriptor file the following is generated:

_#
  1. gridID 1 #
    gridtype = generic
    gridsize = 290745
    scanningMode = 64_

Therefore, using -remapbil returns an error: (Abort): Unsupported generic coordinates (Variable: 2D)!

Am I doing something wrong?

Thanks

Brian


Replies (11)

RE: Lambert Azimuthal Equal Area to Lat Lon grid [Unsupported generic coordinates] - Added by Brian Gaze almost 3 years ago

I'm still struggling with this so if anyone can help I would be very grateful. I've attached an example of the grib2 files that I am working with.

RE: Lambert Azimuthal Equal Area to Lat Lon grid [Unsupported generic coordinates] - Added by Uwe Schulzweida almost 3 years ago

The Lambert Azimuthal Equal Area projection is not supported. You can create a CDO grid description file from the GRIB2 grid parameter. These parameter can be selected with the ecCodes tool grib_dump. Here is an example:

  shapeOfTheEarth = 4;
  numberOfPointsAlongXAxis = 455;
  numberOfPointsAlongYAxis = 639;
  latitudeOfFirstGridPointInDegrees = 49.4329;
  longitudeOfFirstGridPointInDegrees = -10.451;
  standardParallelInDegrees = 54.9;
  centralLongitudeInDegrees = -2.5;
  xDirectionGridLengthInMetres = 2000;
  yDirectionGridLengthInMetres = 2000;
  gridType = lambert_azimuthal_equal_area;
CDO uses the proj library for coordinates transformation. So the above GRIB2 grid parameter need to be converted to proj parameters:
+proj=laea +lat_0=54.9 +lon_0=-2.5 +a=6378137.0 +b=6356752.314 +x_0=576000 +y_0=576000
x_0 and y_0 are computed from longitudeOfFirstGridPointInDegrees and latitudeOfFirstGridPointInDegrees by:
  proj +proj=laea +lat_0=54.9 +lon_0=-2.5 +a=6378137.0 +b=6356752.314 << EOR
  -10.451 49.4329
  EOR
The resulting CDO grid description files looks like:
gridtype  = projection
xsize     = 455
ysize     = 639
xunits    = "m" 
yunits    = "m" 
xfirst    = 0
xinc      = 2000
yfirst    = 0
yinc      = 2000
grid_mapping = laea
grid_mapping_name = lambert_azimuthal_equal_area
proj_params = "+proj=laea +lat_0=54.9 +lon_0=-2.5 +a=6378137.0 +b=6356752.314 +x_0=576000 +y_0=576000" 
Use the grid description file as parameter for the CDO operator setgrid. Here is an example:
cdo remapbil,<targetgrid> -setgrid,myproj meteagl10.grb result

RE: Lambert Azimuthal Equal Area to Lat Lon grid [Unsupported generic coordinates] - Added by Brian Gaze almost 3 years ago

Thanks very much, but it still doesn't work for me. Perhaps I have misunderstood, but I thought myproj should be name of the grid description file. So in my case I do:

cdo remapbil,met_gridfile.txt -setgrid,met_gridfile.txt metoagl10.grb agl10.grb

The above returns an "Unsupported grid type: projection" error.

agl10.grb is created but it has 0 bytes size.

Am I still doing something wrong?

RE: Lambert Azimuthal Equal Area to Lat Lon grid [Unsupported generic coordinates] - Added by Uwe Schulzweida almost 3 years ago

I guess you are using a somewhat older CDO version (cdo -V). For the projections a current CDO version is very helpful.

RE: Lambert Azimuthal Equal Area to Lat Lon grid [Unsupported generic coordinates] - Added by Brian Gaze almost 3 years ago

The version I have installed is from the system repositories and is 1.9.3+dsfg.1.1

Is it possible for me to install a newer version without having to compile source?

(Apologies, my Ubuntu knowledge is limited because I usually work on Windows server)

RE: Lambert Azimuthal Equal Area to Lat Lon grid [Unsupported generic coordinates] - Added by Uwe Schulzweida almost 3 years ago

My Ubuntu knowledge is also very limited. Here is a link for the CDO package on ubuntu: https://packages.debian.org/sid/cdo

RE: Lambert Azimuthal Equal Area to Lat Lon grid [Unsupported generic coordinates] - Added by Brian Gaze almost 3 years ago

Hi,

Thanks for your help with this!

I had problems updating the Ubuntu version so went back to a clean Windows virtual machine. CDO version 1.9.10 is installed, Copyright 2003-2021, so I think this is the current Cygwin version.

*CDO is working, but I'm getting the following error: *
_Administrator@WIN-3NRPB2JOM2H /usr/sbin
$ cdo remapbil,metdesc.txt -setgrid,metdesc.txt metoagl1.grb agl1.grb
cdo(1) setgrid: Process started
Warning (gribapiGetGridType): gridDefinitionTemplateNumber 140 unsupported (gridType=lambert_azimuthal_equal_area)!
Warning (gribapiGetGridType): gridDefinitionTemplateNumber 140 unsupported (gridType=lambert_azimuthal_equal_area)!
Warning (gribapiGetGridType): gridDefinitionTemplateNumber 140 unsupported (gridType=lambert_azimuthal_equal_area)!
Warning (gribapiGetGridType): gridDefinitionTemplateNumber 140 unsupported (gridType=lambert_azimuthal_equal_area)!
Warning (gribapiGetGridType): gridDefinitionTemplateNumber 140 unsupported (gridType=lambert_azimuthal_equal_area)!
Warning (gribapiGetGridType): gridDefinitionTemplateNumber 140 unsupported (gridType=lambert_azimuthal_equal_area)!
cdo remapbil: Bilinear weights from curvilinear (455x639) to projection (455x639) grid

Error (gribapiDefGrid): Unsupported grid type: projection_

I've attached a screenshot which also shows the descriptor file.

Any suggestions?

RE: Lambert Azimuthal Equal Area to Lat Lon grid [Unsupported generic coordinates] - Added by Brian Gaze almost 3 years ago

Sorry, it seems to be working.

I was using the same descriptor file for the output. That needs to be the one which defines the lat lon grid I think. With something like this it gets close to the correct projection:

gridtype = lonlat
xsize =639
ysize =455
xfirst =-11
xinc =0.02
yfirst =50
yinc =0.02

RE: Lambert Azimuthal Equal Area to Lat Lon grid [Unsupported generic coordinates] - Added by Brian Gaze almost 3 years ago

Hi,

I ran into a further problem with some files when doing something like:

cdo remapbil,metdesc_latlon.txt -setgrid,metdesc.txt metoagl_ppt57.grb agl_ppt57.grb

The error is:
Warning (gribapiScanTimestep2): Record 5 (name=rprate id=65.1.0 lev1=0 lev2=0) timestep 2: Parameter not defined at timestep 1!
cdo(1) setgrid: Open failed on >metoagl_ppt57.grb<
Unsupported file structure

I've tried from bash setting:

export GRIB_INVENTORY_MODE=time

That doesn't seem to resolve. Any ideas?

I've attached a grib which causes this.

Thanks

Brian

RE: Lambert Azimuthal Equal Area to Lat Lon grid [Unsupported generic coordinates] - Added by Uwe Schulzweida almost 3 years ago

Here is the grib_ls output of you file:

grib_ls metoagl_ppt57.grb 
metoagl_ppt57.grb
edition      centre       date         dataType     gridType     stepRange    typeOfLevel  level        shortName    packingType  
2            egrr         20210525     fc           lambert_azimuthal_equal_area  57           surface      0            unknown      grid_simple 
2            egrr         20210525     fc           lambert_azimuthal_equal_area  54-57        surface      0            tp           grid_simple 
2            egrr         20210525     fc           lambert_azimuthal_equal_area  54-57        surface      0            rprate       grid_simple 
2            egrr         20210525     fc           lambert_azimuthal_equal_area  57           surface      0            rprate       grid_simple 
2            egrr         20210525     fc           lambert_azimuthal_equal_area  54-57        surface      0            rprate       grid_simple 
2            egrr         20210525     fc           lambert_azimuthal_equal_area  57           surface      0            sd           grid_simple 
2            egrr         20210525     fc           lambert_azimuthal_equal_area  54-57        surface      0            sf           grid_simple 
2            egrr         20210525     fc           lambert_azimuthal_equal_area  57           surface      0            tprate       grid_simple 
2            egrr         20210525     fc           lambert_azimuthal_equal_area  57           surface      0            tsrwe        grid_simple 
2            egrr         20210525     fc           lambert_azimuthal_equal_area  54-57        surface      0            tsrwe        grid_simple 
10 of 10 messages in metoagl_ppt57.grb
The variable rprate occurs three times in the first time step in the file. Unfortunately, CDO cannot process this, sorry.

    (1-11/11)