Skip to main content

Python reader to load data acquired with skope-fx

Project description

SkopeDataReader

Python reader to load data acquired with skope-fx

CONSTRUCTOR

scan = DataReader(folder, scanNr)

IN
folder: path of the folder containing the scan data files
scanNr: scan number

OUT
obj scan object holding scan definition

FUNCTIONS

getData(self, datatype, samples=[], channels=[], interleaves=[], dynamics=[])

IN
datatype: string (Type names are defined by the Acq System output file extensions: 'raw', 'phase', 'k', 'kspha', 'kcoco', 'Bfit', 'Gfit')
samples: numpy array of requested samples.
channels: numpy array of requested channels. Relative to acquired channels!
interleaves: numpy array of requested interleaves.
dynamics: numpy array of requested dynamics.

for samples, channels, interleaves, and dynamics: If not present or empty all acquired data is returned

OUT
data: size = [samples, channels, interleaves, dynamics]

getTriggerTimeData(self)

OUT
trigTimes: for versions <= 2022: np array with trigger times
for versions >= 2023: dict with 'triggerTimes' and 'flags'

filterData(self, data, frequencyKHz=50)

Note: this is a preliminary implementation for phase and k data only!

IN
data: data obtained by getData that will be filtered
frequencyKHz: cut off frequency for low pass filtering

OUT
data: filtered data

EXAMPLE USAGE

import SkopeDataReader
import numpy as np
from matplotlib import pyplot as plt

# set scan path & nr
dataPath = 'My\Data\Path'
scanNr   = 1

# Initialize DataReader
scan = SkopeDataReader.DataReader(dataPath, scanNr)

# Load and print trigger times
triggerTime = scan.getTriggerTimeData()
print(triggerTime)

# Load and plot raw data
rawData = scan.getData('raw')
fig, ax = plt.subplots()
ax.plot(abs(rawData[:,:,0,0]))
plt.show()

# Load, filter and plot kspha data
kData = scan.getData('kspha', samples=np.arange(10000))
kData = scan.filterData(kData, frequencyKHz=50)
fig, ax = plt.subplots()
ax.plot(kData[:,:,0,0])
plt.show()

# Load and plot Bfit data
BData = scan.getData('Bfit')
fig, ax = plt.subplots()
ax.plot(BData[0,:,0,:].transpose(), '.-')
plt.show()

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

skopedatareader-1.3.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

skopedatareader-1.3.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: skopedatareader-1.3.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for skopedatareader-1.3.1.tar.gz
Algorithm Hash digest
SHA256 c52b1dc9482153bd05014240866a650381d23947610ee54f5c1b01b418fe4a31
MD5 c70090bf9944f45ec9a90c711d940846
BLAKE2b-256 32a9efd8ea68c225e41c79a416bdb40541fbcd5a8d4da8c1a645073be8871657

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for skopedatareader-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 af65feaea9eee763a7c4ca483fe43e1e966b05e9dab2ea0fa3f2d9b8640e79e2
MD5 d9cf9347909d886f93661cd5cdbc3ff2
BLAKE2b-256 a3d67140ad82b82e9cfd98660f95650496c1f7443aa876d4f6301e8843276a5f

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