kanpiaoxue 2019-09-06
Grid point fields in some grib files are encoded into the JPEG 2000 code. To process these fields with eccodes, you need to enable the JPG feature. On MacOS, there are some details should be showed.
According to the wiki page about ecCodes installation, ecCodes uses CMake for compilation and installation. If you wish to enable JPG feature of ecCodes, you are advised to configure the build with:
cmake -DENABLE_JPG=ON ...
This option of cmake should look for Jasper or OpenJPG. Install openjpeg
package with Homebrew for MacOS:
brew install openjpeg
openjpeg
has been installed at /usr/local/Cellar/openjpeg/2.3.1
.
Then we need to make cmake recognize the installed openjpeg.
cmake -DENABLE_JPG=ON -DOPENJPEG_INCLUDE_DIR=/usr/local/Cellar/openjpeg/2.3.1/include/openjpeg-2.3
In the printed debug information, you will see:
-- The following OPTIONAL packages have been found: * Git * HDF5 * NumPy * CMath * JPEG * OpenJPEG
You have enabled JPG feature successfully.
try_files $uri $notfound =404;add_header Cache-Control max-age=100;log_not_found off;access_log off;