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 hashes)

Uploaded Source

Built Distribution

shtRipper_cpp-1.3.1-py3-none-any.whl (32.0 kB view hashes)

Uploaded Python 3

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