70 lines
1.8 KiB
Markdown
70 lines
1.8 KiB
Markdown
# Joe's Really Simple Scope Parser
|
|
|
|
Got to be enough times in class that we needed to load the data from either my own
|
|
owon scope or the Gwinstek scopes at the lab. Both semi-standard CSV style exports.
|
|
This package is just neat enough to combine those together.
|
|
|
|
Supports pulling the metadata, time encoding and etc from each of the loadable
|
|
types. All data is normalized to standard SI units (volts and seconds) for consistency.
|
|
|
|
## Instalation
|
|
```bash
|
|
# Install directly from my server
|
|
pip install git+https://git.kitsunehosting.net/Kenwood/simple-scope-parser.git
|
|
```
|
|
|
|
## Installation*in colab*
|
|
|
|
Much the same, but google has their **own format** for installing packages on the google runners.
|
|
|
|
```py
|
|
# Put this *in* a code block
|
|
try:
|
|
from scope_parser import parse_gwinstek_data
|
|
except ImportError:
|
|
!pip install git+https://git.kitsunehosting.net/Kenwood/simple-scope-parser.git
|
|
try:
|
|
from scope_parser import parse_gwinstek_data
|
|
except ImportError:
|
|
raise ImportError("Error installing Joe's lib!")
|
|
```
|
|
|
|
### Local Development
|
|
|
|
```bash
|
|
# Install in development mode
|
|
pip install -e .
|
|
|
|
# Or if you use pipenv
|
|
pipenv install -e .
|
|
```
|
|
|
|
## Quick Start
|
|
|
|
```python
|
|
from scope_parser import parse_owon_data, parse_gwinstek_data
|
|
|
|
# Parse your oscilloscope data (auto-detects file format)
|
|
data = parse_owon_data("your_file.CSV") # or parse_gwinstek_data, etc
|
|
|
|
# Access channel data
|
|
channel = data['CH1']
|
|
|
|
# Get voltage and time arrays
|
|
voltage = channel.voltage_values # in volts (V)
|
|
time = channel.time_values # in seconds (s)
|
|
|
|
# Access metadata
|
|
print(f"Frequency: {channel.frequency} Hz")
|
|
print(f"Peak-to-Peak: {channel.vpp} V")
|
|
print(f"Average: {channel.average} V")
|
|
```
|
|
|
|
## Example Image
|
|
|
|

|
|
|
|
## License
|
|
|
|
MIT License
|