Project

General

Profile

outputtab and corrdinate conversion

Added by Youen Grusson over 3 years ago

Dear all

I have a question about the way "outputtab" print "lat" and "long"

I have a Grib file of precipitation rather simple here is what I get with sinfo:

$ cdo sinfo Test.grb
File format : GRIB2
-1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter ID
1 : unknown unknown v accum 1 1 1142761 1 P16 : 52.1.0
Grid coordinates :
1 : projection : points=1142761 (1069x1069)
mapping : lambert_conformal_conic
x : 0 to 5874000 by 5500 m
y : 0 to 5874000 by 5500 m
Vertical coordinates :
1 : surface : levels=1
Time coordinate : unlimited steps
RefTime = 1961-01-01 06: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
1961-01-01 06:00:00 1961-01-02 06:00:00 1961-01-03 06:00:00 1961-01-04 06:00:00
1961-01-05 06:00:00 1961-01-06 06:00:00 1961-01-07 06:00:00 1961-01-08 06:00:00
1961-01-09 06:00:00 1961-01-10 06:00:00 1961-01-11 06:00:00 1961-01-12 06:00:00
1961-01-13 06:00:00 1961-01-14 06:00:00 1961-01-15 06:00:00 1961-01-16 06:00:00
1961-01-17 06:00:00 1961-01-18 06:00:00 1961-01-19 06:00:00 1961-01-20 06:00:00
1961-01-21 06:00:00 1961-01-22 06:00:00 1961-01-23 06:00:00 1961-01-24 06:00:00
1961-01-25 06:00:00 1961-01-26 06:00:00 1961-01-27 06:00:00 1961-01-28 06:00:00
1961-01-29 06:00:00 1961-01-30 06:00:00 1961-01-31 06:00:00

we can see that coordinate is supposed to be a Lambert conformal conic
But when I use "outputtab" e.g.

$ cdo -outputtab,lon,lat Test.grb > testoutGrid

I get "long" and "lat" as (what it seems to be) wgs84 coordinate:

0.0184767 24.1343
0.0676782 24.1391
0.116887 24.1439
0.166102 24.1486
0.215324 24.1533
0.264553 24.158
0.313788 24.1626
0.363031 24.1672
0.41228 24.1718
0.461535 24.1764
0.510797 24.1809
0.560066 24.1854
0.609341 24.1899
...........

my question is:

is "outputtab" converting automatically the Lambert conformal conic coordinate in wgs84 coordinate?
in this case, is the function using the actual parameter of the projection (standard_parallel ; longitude_of_central_meridian ect...) from the grib file to do the conversion?

thanks a lot for your help

Youen

Test.grb (67.6 MB) Test.grb

Replies (4)

RE: outputtab and corrdinate conversion - Added by Uwe Schulzweida over 3 years ago

Yes, that's correct! outputtab prints the lon/lat coordinates in degrees. These coordinates are automatically converted from the Lambert conformal conic coordinates via the projection library libproj (https://proj.org/) if CDO was compiled with libproj support. The parameters of the projection a read from the GRIB file. Use the CDO option -v to verify the projection parameter passed to libproj:

cdo -v -outputtab,lon,lat Test.grb > testoutGrid

cdo    outputtab: Proj inv: +proj=lcc +a=6.37123e+06 +lon_0=8 +lat_0=50 +lat_1=50 +lat_2=50 +x_0=2.93702e+06 +y_0=2.93703e+06 

RE: outputtab and corrdinate conversion - Added by Youen Grusson over 3 years ago

hi

so nice that perfect
So if I may just another question about that:

if I want in addition to put a -sellonlatbox along with my outputtab request what coordinate should I used with it, the native one or WGS
to be honest I am trying both and I keep having this error

cdo(1) sellonlatbox (Abort): Longitudinal dimension is too small!

with both

cdo -outputtab, date, value -sellonlatbox,-17.486,-15.3025,20.292,20.9832 Test.grb > TestOut

or

cdo -outputtab, date, value -sellonlatbox,5500,27500,5500,27500 Test.grb > TestOut

and I can't figure out why

thanks a lot for your quick answer

RE: outputtab and corrdinate conversion - Added by Uwe Schulzweida over 3 years ago

The parameters of sellonlatbox must also be given in degrees.
Unfortunately the error message is wrong. The correct error message with your data is:

Unsupported grid type: projection
This operator needs the data in geographic lon/lat coordinates and the LCC coordinates are not converted automatically.
You have to use setgridtype,curvilinear to convert the grid coordinates:
cdo -outputtab,date,value -sellonlatbox,-17.486,-15.3025,20.292,20.9832 -setgridtype,curvilinear Test.grb > TestOut

RE: outputtab and corrdinate conversion - Added by Youen Grusson over 3 years ago

Working perfectly

thanks a lot for the quick help

    (1-4/4)