python-odisi
Import data generated by the Luna ODiSI System
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.5%) to scientific vocabulary
Repository
Import data generated by the Luna ODiSI System
Basic Info
Statistics
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 4
Metadata Files
README.md
Python reader for exported ODiSI data
Description
This python package defines a reader and helper methods to handle data exported from the Luna ODiSI 6000 optical measuring system. It allows for an easier retrieval of data corresponding to each segment, as well as the possibility to interpolate the results based on additional measurements, such as experimental load. Doing this manually requires some amount of python code, which can be avoided by using this package.
Installation
Install as usual:
bash
pip install python-odisi
Usage
Retrieve data from a *.tsv file
The library can be used to read files in the following manner:
```python from odisi import read_tsv
d = readtsv("datagages.tsv")
List all gages
gages = d.gages
List all segments
segments = d.segments
Get the data for a specific gage, e.g. with the label 'A'
dgage = d.getgage("A")
Get the data for a specific segment, e.g. with the label 'Seg-1'
dseg, xseg = d.get_segment("Seg-1") ```
Interpolation of data
The package allows to easily interpolate an external signal (e.g. the load during the test). For this, two strategies can be followed:
1. Interpolate the data from the sensors using the timestamps from the external signal
```python import polars as pl
load = pl.readcsv("loaddata.csv")
Assume that the timestamp is in the column 'time'
d.interpolate(load.select(pl.col("time"))) ```
Then you should be able to plot your data against the measured load:
```python import matplotlib.pyplot as plt
dgage = d.getgage("A")
Assume that the load data is in column 'load'
aload = load.select(pl.col("load")).toseries()
plt.plot(dgage, aload) ```
2. Interpolate the data from the external signal to match the timestamp from the sensor data
```python import polars as pl
load = pl.readcsv("loaddata.csv")
Assume that the timestamp is in the column 'time'
newload = d.interpolatesignal(data=load, time="time") ```
Then you should be able to plot your data against the measured load:
```python import matplotlib.pyplot as plt
dgage = d.getgage("A")
Assume that the load data is in column 'load'
aload = newload.select(pl.col("load")).to_series()
plt.plot(dgage, aload) ```
In both cases it is assumed that the timestamps from both files are synchronized, i.e. that both measuring computers have synchronized clocks.
Clip data during interpolation
It is probable that the measurements from both data sources (ODiSI and additional system) were started at different times.
This produces some annoyances during the processing of the data due to the mismatch in datapoints.
To remedy this, the option clip=True can be passed to both interpolation methods (interpolate(...) and interpolate_signal(...)), which will clip the data to the common time interval between both signals.
```python import polars as pl
load = pl.readcsv("loaddata.csv")
Assume that the timestamp is in the column 'time'
d.interpolate(load.select(pl.col("time")), clip=True) ```
Export segment data
The data of all segments can be exported to individual csv-files with the following code:
python
d.export_segments_csv(prefix="my_experiment", path="data_folder")
Tests
The package includes a test suite which should be run with pytest:
bash
poetry run pytest
Citation
bib
@software{Tapia_2023,
author = {Tapia Camú, Cristóbal},
title = {{python-odisi: Import data generated by the Luna ODiSI System}},
url = {https://github.com/cristobaltapia/python-odisi},
version = {v0.3},
year = {2023},
}
Owner
- Name: Cristóbal Tapia
- Login: cristobaltapia
- Kind: user
- Location: Stuttgart, Germany
- Company: University of Stuttgart
- Website: www.cristobal-tapia.de
- Repositories: 39
- Profile: https://github.com/cristobaltapia
Citation (CITATION.cff)
cff-version: 1.2.0 authors: - family-names: "Tapia Camú" given-names: "Cristóbal" orcid: "https://orcid.org/0000-0003-2228-1686" title: "python-odisi: Import data generated by the Luna ODiSI System" version: v0.3 url: "https://github.com/cristobaltapia/python-odisi"
GitHub Events
Total
- Release event: 1
- Push event: 4
- Create event: 3
Last Year
- Release event: 1
- Push event: 4
- Create event: 3
Packages
- Total packages: 1
-
Total downloads:
- pypi 36 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 11
- Total maintainers: 1
pypi.org: python-odisi
Import and post-process data generated by the Luna ODiSI System
- Documentation: https://python-odisi.readthedocs.io/
- License: mit
-
Latest release: 0.7.1
published over 1 year ago
Rankings
Maintainers (1)
Dependencies
- numpy ^1.26.2
- polars ^0.19.17
- python ^3.10
- colorama 0.4.6
- contourpy 1.3.1
- cycler 0.12.1
- exceptiongroup 1.2.2
- fonttools 4.55.3
- iniconfig 2.0.0
- kiwisolver 1.4.7
- matplotlib 3.10.0
- numpy 2.2.0
- packaging 24.2
- pillow 11.0.0
- pluggy 1.5.0
- polars 1.17.1
- pyparsing 3.2.0
- pytest 8.3.4
- python-dateutil 2.9.0.post0
- python-odisi 0.5.1
- six 1.17.0
- tomli 2.2.1