GithubHelp home page GithubHelp logo

sbrodehl / pypublicdecompwt Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 1.0 19.64 MB

Python bindings for EUMETSAT's PublicDecompWT

License: Apache License 2.0

CMake 7.56% C++ 89.93% Makefile 0.51% C 0.14% Python 1.80% Batchfile 0.02% Shell 0.03%
publicdecompwt eumetsat python-bindings xritdecompress xrit meteosat weather atmospheric-science meteorology wavelet-compression hrit lrit python

pypublicdecompwt's Introduction

pyPublicDecompWT

python versions wheel CI build

This package provides python bindings for some of EUMETSAT’s PublicDecompWT tools.

With pyPublicDecompWT compressed xRIT (HRIT/LRIT) files can now be decompressed in-memory, directly with python! Currently, only bindings for the tool xRITDecompress are available. If you need other classes or functionalities, please open a pull-request!

This repository contains / mirrors the source code for the complete PublicDecompWT tool, as well. Additionally, we provide CMake build files.

Installation

Install pyPublicDecompWT via pip:

pip install pyPublicDecompWT

The following command will verify if the installation succeeded:

python -c "import pyPublicDecompWT"

Requirements

Building from sources requires C/C++, including compiler and standard library support.

  • C/C++ Compiler, e.g. GNU-GCC
  • CMake
  • pybind11

Usage

from pyPublicDecompWT import xRITDecompress

# the file to decompress
compressed_file_path = "test-data/compressed_ref/H-000-MSG4__-MSG4________-HRV______-000012___-202105260000-C_"

# Legacy decompression on disk of given file path,
#  this will write the decompressed file to the current working directory
xRITDecompress(compressed_file_path)

# In-memory decompression of given buffer
with open(compressed_file_path, mode="rb") as fh:
    xRIT = xRITDecompress()
    xRIT.decompress(fh.read())
    uncompressed = xRIT.data()

xRITDecompress

To comply with the original PublicDecompWT project, the pyPublicDecompWT package provides a xRITDecompress executable as well. Our xRITDecompress script is a near drop-in replacement for the original.

There are two changes:

  • We are not writing Decompressed file ... to stdout
  • As per UNIX convention, the short option -s is separated by a space, not by a colon.

The former can be enabled by passing -v to xRITDecompress, however, the latter can't be emulated. Thus, the command line call has to be changed.

In addition to the -s option we added a positional argument files to enable batch processing of (multiple) files in a single call.

$ xRITDecompress --help
usage: xRITDecompress [-h] [--version] [-v] [-s FILE] [files ...]

Command line tool for manual decompression of HRIT/LRIT files.

positional arguments:
  files          Name of compressed HRIT/LRIT file(s)

options:
  -h, --help     show this help message and exit
  --version      show program`s version number and exit
  -v, --verbose  Verbose mode
  -s FILE        Name of compressed HRIT/LRIT file

Versioning Scheme

The versioning scheme of the python bindings is the PublicDecompWT version with the additional version of the python bindings.

Example: Version 1 of the python bindings for PublicDecompWT version 2.8.1 is 2.8.1.1

pypublicdecompwt's People

Contributors

erget avatar sbrodehl avatar tonuccirkn avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

jsolbrig

pypublicdecompwt's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.