Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧪 Further experimental analysis functionality #132

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include LICENSE
include README.md
include *.md
recursive-include piel *
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import piel
import piel.experimental as pe
import piel.analysis.signals.time_data as tda
from piel.models.physical.electrical import E8364A, cables
from datetime import datetime

Expand Down Expand Up @@ -637,3 +638,63 @@ def calibration_propagation_delay_experiment(
# ```

# Note that this has some limitations of revalidation and reinstantion of python classes.

# ### Extract Software-Defined Statistics from a `DataTimeSignalData`

# `piel.analysis` also provides some functionality to analyse the corresponding time-data accordingly.
#
# For example, we might want to extract only the rising edge section of one of the measured signals:

example_signal = calibration_propagation_delay_experiment_data.data.collection[
3
].dut_waveform
example_signal_measurements = (
calibration_propagation_delay_experiment_data.data.collection[3].measurements
)

help(tda.extract_rising_edges)

example_signal_rising_edge_list = tda.extract_rising_edges(
signal=example_signal, lower_threshold_ratio=0.1, upper_threshold_ratio=0.9
)

# We can, for example, plot all these signals overlaid on top of each other - easily by just offsetting to a base reference time:

offset_example_signal_rising_edge_list = tda.offset_time_signals(
example_signal_rising_edge_list
)

piel.visual.plot.signals.plot_multi_data_time_signal(
offset_example_signal_rising_edge_list
)

# We can technically also extract some statistical metrics from this data which we could use to compare with the measured statistics:

offset_example_signal_rising_edge_metrics = tda.extract_rising_edge_statistical_metrics(
offset_example_signal_rising_edge_list
)
offset_example_signal_rising_edge_metrics.table

# | | Metric | Value |
# |---:|:-------------------|------------:|
# | 0 | Value | 0.020914 |
# | 1 | Mean | 0.020914 |
# | 2 | Min | -0.108703 |
# | 3 | Max | 0.150609 |
# | 4 | Standard Deviation | 0.00727889 |
# | 5 | Count | 17 |

# We could now compare this to the metrics the oscilloscope calculated for us previously:

example_signal_measurements["pk-pk_ch2__v"].table

# | | Metric | Value |
# |---:|:-------------------|:-------------------|
# | 0 | Value | 0.274796879094793 |
# | 1 | Mean | 0.276517693380144 |
# | 2 | Min | 0.02445312536438 |
# | 3 | Max | 0.345625005150214 |
# | 4 | Standard Deviation | 0.0039634275277739 |
# | 5 | Count | 9.91k |

# We can see the measurements are approximately close enough which is pretty cool! I would still trust the device measurements more, but with this functionality it is possible to compare a given waveform to a stastistical output from a machine.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -116,6 +117,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -216,6 +218,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -246,6 +249,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -346,6 +350,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -376,6 +381,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -476,6 +482,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -506,6 +513,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -111,6 +112,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -116,6 +117,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -222,6 +224,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -252,6 +255,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -358,6 +362,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -388,6 +393,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -494,6 +500,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -524,6 +531,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -193,6 +194,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -223,6 +225,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand All @@ -234,7 +237,7 @@
"goal": "",
"parameters": {},
"index": 0,
"date_configured": "2024-09-14 18:12:01.920877",
"date_configured": "2024-09-20 00:34:16.673180",
"date_measured": "",
"measurement_configuration_list": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -193,6 +194,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand Down Expand Up @@ -223,6 +225,7 @@
"min": 0,
"max": 0,
"standard_deviation": 0,
"count": null,
"unit": {
"name": "second",
"datum": "second",
Expand All @@ -234,7 +237,7 @@
"goal": "",
"parameters": {},
"index": 1,
"date_configured": "2024-09-14 18:12:01.921088",
"date_configured": "2024-09-20 00:34:16.673332",
"date_measured": "",
"measurement_configuration_list": [
{
Expand Down
Loading
Loading