12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- from plotdata import *
-
- if __name__ == "__main__":
- print sys.argv
- colour = ['blue','red','green']
- ic = 0
-
- #plt.figure(2)
- #axmine = plt.gca()
- #axmine2 = plt.twinx()
-
- for f in sys.argv[1::]:
- ORS = ORSProc(f)
- ORS.WindowAndStack()
- ORS.T2EnvelopeDetect()
-
- #mono, rfit, [a0,b0,mt2] = ORS.MonoFit()
- #env, mod, Time = ORS.DistFit( a0 )
- #env, mod, Time = ORS.DistFit( )
-
- # Subtract DC term before 2D fit? Kind of kludgy but I don't see a way around it right now.
-
- plt.figure(1)
- print ORS.T2T, ORS.T2D
- plt.plot((1e-6*ORS.T2T**3), np.log(np.imag(ORS.T2D)), 'o', markersize=8)
- #plt.plot(ORS.T2T, np.real(ORS.T2D))
- #plt.plot(ORS.T2T, mono, '--',label=rfit, color=colour[ic])
- #plt.plot(ORS.T2T, a0+env, '-+', color=colour[ic], label='dist')
- #plt.plot(ORS.T2T, env, '-+',color=colour[ic], label='dist')
- #plt.legend()
-
- #guess = np.zeros( len(Time.T2Bins ) )
- #total = np.zeros( len(Time.T2Bins ) )
- #ib = 0
- #for bins in Time.T2Bins:
- # if bins > mt2:
- # guess[ib] = a0 + b0
- # total[ib] = np.sum( mod ) # TODO find log norm and plot there instead!
- # break
- # ib += 1
-
- #LogMeanT2 = numpy.exp(numpy.sum(PWC*numpy.log(T2BINS), axis=1) / theta )
- #theta = np.sum(mod)
- #LogMeanT2 = np.exp(np.sum( mod * np.log(Time.T2Bins) ) / theta )
-
- #plt.figure(2)
- #axmine.plot(Time.T2Bins, mod, linewidth=2, label=f, color=colour[ic])
- #axmine2.plot(Time.T2Bins, guess, '--',color=colour[ic], linewidth=2, label="guess")
- #axmine2.plot(mt2, a0+b0, 'o',color=colour[ic], markersize=8, label="guess")
- #axmine2.plot(Time.T2Bins, guess, '-',color=colour[ic], linewidth=2, label="total")
- #axmine2.plot(LogMeanT2, theta, 's',color=colour[ic], markersize=8, label="total")
- ic += 1
- #axmine2.set_ylim([0, axmine2.get_ylim()[1]])
- #leg = axmine2.legend(numpoints=1)
- plt.xlabel(r"$\tau_e^2$ [s]", color='black', fontsize=16)
- #plt.ylabel(r"$T_2$ [s]", color='black')
- plt.ylabel(r"signal [rku]", color='black', fontsize=16)
- #axmine.set_ylabel(r"$A_0$ [i]", color='black')
-
- #plt.figure(1)
- #plt.savefig(sys.argv[1].strip(".ors")+"_comp1DT2.pdf", facecolor='white', edgecolor='white', dpi=200)
-
- #plt.figure(2)
- #plt.savefig(sys.argv[1].strip(".ors")+"_comp2DT2.pdf", facecolor='white', edgecolor='white', dpi=200)
- plt.savefig("hahn.pdf")
- plt.show()
- exit()
|