codes

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

README

go-eccodes

Go wrapper for ecCodes

Examples

https://github.com/amsokol/go-eccodes/tree/master/cmd

Build and install ecCodes C library

Build and install ecCodes C library for Linux
Install development tools
sudo apt-get install gcc make cmake libtool
Build and install zlib

source: zlib

cd ./contrib
tar -xzf zlib-1.2.11.tar.gz
cd zlib-1.2.11
make distclean
./configure --static
make
sudo make install
cd ..
rm -r ./zlib-1.2.11
cd ..
Build and install libpng

source: libpng

cd ./contrib
tar -xzf libpng-1.6.34.tar.gz
cd libpng-1.6.34
./configure --disable-shared
make check
sudo make install
cd ..
rm -r ./libpng-1.6.34
cd ..
Build and install libaec

source: libaec

cd ./contrib
tar -xzf libaec-1.0.2.tar.gz
cd libaec-1.0.2
mkdir build
cd build
../configure --disable-shared
make check
sudo make install
cd ../..
rm -r ./libaec-1.0.2
cd ..
Build end install libjpeg

source: libjpeg

cd ./contrib
tar -xzf jpegsrc.v9b.tar.gz
cd jpeg-9b
./configure --disable-shared
make
make test
sudo make install
cd ..
rm -r ./jpeg-9b
cd ..
Build end install libopenjpeg2

source: libopenjpeg2

cd ./contrib
tar -xzf openjpeg-2.1.2.tar.gz
cd openjpeg-2.1.2
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS:bool=OFF -DBUILD_THIRDPARTY:bool=ON ..
make
sudo make install
cd ../..
rm -r ./openjpeg-2.1.2
cd ..
Build end install libjasper

source: libjasper

cd ./contrib
tar -xzf jasper-version-2.0.14.tar.gz
mkdir build
cd build
cmake -DJAS_ENABLE_SHARED=false ../jasper-version-2.0.14
make clean all
make test
sudo make install
cd ..
rm -r ./build
rm -r ./jasper-version-2.0.14
cd ..
Build end install libeccodes

source: libeccodes

cd ./contrib
tar -xzf eccodes-2.12.0-Source.tar.gz
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=OFF \ 
    -DENABLE_NETCDF=OFF \ 
    -DENABLE_JPG=ON \ 
    -DENABLE_PNG=ON \ 
    -DENABLE_AEC=ON \ 
    -DENABLE_PYTHON=OFF \ 
    -DENABLE_FORTRAN=OFF \ 
    -DENABLE_MEMFS=ON \ 
    -DENABLE_ECCODES_THREADS=OFF \ 
    -DENABLE_ECCODES_OMP_THREADS=ON \
    -DENABLE_EXTRA_TESTS=OFF ..
make
ctest
sudo make install
cd ..
rm -r ./build
rm -r ./eccodes-2.12.0-Source
cd ..
Build and install ecCodes C library for Windows (using MSYS2/MINGW64)
Install MSYS2

source: MSYS2

  • download installer for x86_64

  • install MSYS2 following the guide

  • uncomment MSYS=winsymlinks:nativestrict everywhere to enable symbol links

Install Mingw-w64 (run MSYS2 MinGW 64-bit shell)
pacman -S --needed base-devel git mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake
Install ecCodes dependencies (run MSYS2 MinGW 64-bit shell)
pacman -S mingw-w64-x86_64-zlib
curl -O http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-openjpeg2-2.1.2-2-any.pkg.tar.xz
pacman -U mingw-w64-x86_64-openjpeg2-2.1.2-2-any.pkg.tar.xz
pacman -S mingw-w64-x86_64-jasper
Build and install libaec

source: libaec

  • extract libaec-1.0.2.tar.gz to MSYS2 user home directory

  • replace original files by files from contrib\MSYS2\patches\libaec-1.0.2

  • run MSYS2 MinGW 64-bit shell and execute commands to build and install:

tar -xzf libaec-1.0.2.tar.gz
cd libaec-1.0.2
mkdir build
cd build
../configure
make check
make install
Build end install libeccodes

source: libeccodes

  • extract eccodes-2.5.0-Source.tar.gz to MSYS2 user home directory

  • replace original files by files from contrib\MSYS2\patches\eccodes-2.5.0-Source

  • run MSYS2 MinGW 64-bit shell and execute commands to build and install:

mkdir build
cd build
cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/mingw64 -DDISABLE_OS_CHECK=ON -DENABLE_NETCDF=OFF -DENABLE_JPG=ON -DENABLE_PNG=ON -DENABLE_AEC=ON \
    -DENABLE_PYTHON=OFF -DENABLE_FORTRAN=OFF -DENABLE_MEMFS=OFF ../eccodes-2.5.0-Source
make
make install
  • set ECCODES_DEFINITION_PATH environment variable to <your_path>\msys64\mingw64\share\eccodes\definitions

Documentation

Index

Constants

View Source
const (
	TypeInt64   = "int64"
	TypeFloat64 = "float64"
	TypeString  = "string"
)

type names constants

Variables

View Source
var (
	ErrUnknownTypeCode = errors.New("unknown type code")
	ErrNotImplemented  = errors.New("not implemented")
)

error codes

Functions

This section is empty.

Types

type Counter

type Counter interface{ Count() (int, error) }

type File

type File interface {
	Reader
	Writer
	Counter
	Close()
}

func OpenFile

func OpenFile(f cio.File, productKind int) (File, error)

func OpenFileByPathWithFilter

func OpenFileByPathWithFilter(path string, filter map[string]interface{}) (File, error)

type Float64ArrayUnsafe

type Float64ArrayUnsafe struct {
	Data unsafe.Pointer
}

func (*Float64ArrayUnsafe) Free

func (a *Float64ArrayUnsafe) Free()

type Message

type Message interface {
	GetInterface(key string) (interface{}, error)

	GetString(key string) (string, error)

	GetLong(key string) (int64, error)
	SetLong(key string, value int64) error
	GetLongArray(key string) ([]int64, error)

	GetDouble(key string) (float64, error)
	SetDouble(key string, value float64) error
	GetDoubleArray(key string) ([]float64, error)

	Data() (latitudes []float64, longitudes []float64, values []float64, err error)
	DataUnsafe() (latitudes *Float64ArrayUnsafe, longitudes *Float64ArrayUnsafe, values *Float64ArrayUnsafe, err error)

	GetSize(key string) (int64, error)
	GetType(key string) (string, error)
	Keys() []string

	Close() error
	// contains filtered or unexported methods
}

type Reader

type Reader interface{ Next() (Message, error) }

type Writer

type Writer interface{}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL