Project

General

Profile

assistance with selindexbox on grib file

Added by Davide Mauro Ferrario almost 2 years ago

Dear all,

I am trying to select a subregion in a .grib file with selindexbox. The command executes correctly but when I try to read the new file (or run the command to remap it) I get an error: all the rows of the grib are shown correctly, but at the end I have:

Date     Time   Level Gridsize    Miss :     Minimum        Mean     Maximum : Parameter ID
2009-01-30 06:00:00 0 4 0 : -1.3904 0.047119 0.98462 : 52.1.0

Wrong GRIB indicator section: found ><
GRIB message error
ECCODES ERROR : grib_handle_new_from_message: No final 7777 in message!
!!! failed call to grib_set_double( grib_handle* h, "missingValue", -9000000000000000086637831186808832.000000) !!!
../../../../libcdi/src/stream_gribapi.c at line 1507: my_grib_set_double(gh, "missingValue", missval) failed: Key/value not found

The grib file is in Lambert Conformal Conical Grid, and I am trying to crop the area of interest and then remap it to a lonlat grid with remapbil.

If I convert the file to .nc, remap it to a lonlat grid and then crop it, the final file is created correctly, but I would prefer to crop it at once and then proceed with the other operations in order to save space.

Thank you,
Davide


Replies (5)

RE: assistance with selindexbox on grib file - Added by Karin Meier-Fleischer almost 2 years ago

Hi Davide,

without the grib file and the commands you are using it is not really possible to help.

RE: assistance with selindexbox on grib file - Added by Davide Mauro Ferrario almost 2 years ago

Hi Karin,

the commands I am running are:
cdo -selindexbox,562,612,424,489 input_file.grb output_file.grb
cdo -info output_file.grb

and
cdo -remapbil,new_grid.txt output_file.grb remapped_file.grb

Below I attach an example of the input file and the new grid.

outgrid_crop_cerra.txt (101 Bytes) outgrid_crop_cerra.txt new latlon grid of the cropped area
ofile_cerra_land_200901.zip (121 MB) ofile_cerra_land_200901.zip Example of input file (CERRA land reanalysis for precipitation, downloaded from copernicus climate data store)

RE: assistance with selindexbox on grib file - Added by Karin Meier-Fleischer almost 2 years ago

Which version are you using? I'm not able to reproduce the error with CDO 2.0.5 and 2.1.1.

cdo -selindexbox,562,612,424,489 ofile_cerra_land_200901.grb osel.grb
cdo sinfon osel.grb
   File format : GRIB2
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter name
     1 : unknown  unknown  v instant       1   1      3366   1  P24  : lsm           
     2 : unknown  unknown  v instant       1   1      3366   1  P16  : orog          
     3 : unknown  unknown  v accum         1   1      3366   1  P24  : tp            
   Grid coordinates :
     1 : projection               : points=3366 (51x66)
                          mapping : lambert_conformal_conic
                                x : 0 to 275000 by 5500 m
                                y : 0 to 357500 by 5500 m
   Vertical coordinates :
     1 : surface                  : levels=1
   Time coordinate :
                             time : unlimited steps
     RefTime =  2009-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
  2009-01-01 06:00:00  2009-01-02 06:00:00  2009-01-03 06:00:00  2009-01-04 06:00:00
  2009-01-05 06:00:00  2009-01-06 06:00:00  2009-01-07 06:00:00  2009-01-08 06:00:00
  2009-01-09 06:00:00  2009-01-10 06:00:00  2009-01-11 06:00:00  2009-01-12 06:00:00
  2009-01-13 06:00:00  2009-01-14 06:00:00  2009-01-15 06:00:00  2009-01-16 06:00:00
  2009-01-17 06:00:00  2009-01-18 06:00:00  2009-01-19 06:00:00  2009-01-20 06:00:00
  2009-01-21 06:00:00  2009-01-22 06:00:00  2009-01-23 06:00:00  2009-01-24 06:00:00
  2009-01-25 06:00:00  2009-01-26 06:00:00  2009-01-27 06:00:00  2009-01-28 06:00:00
  2009-01-29 06:00:00  2009-01-30 06:00:00  2009-01-31 06:00:00

cdo -remapbil,outgrid_crop_cerra.txt osel.grb oremap.grb
cdo sinfon oremap.grb

   File format : GRIB2
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter name
     1 : unknown  unknown  v instant       1   1      3366   1  P24  : lsm           
     2 : unknown  unknown  v instant       1   1      3366   1  P16  : orog          
     3 : unknown  unknown  v accum         1   1      3366   1  P24  : tp            
   Grid coordinates :
     1 : lonlat                   : points=3366 (51x66)
                              lon : 9.864262 to 12.36426 by 0.05 degrees_east
                              lat : 44.50143 to 47.75143 by 0.05 degrees_north
   Vertical coordinates :
     1 : surface                  : levels=1
   Time coordinate :
                             time : unlimited steps
     RefTime =  2009-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
  2009-01-01 06:00:00  2009-01-02 06:00:00  2009-01-03 06:00:00  2009-01-04 06:00:00
  2009-01-05 06:00:00  2009-01-06 06:00:00  2009-01-07 06:00:00  2009-01-08 06:00:00
  2009-01-09 06:00:00  2009-01-10 06:00:00  2009-01-11 06:00:00  2009-01-12 06:00:00
  2009-01-13 06:00:00  2009-01-14 06:00:00  2009-01-15 06:00:00  2009-01-16 06:00:00
  2009-01-17 06:00:00  2009-01-18 06:00:00  2009-01-19 06:00:00  2009-01-20 06:00:00
  2009-01-21 06:00:00  2009-01-22 06:00:00  2009-01-23 06:00:00  2009-01-24 06:00:00
  2009-01-25 06:00:00  2009-01-26 06:00:00  2009-01-27 06:00:00  2009-01-28 06:00:00
  2009-01-29 06:00:00  2009-01-30 06:00:00  2009-01-31 06:00:00

RE: assistance with selindexbox on grib file - Added by Davide Mauro Ferrario almost 2 years ago

Hi Karin,

I am using version 1.9.3 (attached the screenshot of the libraries installed) on Windows Linux server. I'll try with the newer version.
I also found out that by selecting a wider grid (at least 150 cells per side) the file is created without any error.

Thank you,
Davide

RE: assistance with selindexbox on grib file - Added by Estanislao Gavilan almost 2 years ago

Hi David,

you are using an old version of cdo. I recommend you to install cdo via anaconda or miniconda in your linux system.

best regards

Estanislao

    (1-5/5)