[ncl-talk] Unable to read JPEG-packed GRIB2 data with NCL

Mike Kay mike.kay at spire.com
Tue Oct 17 09:43:57 MDT 2017


Hi -

We are unable to read grids from GRIB2 files using JPEG 2000 packing
using NCL (6.4.0). These data files are readable via a number of other
libraries/tools (PyNIO, ecCodes, NetCDF-Java-based tools (e.g.,
THREDDS, PanoplyJ)).

The NCL reads always seem to fail within GDAL:

Example:
ncl 0> nc = addfile("2mtemp-jpeg.grib2","r")
ncl 1> data = nc->TMP_P0_L103_GLL0
ERROR 4: `/vsimem/work_grib_0x8d2f761.jpc' not recognized as a
supported file format.
dec_jpeg2000: Unable to open JPEG2000 image within GRIB file.

This was tested on several machines (RHEL-like OSs (CentOS 7.3,
Scientific Linux 7.2)) with identical results using a conda-installed
ncl via either:

conda create -n ncl_stable -c conda-forge ncl=6.4.0

or

conda create -n ncl_stable -c NCAR -c conda-forge -c defaults ncl

We tested gdal by itself by creating a conda environment using the
same libgdal as installed in the ncl environment (2.2.2) and running a
simple gdal_translate on the data:

> gdal_translate 2mtemp-jpeg.grib2 2mtemp.tiff

gdal_translate successfully reads the grid and creates a GeoTIFF.

I have placed a sample file (2mtemp-jpeg.grib2) in the incoming dir of
the ftp site for you to test against.

Please let me know if we're missing something obvious here.

thanks a lot,
-mike


More information about the ncl-talk mailing list