Hello-
Upon a request from one of users, I am giving a simple example python code that you can simply click “Load Modules…” button and select from Python shell “py” window. Basically, it generates .csv files in the same directory of the save files with assignment, frequencies, data height and signal-to-noise. You can easily customize as per your needs.
Woonghee
CODE:
import os
import sparky
s = sparky.session_list[0]
proj = s.project
spec_list = proj.spectrum_list()
for spec in spec_list:
peak_list = spec.peak_list()
csv_path = spec.save_path + '.csv'
data = 'Assignment,'
for i in range(spec.dimension):
temp = 'w' + str(i+1) + ','
data += temp
data += 'Data Height,Signal-to-noise\n'
for peak in peak_list:
data += peak.assignment
data += ','
# Uncomment if ppm value is wanted. Header should be in line, too.
#for i in range(spec.dimension):
# data += str(peak.frequency[i])
# data += ','
for i in range(spec.dimension):
data += str(peak.frequency[i] * spec.hz_per_ppm[i])
data += ','
data += str(peak.data_height)
data += ','
data += str(peak.data_height / spec.noise)
data += '\n'
f = open(csv_path, 'w')
f.write(data)
f.close()
--
Woonghee Lee, I.E.I.P., M.S., Ph.D.
Assistant Professor
Department of Chemistry
University of Colorado Denver
1151 Arapahoe St. (Science Bldg.) Rm 4128A
Denver, CO 80217-3364, USA
https://clas.ucdenver.edu/chemistry/woonghee-lee
Shipping/Mailing Address:
Woonghee Lee
1201 5th St. UCD CHEM-194
P.O. Box 173364 (USPS)
Denver, CO 80204, USA