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 = 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.1.tar.gz (30.9 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.1-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shtRipper_cpp-1.3.1.tar.gz
  • Upload date:
  • Size: 30.9 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.1.tar.gz
Algorithm Hash digest
SHA256 668b3370e52694eaf7d3b75230106dda3efeaf4ad41a8ed95ec0632fa1b6f061
MD5 99190ec3702ab9d7469e13e0acfae5c4
BLAKE2b-256 ea054581fd251e317484c28ee1220d35241b9ff7c3eabb586b7a587d85900737

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shtRipper_cpp-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 32.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da3fa84e4b75ccb42e76d0d2e4b0625deebf95fd9f7a6f0fe0fdf2b686f0d8c7
MD5 84150d1df491e4f26b4bd7b197604d64
BLAKE2b-256 39f8e7d41a0902a131b09b05e43a85d51d39a9aabf82bb48d99c8163f18594f3

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