Borehole NMR processing
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. from plotdata import *
  2. if __name__ == "__main__":
  3. print sys.argv
  4. colour = ['blue','red','green']
  5. ic = 0
  6. #plt.figure(2)
  7. #axmine = plt.gca()
  8. #axmine2 = plt.twinx()
  9. for f in sys.argv[1::]:
  10. ORS = ORSProc(f)
  11. ORS.WindowAndStack()
  12. ORS.T2EnvelopeDetect()
  13. #mono, rfit, [a0,b0,mt2] = ORS.MonoFit()
  14. #env, mod, Time = ORS.DistFit( a0 )
  15. #env, mod, Time = ORS.DistFit( )
  16. # Subtract DC term before 2D fit? Kind of kludgy but I don't see a way around it right now.
  17. plt.figure(1)
  18. print ORS.T2T, ORS.T2D
  19. plt.plot((1e-6*ORS.T2T**3), np.log(np.imag(ORS.T2D)), 'o', markersize=8)
  20. #plt.plot(ORS.T2T, np.real(ORS.T2D))
  21. #plt.plot(ORS.T2T, mono, '--',label=rfit, color=colour[ic])
  22. #plt.plot(ORS.T2T, a0+env, '-+', color=colour[ic], label='dist')
  23. #plt.plot(ORS.T2T, env, '-+',color=colour[ic], label='dist')
  24. #plt.legend()
  25. #guess = np.zeros( len(Time.T2Bins ) )
  26. #total = np.zeros( len(Time.T2Bins ) )
  27. #ib = 0
  28. #for bins in Time.T2Bins:
  29. # if bins > mt2:
  30. # guess[ib] = a0 + b0
  31. # total[ib] = np.sum( mod ) # TODO find log norm and plot there instead!
  32. # break
  33. # ib += 1
  34. #LogMeanT2 = numpy.exp(numpy.sum(PWC*numpy.log(T2BINS), axis=1) / theta )
  35. #theta = np.sum(mod)
  36. #LogMeanT2 = np.exp(np.sum( mod * np.log(Time.T2Bins) ) / theta )
  37. #plt.figure(2)
  38. #axmine.plot(Time.T2Bins, mod, linewidth=2, label=f, color=colour[ic])
  39. #axmine2.plot(Time.T2Bins, guess, '--',color=colour[ic], linewidth=2, label="guess")
  40. #axmine2.plot(mt2, a0+b0, 'o',color=colour[ic], markersize=8, label="guess")
  41. #axmine2.plot(Time.T2Bins, guess, '-',color=colour[ic], linewidth=2, label="total")
  42. #axmine2.plot(LogMeanT2, theta, 's',color=colour[ic], markersize=8, label="total")
  43. ic += 1
  44. #axmine2.set_ylim([0, axmine2.get_ylim()[1]])
  45. #leg = axmine2.legend(numpoints=1)
  46. plt.xlabel(r"$\tau_e^2$ [s]", color='black', fontsize=16)
  47. #plt.ylabel(r"$T_2$ [s]", color='black')
  48. plt.ylabel(r"signal [rku]", color='black', fontsize=16)
  49. #axmine.set_ylabel(r"$A_0$ [i]", color='black')
  50. #plt.figure(1)
  51. #plt.savefig(sys.argv[1].strip(".ors")+"_comp1DT2.pdf", facecolor='white', edgecolor='white', dpi=200)
  52. #plt.figure(2)
  53. #plt.savefig(sys.argv[1].strip(".ors")+"_comp2DT2.pdf", facecolor='white', edgecolor='white', dpi=200)
  54. plt.savefig("hahn.pdf")
  55. plt.show()
  56. exit()