diff --git a/README.md b/README.md index 3349acf16f073ad855ab7af9f09f05d898cf4a4b..1ffe305c8c74b435adcd07b08202030a329d10af 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,12 @@ Pick what you want. You can also get data processor at https://recolic.net/phy and https://recolic.net/phy2. -''' sh +**DeplecatedWarning: All scripts must use ./quickmap.py however some of them don't (because of historical reason). Fix it by yourself if there's any bug.** + +``` sh Tip: folder name with leading lowercase letter indicates: this experiment was made at first semester. with leading uppercase letter : second -''' +``` ## 黑åå• diff --git a/sound/quickmap.py b/sound/quickmap.py deleted file mode 100644 index c2ced5264fca1033d11ae0fc6d897587ef34c0c3..0000000000000000000000000000000000000000 --- a/sound/quickmap.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/env python3 -# -*- coding: UTF-8 -*- -# Gereric: Draw line. -# Recolic Keghart, Apr 29, 2017. - -import numpy -from scipy.optimize import leastsq -import matplotlib.pyplot as plt -from matplotlib import rcParams - -def GetMap(parrX, parrY, windowX = 12, windowY = 8, line = False, passO = False): - print('This quickmap.py is deleted becaused of out of date!!!') - arrX, arrY = parrX, parrY - maxX, maxY = max(arrX)*1.2, max(arrY)*1.25 - - # Do calculate - # y = k x + b (I = k V + b) - print('Your input: ', arrX, '|', arrY) - print('Data collection done. Generating result...') - V, I = numpy.array(arrX), numpy.array(arrY) - def lineFunc(kb, v): - k,b=kb - if passO: - return k*v - else: - return k*v+b - - lossFunc = lambda kb, v, i : lineFunc(kb, v) - i - - # Fire! - if line: - kb0 = [10,0] - kbFinal = leastsq(lossFunc, kb0, args=(V, I)) - k,b=kbFinal[0] - print('Fit line done. Y=', k, 'X +', b) - else: - print('Drawing map without fitting a line...') - - # Draw function map. - rcParams['grid.linestyle']='-' - rcParams['grid.color'] = 'blue' - rcParams['grid.linewidth'] = 0.2 - plt.figure(figsize=(windowX, windowY)) - plt.scatter(V,I,color="red",label="Sample Point",linewidth=3) - if line: - px=numpy.linspace(0,maxX,1000) - py=k*px+b - plt.plot(px,py,color="orange",label="Fitting Line",linewidth=2) - plt.legend() - plt.grid() - plt.show() - - def toFloat(sstr): - if sstr == '': - return 0.0 - else: - return float(sstr)