Generated calibration coefficients

This commit is contained in:
2019-01-15 16:01:30 +00:00
parent c05b0a8724
commit 4b7d0b372d
2 changed files with 36 additions and 5 deletions
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
sys.path.insert(0, "../matrix_test/helper_modules")
import pdb
import numpy as np
import pandas as pd
import csv
def main():
cal_txt = "./cal_vals.txt"
vals = []
with open(cal_txt, 'r') as txt:
for line in txt:
vals.append(line.split(" "))
vals[-1][1] = float(vals[-1][1].rstrip())
vals = {k: v for k, v in vals}
v = []
for key in vals.keys():
v.append(vals[key])
v = np.array(v)
v = v/v.max()
v[np.isnan(v)] = 0.0
out = {}
for key, val in zip(vals.keys(), v):
out_file = './out/calibration_coefficients/{}_cal_coef.npy'.format(key)
np.save(out_file, val)
if __name__ == "__main__":
main()
+2 -5
View File
@@ -107,7 +107,6 @@
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 842.0, 300.0, 32.5, 18.0 ],
"presentation_rect" : [ 842.0, 304.0, 0.0, 0.0 ],
"text" : "1."
}
@@ -122,7 +121,6 @@
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 588.0, 300.0, 32.5, 18.0 ],
"presentation_rect" : [ 588.0, 302.0, 0.0, 0.0 ],
"text" : "1."
}
@@ -137,7 +135,6 @@
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 290.0, 300.0, 32.5, 18.0 ],
"presentation_rect" : [ 290.0, 300.0, 0.0, 0.0 ],
"text" : "1."
}
@@ -191,8 +188,8 @@
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "signal" ],
"patching_rect" : [ 680.0, 563.0, 68.0, 20.0 ],
"text" : "cycle~ 440"
"patching_rect" : [ 680.0, 563.0, 75.0, 20.0 ],
"text" : "cycle~ 1000"
}
}