Skip to main content

shtRipper

На винде в зависимостях MSVS140

Код для извлечения данных из .sht файлов.

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

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

import shtRipper

filename = '\\\\172.16.12.127\\Data\\sht40808.SHT'
res = shtRipper.ripper.read(filename)
print(res.keys())

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

import shtRipper

filename = '\\\\172.16.12.127\\Data\\sht40808.SHT'
res = shtRipper.ripper.read(filename, ['Лазер', 'Emission electrode voltage', 'Emission electrode current'])
print(res.keys())

Пример кода для объединения нескольких sht файлов в один без распаковки/запаковки:

import shtRipper

path: str = ''
filename: str = 'out.sht'
filenames: list[str] = ['in1.sht', 'in2.sht']
ripper.merge('', filename, filenames)

Пример кода для упаковки данных в формат .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': 'Этот тип хранения данных предназначен для данных АЦП',
       '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)

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

import shtRipper

shotn = 46128
Tukhmeneva_path = '\\\\172.16.12.127\\Pub\\!!!SHT Tuxmeneva\\'
sht_path = '\\\\172.16.12.127\\Data\\'

names = [
{
    'yRes': 2.5,
    'frequencyHz': 50e3,
    'ch': [
        {
            'name': 'continuum',
            'comment': 'PassiveSpectroscopy, ADC 1, ch 1',
            'unit': 'S(V)'
        },
        {
            'name': 'Линия C III (465 nm)',
            'comment': 'PassiveSpectroscopy, ADC 1, ch 2',
            'unit': 'S(V)'
        },
        {
            'name': 'Линия He I (587 nm)',
            'comment': 'PassiveSpectroscopy, ADC 1, ch 3'
        },{
            'name': 'Линия N II (568 nm)',
            'comment': 'PassiveSpectroscopy, ADC 1, ch 4',
            'yRes': -2.5
        },{
            'name': 'Линия O II (441 nm)',
            'comment': 'PassiveSpectroscopy, ADC 1, ch 5',
            'yRes': -2.5
        },{
            'name': 'Линия B II (343 nm)',
            'comment': 'PassiveSpectroscopy, ADC 1, ch 6',
            'yRes': -2.5
        },{
            'name': 'Линия Fe I (427 nm)',
            'comment': 'PassiveSpectroscopy, ADC 1, ch 7',
            'yRes': -2.5
        },{
            'skip': True,
            'comment': 'PassiveSpectroscopy, ADC 1, ch 8',
        },{
            'skip': True,
            'comment': 'PassiveSpectroscopy, ADC 1, ch 9',
        },
        {
            'skip': True,
            'comment': 'PassiveSpectroscopy, ADC 1, ch 10',
        },
        {
            'skip': True,
            'comment': 'PassiveSpectroscopy, ADC 1, ch 11',
        },
        {
            'skip': True,
            'comment': 'PassiveSpectroscopy, ADC 1, ch 12',
        },{
            'skip': True,
            'comment': 'PassiveSpectroscopy, ADC 1, ch 13',
        },{
            'skip': True,
            'comment': 'PassiveSpectroscopy, ADC 1, ch 14',
        },{
            'skip': True,
            'comment': 'PassiveSpectroscopy, ADC 1, ch 15',
        },{
            'skip': True,
            'comment': 'PassiveSpectroscopy, ADC 1, ch 16',
        }
    ]
},
{
    'yRes': 2.5,
    'frequencyHz': 50e3,
    'ch': [
        {
            'comment': 'PassiveSpectroscopy, ADC 2, ch 1'
        },{
            'comment': 'PassiveSpectroscopy, ADC 2, ch 2'
        },{
            'comment': 'PassiveSpectroscopy, ADC 2, ch 3'
        },{
            'comment': 'PassiveSpectroscopy, ADC 2, ch 4'
        },{
            'comment': 'PassiveSpectroscopy, ADC 2, ch 5'
        },{
            'comment': 'PassiveSpectroscopy, ADC 2, ch 6'
        },{
            'comment': 'PassiveSpectroscopy, ADC 2, ch 7'
        },{
            'comment': 'PassiveSpectroscopy, ADC 2, ch 8'
        },{
            'comment': 'PassiveSpectroscopy, ADC 2, ch 9'
        },{
            'comment': 'PassiveSpectroscopy, ADC 2, ch 10'
        },{
            'comment': 'PassiveSpectroscopy, ADC 2, ch 11'
        },{
            'comment': 'PassiveSpectroscopy, ADC 2, ch 12'
        },{
            'comment': 'PassiveSpectroscopy, ADC 2, ch 13'
        },{
            'comment': 'PassiveSpectroscopy, ADC 2, ch 14'
        },{
            'comment': 'PassiveSpectroscopy, ADC 2, ch 15'
        },{
            'comment': 'PassiveSpectroscopy, ADC 2, ch 16'
        }
    ]
},
{
    'yRes': 2.5,
    'frequencyHz': 50e3,
    'ch': [
        {
            'comment': 'PassiveSpectroscopy, ADC 3, ch 1'
        },
        {
            'comment': 'PassiveSpectroscopy, ADC 3, ch 2'
        },
        {
            'comment': 'PassiveSpectroscopy, ADC 3, ch 3'
        },{
            'comment': 'PassiveSpectroscopy, ADC 3, ch 4'
        },{
            'comment': 'PassiveSpectroscopy, ADC 3, ch 5'
        },{
            'comment': 'PassiveSpectroscopy, ADC 3, ch 6'
        },{
            'comment': 'PassiveSpectroscopy, ADC 3, ch 7'
        },{
            'comment': 'PassiveSpectroscopy, ADC 3, ch 8'
        },{
            'comment': 'PassiveSpectroscopy, ADC 3, ch 9'
        },{
            'comment': 'PassiveSpectroscopy, ADC 3, ch 10'
        },
        {
            'comment': 'PassiveSpectroscopy, ADC 3, ch 11'
        },
        {
            'comment': 'PassiveSpectroscopy, ADC 3, ch 12'
        },{
            'comment': 'PassiveSpectroscopy, ADC 3, ch 13'
        },{
            'comment': 'PassiveSpectroscopy, ADC 3, ch 14'
        },{
            'comment': 'PassiveSpectroscopy, ADC 3, ch 15'
        },{
            'comment': 'PassiveSpectroscopy, ADC 3, ch 16'
        }
    ]
},
    {
    'yRes': 2.5,
    'frequencyHz': 50e3,
    'ch': [
        {
            'comment': 'PassiveSpectroscopy, ADC 4, ch 1'
        },
        {
            'comment': 'PassiveSpectroscopy, ADC 4, ch 2'
        },
        {
            'comment': 'PassiveSpectroscopy, ADC 4, ch 3'
        },{
            'comment': 'PassiveSpectroscopy, ADC 4, ch 4'
        },{
            'comment': 'PassiveSpectroscopy, ADC 4, ch 5'
        },{
            'comment': 'PassiveSpectroscopy, ADC 4, ch 6'
        },{
            'comment': 'PassiveSpectroscopy, ADC 4, ch 7'
        },{
            'comment': 'PassiveSpectroscopy, ADC 4, ch 8'
        },{
            'comment': 'PassiveSpectroscopy, ADC 4, ch 9'
        },
        {
            'comment': 'PassiveSpectroscopy, ADC 4, ch 10'
        },
        {
            'comment': 'PassiveSpectroscopy, ADC 4, ch 11'
        },
        {
            'comment': 'PassiveSpectroscopy, ADC 4, ch 12'
        },{
            'comment': 'PassiveSpectroscopy, ADC 4, ch 13'
        },{
            'comment': 'PassiveSpectroscopy, ADC 4, ch 14'
        },{
            'comment': 'PassiveSpectroscopy, ADC 4, ch 15'
        },{
            'comment': 'PassiveSpectroscopy, ADC 4, ch 16'
        }
    ]
}
]

merge: list[str] = []
#merge.append('%ssht%d.SHT' % (sht_path, shotn))

for i in range(4):
    path = '%s%d\\ADC%d\\' % (Tukhmeneva_path, shotn, i+1)
    packed = shtRipper.ripper.write_ADC(path=path, filename='adc_data.slow', data=names[i])
    merge.append('%s\\adc_data.slow.sht' % path)

print(merge)

shtRipper.ripper.merge('', 'all_%d.sht' % shotn, merge)

#res = shtRipper.ripper.read('all_%d.sht' % shotn)
#print(res.keys())


print('OK.')

Metadata

Release files for shtripper-cpp 1.6.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shtripper-cpp 1.6.3
File Size Uploaded Provenance
shtripper_cpp-1.6.3.tar.gz 320.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for shtripper-cpp 1.6.3
File Interpreter ABI Platform
shtripper_cpp-1.6.3-py3-none-any.whl Python 3 none any Details

Total release size: 639.0 kB

Release files / shtripper_cpp-1.6.3.tar.gz

Download URL shtripper_cpp-1.6.3.tar.gz
Size 320.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7c45f008b987c23a5e8a880769b907c08da5cf410420d1e044001a777657c2b4
BLAKE2b-256 checksum
How to use checksums
0cbdd5a41c2d232a5bda909b1c2e152f53219f797f2403facb1b667f9d204735
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / shtripper_cpp-1.6.3-py3-none-any.whl

Download URL shtripper_cpp-1.6.3-py3-none-any.whl
Size 319.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7606aee6c4b4d2aca797cdbd923fa6b9e97c671a1908b00d0069c072581a0903
BLAKE2b-256 checksum
How to use checksums
e1178f4abd3975434e4767843efc567a22202ebab7cd58dd7143ae7bb7035dd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for shtripper-cpp 1.6.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.6.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page