def drawCorrect(): x0,y0=getXt1AndXt2.readCsv('../static/file/20180921185434冷却曲线.csv') x,y = getXt1AndXt2.correct('../static/file/20180921185434冷却曲线.csv') xx = [x[0], x[-1]] yy = [y[0], y[-1]] print(yy) temp1=[] for i in range(len(x0)): temp={'x':x0[i],'y':y0[i]} temp1.append(temp) temp2={ 'start':{ 'x':xx[0], 'y':yy[0] }, 'end':{ 'x':xx[1], 'y':yy[1] } } print(temp2) datas={ 'data1':temp1, 'data2':temp2 } content = json.dumps(datas) resp = Response_headers(content) return resp
def correct(**kwargs): cool = getXt1AndXt2.correct(path2, **kwargs)[0] coolStart = cool[0] coolEnd = cool[-1] heat = getHmAndTm.correctHot(path3, **kwargs)[0] heatStart = heat[0] heatEnd = heat[-1] leftStart = getXt1AndXt2.leftStart leftEnd = getXt1AndXt2.leftEnd rightStart = getXt1AndXt2.rightStart rightEnd = getXt1AndXt2.rightEnd data = { 'coolStart': coolStart, 'coolEnd': coolEnd, 'heatStart': heatStart, 'heatEnd': heatEnd, 'leftStart': leftStart, 'leftEnd': leftEnd, 'rightStart': rightStart, 'rightEnd': rightEnd } return render_template('correct.html', data=data)
def xtWithTemperatureGraph(filename, str): htext = '降温:相对结晶度—温度图像' xtext = 'Temperature(℃)' ytext = 'Xt' x = getXt1AndXt2.correct(filename)[0] y = getXt1AndXt2.caculateXt(filename) cpValue = 'blue' ptext = '相对结晶度—温度' drawPlot(htext, xtext, ytext, x, y, cpValue, ptext, str)
def coolTGraph(filename, str): x = getXt1AndXt2.temperatureToTime(filename) y = getXt1AndXt2.correct(filename)[1] htext = '基线修正后热流量-时间曲线' xtext = 'Temperature(℃)' ytext = 'Heatflow(a.u.)' cpValue = 'blue' ptext = '热流量-时间曲线' drawPlot(htext, xtext, ytext, x, y, cpValue, ptext, str)
def xtWithTemperature(): x = getXt1AndXt2.correct(path2, **kwargs)[0] y = getXt1AndXt2.caculateXt(path2, **kwargs) temp1 = [] for i in range(len(x)): temp = {'x': x[i], 'y': y[i]} temp1.append(temp) datas = { 'data': temp1, } return Response(json.dumps(datas), content_type='application/json')
def coolCorrectGraph(filename, str): x, y = getXt1AndXt2.correct(filename) xx = [x[0], x[len(x) - 1]] yy = [y[0], y[len(x) - 1]] cjValue = 'red' pjtext = '基线' plt.plot(xx, yy, c=cjValue, label=pjtext) htext = '基线修正后降温曲线' xtext = 'Temperature(℃)' ytext = 'Heatflow(a.u.)' cpValue = 'blue' ptext = '降温曲线' drawPlot(htext, xtext, ytext, x, y, cpValue, ptext, str)
def drawCorrectOriginCool(): x1, y1 = getXt1AndXt2.correct(path2, **kwargs) #这个显示的是纠正后的数据 xx = [x1[0], x1[len(x1) - 1]] yy = [y1[0], y1[len(x1) - 1]] x0, y0 = getXt1AndXt2.readCsv(path2) temp1 = [] for i in range(len(x0)): temp = {'x': x0[i], 'y': y0[i]} temp1.append(temp) temp2 = { 'start': { 'x': xx[0], 'y': yy[0] }, 'end': { 'x': xx[1], 'y': yy[1] } } datas = {'data1': temp1, 'data2': temp2} return Response(json.dumps(datas), content_type='application/json')