Skip to main content

C++ parser of .sht files.

Project description

shtRipper

Код для извлечения данных из .sht файлов. На текущий момент файлы версии ниже 2 не поддерживаются, что будет исправлено при необходимости.

Перед обновлением пакета остановить все запущенные питоновские интерпретаторы!

Надёжнее удалять предыдущую версию, чтобы гарантированно обновились бинарные файлы.

Пример кода для чтения всего sht файла:

import shtRipper



filename = 'd:/data/cfm/original/sht40808.SHT'

res = shtRipper.ripper.read(filename)

print(res.keys())

Пример кода для чтения только выбранных сигналов:

import shtRipper



filename = 'd:/data/cfm/original/sht40808.SHT'

res = shtRipper.ripper.read(filename, ['Лазер', 'Emission electrode voltage', 'Emission electrode current'])

print(res.keys())

Пример кода для упаковки данных в формат .sht:

import shtRipper

import math  # used only for example sin() signal



to_pack = {

   'signal with error': {

       'comment': 'Точки хранят ещё и погрешность, требует много памяти.',

       'unit': 'T_e(eV)',

       'x': x,

       'y': T_c,

       'err': T_err

   },

   'X Y signal': {

       'comment': 'Точки хранятся парой значений, требует много памяти.',

       'unit': 'T_e(eV)',

       'x': x,

       'y': n_c

   },

   'Y signal with fixed X-grid': {

       'comment': 'Этот тип хранения данных предназначен для данных 16-бит АЦП',

       'unit': 'U(V)',

       'tMin': 0.0,  # mininun time

       'tMax': 100.0,  # maximum time

       'offset': 0.0,  # ADC zero level offset

       'yRes': 0.0001,  # ADC resolution: 0.0001 Volt per adc bit

       'y': [math.sin(i / 10) for i in range(100)]

   }

}



packed = shtRipper.ripper.write(path='D:/tmp/', filename='example.SHT', data=to_pack)

if len(packed) != 0:

    print('packed error = "%s"' % packed)

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

shtRipper_cpp-1.3.2.tar.gz (31.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shtRipper_cpp-1.3.2-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file shtRipper_cpp-1.3.2.tar.gz.

File metadata

  • Download URL: shtRipper_cpp-1.3.2.tar.gz
  • Upload date:
  • Size: 31.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for shtRipper_cpp-1.3.2.tar.gz
Algorithm Hash digest
SHA256 696b28e76245dcf016dc4e095f5b76732fc711d7febde550f8fc9d1bc6d0dc11
MD5 3b95a5672e4677f25de599c9a920be76
BLAKE2b-256 488b2ba4e51f1eb54752ac1f43cf3b24b4830d54cb026b9e9187b0cab8968471

See more details on using hashes here.

File details

Details for the file shtRipper_cpp-1.3.2-py3-none-any.whl.

File metadata

  • Download URL: shtRipper_cpp-1.3.2-py3-none-any.whl
  • Upload date:
  • Size: 32.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for shtRipper_cpp-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 09b725801a08389ede0fa70bd1d4cd1b6b3ef24d758fd7a8ed8e12e34a9ca8f7
MD5 e92ec08f35aafbf1e2d70b712a92782b
BLAKE2b-256 6942c81e423c2ea0ac086702bb23f26bd7065277af2707581d0749672612853e

See more details on using hashes here.

Supported by

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