prozentuale Threshhold

This commit is contained in:
Ibrahim El Sayed
2021-06-22 21:37:58 +00:00
parent dcdfe61ffd
commit 9ec1c8a32e
4 changed files with 61689 additions and 98 deletions

View File

@@ -3,7 +3,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "42f984d5",
"id": "9706d045",
"metadata": {},
"outputs": [],
"source": [
@@ -15,7 +15,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "ec63028f",
"id": "77388c0f",
"metadata": {},
"outputs": [],
"source": [
@@ -37,7 +37,7 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "dc9ddde3",
"id": "0fd516ff",
"metadata": {},
"outputs": [],
"source": [
@@ -56,7 +56,7 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "e99c1e58",
"id": "389e84c0",
"metadata": {},
"outputs": [],
"source": [
@@ -67,7 +67,7 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "7138aeeb",
"id": "197a57c5",
"metadata": {},
"outputs": [],
"source": [
@@ -78,7 +78,7 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "abba0b88",
"id": "e456ab87",
"metadata": {},
"outputs": [],
"source": [
@@ -117,7 +117,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "d06fb083",
"id": "cc789523",
"metadata": {},
"outputs": [],
"source": []
@@ -125,7 +125,7 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "557f0030",
"id": "c59a84aa",
"metadata": {},
"outputs": [],
"source": [
@@ -141,7 +141,7 @@
{
"cell_type": "code",
"execution_count": 8,
"id": "7dcb89ad",
"id": "0c0a4649",
"metadata": {},
"outputs": [],
"source": [
@@ -196,7 +196,7 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "537d751b",
"id": "5a618dd4",
"metadata": {},
"outputs": [],
"source": [
@@ -212,7 +212,7 @@
{
"cell_type": "code",
"execution_count": 10,
"id": "a23e6a6a",
"id": "52e5cc13",
"metadata": {},
"outputs": [],
"source": [
@@ -229,7 +229,7 @@
{
"cell_type": "code",
"execution_count": 11,
"id": "8b41532e",
"id": "62463866",
"metadata": {},
"outputs": [],
"source": [
@@ -241,25 +241,32 @@
{
"cell_type": "code",
"execution_count": 12,
"id": "4db9e8f5",
"id": "57ec862e",
"metadata": {},
"outputs": [],
"source": [
"def shorten_v2(l):\n",
" \n",
" \n",
" temp_X = l['Force']\n",
" thresh = 100\n",
" temp_over_T = 0\n",
" \n",
" temp_short = [] ##Daten nachdem vorne abgeschnitten wird\n",
" temp_final = [] ##Daten nachdem auch hinten abgeschnitten wurde\n",
" temp_X = l['Force']\n",
" thresh = 100\n",
" temp_over_T = 0\n",
" maxVal = 0\n",
" temp_short = [] ##Daten nachdem vorne abgeschnitten wird\n",
" temp_final = [] ##Daten nachdem auch hinten abgeschnitten wurde\n",
" temp_short_X = []\n",
" \n",
" \n",
" \n",
" for a in range (0, len(temp_X) ):\n",
" if(temp_X[a]>maxVal):\n",
" maxVal = temp_X[a]\n",
" \n",
"\n",
" threshVal = maxVal*0.05\n",
" \n",
" \n",
" for b in range (0, len(temp_X)): \n",
" if(temp_X[b]>thresh):\n",
" if(temp_X[b]>threshVal):\n",
" temp_over_T = b\n",
" break\n",
" \n",
@@ -268,7 +275,7 @@
" \n",
" \n",
" for y in range ((len(temp_short_X)-1),0, -1): \n",
" if(temp_short_X[y] > thresh):\n",
" if(temp_short_X[y] > threshVal):\n",
" temp_over_T = y\n",
" break\n",
" \n",
@@ -288,7 +295,7 @@
{
"cell_type": "code",
"execution_count": 13,
"id": "99c61605",
"id": "cc2a6529",
"metadata": {},
"outputs": [],
"source": [
@@ -298,17 +305,25 @@
},
{
"cell_type": "code",
"execution_count": 16,
"id": "bd7aff75",
"execution_count": 14,
"id": "66975d62",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[list([108.0, 362.0, 683.0, 994.0, 1306.0, 1380.0, 1526.0, 1724.0, 1895.0, 1985.0, 2077.0, 2040.0, 1997.0, 1917.0, 1623.0, 1357.0, 1087.0, 785.0, 450.0, 146.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 67.0, 615.0, 927.0, 1212.0, 1450.0, 1483.0, 1546.0, 1634.0, 1617.0, 1691.0, 1654.0, 1663.0, 1618.0, 1550.0, 1519.0, 1519.0, 1742.0, 1892.0, 1966.0, 1966.0, 2092.0, 2040.0, 2048.0, 1997.0, 1953.0, 1946.0, 1926.0, 1791.0, 1497.0, 1112.0, 678.0, 279.0, 0])]\n",
"[list([362.0, 683.0, 994.0, 1306.0, 1380.0, 1526.0, 1724.0, 1895.0, 1985.0, 2077.0, 2040.0, 1997.0, 1917.0, 1623.0, 1357.0, 1087.0, 785.0, 450.0, 146.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 67.0, 615.0, 927.0, 1212.0, 1450.0, 1483.0, 1546.0, 1634.0, 1617.0, 1691.0, 1654.0, 1663.0, 1618.0, 1550.0, 1519.0, 1519.0, 1742.0, 1892.0, 1966.0, 1966.0, 2092.0, 2040.0, 2048.0, 1997.0, 1953.0, 1946.0, 1926.0, 1791.0, 1497.0, 1112.0, 678.0, 279.0, 0])]\n",
"----------------------\n",
"[list([656.0, 729.0, 1036.0, 1253.0, 1465.0, 1662.0, 1707.0, 1730.0, 1897.0, 1890.0, 1885.0, 1856.0, 1833.0, 1789.0, 1746.0, 1752.0, 1766.0, 1799.0, 1780.0, 1759.0, 1743.0, 1732.0, 1735.0, 1824.0, 1788.0, 1737.0, 1637.0, 1547.0, 1443.0, 1199.0, 862.0, 400.0, 127.0, 0])]\n"
"[list([656.0, 729.0, 1036.0, 1253.0, 1465.0, 1662.0, 1707.0, 1730.0, 1897.0, 1890.0, 1885.0, 1856.0, 1833.0, 1789.0, 1746.0, 1752.0, 1766.0, 1799.0, 1780.0, 1759.0, 1743.0, 1732.0, 1735.0, 1824.0, 1788.0, 1737.0, 1637.0, 1547.0, 1443.0, 1199.0, 862.0, 400.0, 0])]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/opt/jupyterhub/lib/python3.8/site-packages/numpy/core/_asarray.py:83: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray\n",
" return array(a, dtype, copy=False, order=order)\n"
]
}
],
@@ -323,7 +338,7 @@
{
"cell_type": "code",
"execution_count": 15,
"id": "f57350ff",
"id": "cc664cf6",
"metadata": {},
"outputs": [
{
@@ -344,18 +359,32 @@
},
{
"cell_type": "code",
"execution_count": 17,
"id": "78157f79",
"execution_count": 18,
"id": "d8463d51",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[list([362.0, 683.0, 994.0, 1306.0, 1380.0, 1526.0, 1724.0, 1895.0, 1985.0, 2077.0, 2040.0, 1997.0, 1917.0, 1623.0, 1357.0, 1087.0, 785.0, 450.0, 146.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 67.0, 615.0, 927.0, 1212.0, 1450.0, 1483.0, 1546.0, 1634.0, 1617.0, 1691.0, 1654.0, 1663.0, 1618.0, 1550.0, 1519.0, 1519.0, 1742.0, 1892.0, 1966.0, 1966.0, 2092.0, 2040.0, 2048.0, 1997.0, 1953.0, 1946.0, 1926.0, 1791.0, 1497.0, 1112.0, 678.0, 279.0, 0])]\n",
" [list([464.0, 587.0, 824.0, 1016.0, 1156.0, 1285.0, 1454.0, 1603.0, 1728.0, 1851.0, 1921.0, 1963.0, 1952.0, 1872.0, 1742.0, 1631.0, 1641.0, 1629.0, 1628.0, 1668.0, 1696.0, 1765.0, 1803.0, 1879.0, 1879.0, 1859.0, 1812.0, 1738.0, 1683.0, 1678.0, 1698.0, 1722.0, 1741.0, 1783.0, 1769.0, 1758.0, 1752.0, 1750.0, 1710.0, 1668.0, 1673.0, 1694.0, 1705.0, 1687.0, 1594.0, 1447.0, 1398.0, 1303.0, 1220.0, 1172.0, 1183.0, 1203.0, 1280.0, 1364.0, 1420.0, 1433.0, 1409.0, 1386.0, 1490.0, 1658.0, 1725.0, 1807.0, 1869.0, 1904.0, 1929.0, 1918.0, 1888.0, 1847.0, 1777.0, 1543.0, 1232.0, 812.0, 356.0, 0])]\n",
" [list([403.0, 534.0, 734.0, 931.0, 1133.0, 1235.0, 1317.0, 1391.0, 1434.0, 1499.0, 1438.0, 1423.0, 1396.0, 1407.0, 1445.0, 1412.0, 1443.0, 1461.0, 1475.0, 1504.0, 1535.0, 1469.0, 1255.0, 1044.0, 794.0, 554.0, 236.0, 0])]\n",
" ...\n",
" [list([1416.0, 1265.0, 1542.0, 1964.0, 2060.0, 2060.0, 2010.0, 2035.0, 1993.0, 1935.0, 1935.0, 1949.0, 1844.0, 1651.0, 1571.0, 1554.0, 1574.0, 1496.0, 1357.0, 1045.0, 701.0, 348.0, 94.0, 7.0, 10.0, 12.0, 14.0, 11.0, 29.0, 105.0, 783.0, 970.0, 1294.0, 1389.0, 1514.0, 1479.0, 1439.0, 1055.0, 557.0, 43.0, 11.0, 12.0, 16.0, 17.0, 17.0, 19.0, 19.0, 19.0, 16.0, 16.0, 16.0, 17.0, 16.0, 15.0, 15.0, 13.0, 14.0, 14.0, 17.0, 18.0, 16.0, 17.0, 16.0, 16.0, 13.0, 17.0, 17.0, 16.0, 14.0, 17.0, 15.0, 13.0, 15.0, 17.0, 15.0, 14.0, 13.0, 16.0, 14.0, 15.0, 15.0, 14.0, 16.0, 15.0, 51.0, 665.0, 615.0, 779.0, 939.0, 975.0, 1042.0, 1129.0, 1195.0, 1271.0, 1298.0, 1314.0, 1289.0, 1238.0, 1076.0, 865.0, 562.0, 209.0, 0])]\n",
" [list([847.0, 707.0, 927.0, 1026.0, 1148.0, 1299.0, 1391.0, 1462.0, 1512.0, 1549.0, 1568.0, 1610.0, 1607.0, 1807.0, 2033.0, 2194.0, 2310.0, 2420.0, 2606.0, 2588.0, 2585.0, 2581.0, 2587.0, 2581.0, 2562.0, 2503.0, 2290.0, 1634.0, 1058.0, 607.0, 0])]\n",
" [list([656.0, 729.0, 1036.0, 1253.0, 1465.0, 1662.0, 1707.0, 1730.0, 1897.0, 1890.0, 1885.0, 1856.0, 1833.0, 1789.0, 1746.0, 1752.0, 1766.0, 1799.0, 1780.0, 1759.0, 1743.0, 1732.0, 1735.0, 1824.0, 1788.0, 1737.0, 1637.0, 1547.0, 1443.0, 1199.0, 862.0, 400.0, 0])]]\n"
]
}
],
"source": [
"save_shorted(data)"
"print(data)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ec8f2fea",
"id": "bbb07d9b",
"metadata": {},
"outputs": [],
"source": []

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.