Skip to main content

Effortlessly compress / decompress any RINEX file

Project description

Hatanaka Build codecov PyPI PyPI - Downloads

Effortless compression / decompression of RINEX files in Python and on the command line.

Supports all compression formats allowed by the RINEX 2, 3 and 4 standards:

  • Hatanaka compression for Observation Data Files,
  • LZW (.Z), gzip (.gz), bzip2 (.bz2) and .zip.

Quick Start

Installation

Wheels are available from PyPI for Linux, MacOS and Windows. Python versions 3.6 and up are supported.

pip install hatanaka

To ensure that everything is working as expected, it is recommended to also run the included tests.

pip install pytest
pytest --pyargs hatanaka

Python

import hatanaka
from pathlib import Path

# decompression
rinex_data = hatanaka.decompress('1lsu0010.21d.Z')
# or
rinex_data = hatanaka.decompress(Path('1lsu0010.21d.Z').read_bytes())
# or, creates '1lsu0010.21o' directly on disk
hatanaka.decompress_on_disk('1lsu0010.21d.Z')

# compression
Path('1lsu0010.21d.gz').write_bytes(hatanaka.compress(rinex_data))
# or
Path('1lsu0010.21d.gz').write_bytes(hatanaka.compress('1lsu0010.21o'))
# or, creates '1lsu0010.21d.gz' directly on disk
hatanaka.compress_on_disk('1lsu0010.21o')

Any errors during Hatanaka compression/decompression will be raised as a HatanakaException and any non-critical problems reported as warnings.

These functions are idempotent – already decompressed / compressed data is returned as is.

CLI

The same functionality is also made available from the command line via rinex-decompress and rinex-compress.

Simply provide a list of RINEX files to compress or decompress. stdin-stdout is used if no files are specified.

To remove the original files after conversion, add -d/--delete. The input file is removed only if conversion succeeds without any errors or warnings.

# creates 1lsu0010.21o
rinex-decompress 1lsu0010.21d.Z

# creates 1lsu0010.21d.gz
rinex-compress 1lsu0010.21o

# stdin-stdout example
rinex-decompress < 1lsu0010.21d.Z | grep 'SYS / # / OBS TYPES'

Additionally, the original rnx2crx and crx2rnx executables are also installed for other tools that might want to make use of them, such as RTKLIB.

Development

Building from source

Installing from source code is also an option, in which case the RNXCMP tools will be built in the process. This assumes a C compiler is available and is usually picked up automatically by Python's setuptools. If that is not the case, you can instead provide a path to one by setting the CC environment variable.

pip install git+https://github.com/valgur/hatanaka

Changes

See CHANGELOG.md.

Attribution

Martin Valgur – this Python library.

RNXCMP software for Hatanaka compression support:
Hatanaka, Y. (2008), A Compression Format and Tools for GNSS Observation Data, Bulletin of the Geospatioal Information Authority of Japan, 55, 21-30. (available at https://www.gsi.go.jp/ENGLISH/Bulletin55.html)

License

This library is provided under the MIT license. Additional license terms apply for the included RNXCMP software – see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hatanaka-2.8.1.tar.gz (41.2 kB view details)

Uploaded Source

Built Distributions

hatanaka-2.8.1-py3-none-win_arm64.whl (55.3 kB view details)

Uploaded Python 3 Windows ARM64

hatanaka-2.8.1-py3-none-win_amd64.whl (55.3 kB view details)

Uploaded Python 3 Windows x86-64

hatanaka-2.8.1-py3-none-win32.whl (52.3 kB view details)

Uploaded Python 3 Windows x86

hatanaka-2.8.1-py3-none-musllinux_1_1_x86_64.whl (56.4 kB view details)

Uploaded Python 3 musllinux: musl 1.1+ x86-64

hatanaka-2.8.1-py3-none-musllinux_1_1_s390x.whl (57.3 kB view details)

Uploaded Python 3 musllinux: musl 1.1+ s390x

hatanaka-2.8.1-py3-none-musllinux_1_1_ppc64le.whl (61.5 kB view details)

Uploaded Python 3 musllinux: musl 1.1+ ppc64le

hatanaka-2.8.1-py3-none-musllinux_1_1_i686.whl (57.8 kB view details)

Uploaded Python 3 musllinux: musl 1.1+ i686

hatanaka-2.8.1-py3-none-musllinux_1_1_aarch64.whl (57.5 kB view details)

Uploaded Python 3 musllinux: musl 1.1+ ARM64

hatanaka-2.8.1-py3-none-manylinux_2_17_s390x.whl (53.6 kB view details)

Uploaded Python 3 manylinux: glibc 2.17+ s390x

hatanaka-2.8.1-py3-none-manylinux_2_17_ppc64le.whl (57.1 kB view details)

Uploaded Python 3 manylinux: glibc 2.17+ ppc64le

hatanaka-2.8.1-py3-none-manylinux_2_17_aarch64.whl (53.9 kB view details)

Uploaded Python 3 manylinux: glibc 2.17+ ARM64

hatanaka-2.8.1-py3-none-manylinux_2_5_x86_64.whl (52.7 kB view details)

Uploaded Python 3 manylinux: glibc 2.5+ x86-64

hatanaka-2.8.1-py3-none-manylinux_2_5_i686.whl (52.6 kB view details)

Uploaded Python 3 manylinux: glibc 2.5+ i686

hatanaka-2.8.1-py3-none-macosx_11_0_arm64.whl (50.7 kB view details)

Uploaded Python 3 macOS 11.0+ ARM64

hatanaka-2.8.1-py3-none-macosx_10_9_x86_64.whl (50.1 kB view details)

Uploaded Python 3 macOS 10.9+ x86-64

hatanaka-2.8.1-py3-none-macosx_10_9_universal2.whl (74.3 kB view details)

Uploaded Python 3 macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file hatanaka-2.8.1.tar.gz.

File metadata

  • Download URL: hatanaka-2.8.1.tar.gz
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for hatanaka-2.8.1.tar.gz
Algorithm Hash digest
SHA256 96c1abdcf7bb3bc010da8314db38b3f458120b254f866652f20ac1c929846907
MD5 e2ae8297d1dad146241fd50e72b4cdcb
BLAKE2b-256 21851e4cab748ce31784fdd6fdbd1be103b3a43566162246f77a0a65f5e6be9c

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-win_arm64.whl.

File metadata

  • Download URL: hatanaka-2.8.1-py3-none-win_arm64.whl
  • Upload date:
  • Size: 55.3 kB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for hatanaka-2.8.1-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 402624db70856e804b6d3438921ae8058b033f8ceb05bb2c228f8d46250d78b1
MD5 09f1644379c78a39320400e7b3eab46a
BLAKE2b-256 50edcdf9c23e48bff43db6892ea4301862a4a69d0ee2ee724a6056f7de33c0b2

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: hatanaka-2.8.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 55.3 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for hatanaka-2.8.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 23e9ade070cdfd1dcb2f4029f8adfed82b5b3fd58317fa91df7ff43f1681b299
MD5 24f52870c2b12e5decc105dae2ff87b7
BLAKE2b-256 066db160af5d7bb153ae923cc5cba7adbbce3964f60e0f3839d62b3e07baaa6f

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-win32.whl.

File metadata

  • Download URL: hatanaka-2.8.1-py3-none-win32.whl
  • Upload date:
  • Size: 52.3 kB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for hatanaka-2.8.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 7a3628e116241cb51d15d1efada4fcd87c97db30bfd479ec540c024139fa088b
MD5 a807587a07a40cedf0affdfa3b5905b1
BLAKE2b-256 9d797209ae1dd765bf1604bcdb24a5515f3a8509c4efeabfb30701bd1aa0e29d

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for hatanaka-2.8.1-py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 d8e406ce6b5d40b83d659ba39640e592e62cdd894b4c5425d0773f6461bb9b4b
MD5 6059233471711387806d4f7033d6173e
BLAKE2b-256 eb943e67994b0628eb9931370c6002dd8652b394e9a06128d0d56179074f3626

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-musllinux_1_1_s390x.whl.

File metadata

File hashes

Hashes for hatanaka-2.8.1-py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 7e8cc8829d4a0bc74b13fba07aecca5e3fcde0ea602a090bf6946931e5c5b108
MD5 4b917ddfc51f402b7a4742c7295f03f8
BLAKE2b-256 41eacb7259499aaf56e4a3081fea75bcec6d1ce16dd686d97a2d64f22050ebd1

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-musllinux_1_1_ppc64le.whl.

File metadata

File hashes

Hashes for hatanaka-2.8.1-py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 d86f2fb9e847a7fe5d4a330f3cbadc487d902b03021c609c5dd750688b712074
MD5 43aa6e56cfc0bf5ecb6d95ecbb3e4f65
BLAKE2b-256 c963108fd543a7c44ddb0660ca0da7dee488d49abafc53f0e6330fef1a3e60b7

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for hatanaka-2.8.1-py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 1a7990b900643fa3b0a720cec83e1b7bd544128ae3a11509f27fea4d0ae9d131
MD5 08acca03ca546be411847207442f52a4
BLAKE2b-256 6a165d1ad0ba439fef59297c2291c44588d524a824a9f37e96288af04988e526

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for hatanaka-2.8.1-py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 8ea03da8ffa218d7db49239f5225a0cb4f874a04de83b4cbdf2dfe6e312c249c
MD5 ade5139d81fa5cd487e8c5b5536f4989
BLAKE2b-256 a4e7a8fd2c7f6d5c78564b528cc35e754f61fb24669feb240fcd8b556bb27a9b

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-manylinux_2_17_s390x.whl.

File metadata

File hashes

Hashes for hatanaka-2.8.1-py3-none-manylinux_2_17_s390x.whl
Algorithm Hash digest
SHA256 085bcf99f0dbf7ad6c05a5e192e222a82173e901fb3255d21eabc41bcca02f23
MD5 cdd5a36504bfa6a5c4aa5b6974e06eff
BLAKE2b-256 1643c556d7be16ee244961e068203ba8ff1453055e60225b9a64e1ac8a6cdd03

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-manylinux_2_17_ppc64le.whl.

File metadata

File hashes

Hashes for hatanaka-2.8.1-py3-none-manylinux_2_17_ppc64le.whl
Algorithm Hash digest
SHA256 4a92a3b1cd403d826802f3b9b83d68479a210ed91bffd37efeb9aa2b87dea521
MD5 660a3c1a9529957293567b4b739f2253
BLAKE2b-256 a05d87b70ac6893bbdac87575dac8a483b4f799f1c0680eedd5ca0376433c480

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for hatanaka-2.8.1-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 eac8f15d0546a065f43d83e2bb9f1909167c3304e407363fb58c6469ffc8eb11
MD5 131336f9bd45eb333ff12b1a8843d510
BLAKE2b-256 033ac4f48358b5e757398d220320bd30df7c9f51c54b1ebe3247ab065aea5222

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for hatanaka-2.8.1-py3-none-manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 6ae11ee5c489a803a2b34a546ab604b84be12b226e1655bbe7654701e22fe38e
MD5 1ae3b4ddcb4097810f57fce6054e59c5
BLAKE2b-256 6e9ba57161a908d914218db26166d0be5416f4327c81236ecc3fb83378dc058e

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-manylinux_2_5_i686.whl.

File metadata

File hashes

Hashes for hatanaka-2.8.1-py3-none-manylinux_2_5_i686.whl
Algorithm Hash digest
SHA256 abb9c216fd37fae932008da1824b9e12842ad468b7bc5a92d21da1867fa32499
MD5 8579015c1025d654a36b47e3c5dfe07a
BLAKE2b-256 612030e86fb61f5e5cdb978b35171d57d092e77e559b8ee72db950bf202ef1ea

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for hatanaka-2.8.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e20c9d97483f08890f28745c144f412d57f524289efd7a83a300d98aabdad567
MD5 42f54270971c50cfdbf7931c5d7238b4
BLAKE2b-256 b5e7da05e0135b7b5837b7abbd17abb8d3469f2f92e316abe06c1f756aa09278

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for hatanaka-2.8.1-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5131cb9160bfe9df3127f8909a2bb47a0e3afc1778e72a49a5866522357e7d76
MD5 204020f26cde5523b1de055f6ac81fd5
BLAKE2b-256 b216c34a798c6e943563e2c801e256ecaf5586d4ecb43e25a89e26a8071c3416

See more details on using hashes here.

Provenance

File details

Details for the file hatanaka-2.8.1-py3-none-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for hatanaka-2.8.1-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 eb61234c5f53991433097ba26eaacf05c177df3b8b986d4043acc03da5e11d70
MD5 232418138f11b9fa81ce732726c47816
BLAKE2b-256 79efff252a15ce3ceb99463daa8be0cf7f6d534e727e0c187021849493d629d5

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page