# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
import numpy as np
import scipy as sp
import nmrglue as ng

from matplotlib import pyplot as plt

dic, fid = ng.varian.read('HMDB00122-1H')
# -

plt.plot(fid)
plt.show()

# +
spectra = np.abs(sp.fft(fid))

plt.plot(spectra)
plt.show()
# -

plt.plot(np.imag(fid))
plt.show()

plt.plot(np.abs(sp.fft(np.imag(fid))))
plt.show()

plt.plot(np.abs(sp.fft(np.real(fid))))
plt.show()

plt.plot(np.abs(sp.fft(fid)))
plt.show()

plt.plot(np.abs(np.real(sp.fft(fid))))
plt.show()

# +
import json

#json.dumps(np.real(fid).tolist())
#json.dumps(np.abs(np.real(sp.fft(fid))).tolist())
# -

udic = ng.bruker.guess_udic(dic, fid)
uc = ng.fileiobase.uc_from_udic(udic)

plt.plot(uc.ppm_scale(), np.abs(np.real(sp.fft(fid))))
plt.show()



StarcoderdataJupyterScriptsDedupFiltered