Python reader to load data acquired with skope-fm or skope-fx
Project description
SkopeDataReader
Python reader to load data acquired with skope-fm or 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
Built Distribution
File details
Details for the file SkopeDataReader-1.3.0.tar.gz
.
File metadata
- Download URL: SkopeDataReader-1.3.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
7f44fdb68b6b6064b9b843ac89fd8d16980f82a811a8197fa88739a70af0d2bf
|
|
MD5 |
0c99573dae525a22d42ab77c2c236424
|
|
BLAKE2b-256 |
1959dff27034c43ffa9829cce25a6dd76484d867d332b96f53d7df6d2a38f4b6
|
File details
Details for the file SkopeDataReader-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: SkopeDataReader-1.3.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
999e2dd867ef01a17f0aa4600ff9f545517362a7562ed6b06fc8e83b99b1ddd1
|
|
MD5 |
6274c356332c0481c9287ea91f421669
|
|
BLAKE2b-256 |
16e63869db99a561f4e9012de056ecba5acd6439c10cecee52bb0e9816fad6fd
|