Commit 27f110ac authored by Yan's avatar Yan
Browse files

Experimental support for newer rawautoparams

parent ee764fe4
......@@ -79,7 +79,7 @@ def load_file(parent, chrom_plot, spc, d_set, ms_s, fn, chrom_s,
return
if autoparams == True:
try:
ms_s['params'], rawheaders = load_params(filename)
ms_s['params'], rawheaders, chrom_s['machtype'] = load_params(filename)
segments = [len(subset['chrom_dat'][0]) for subset in d_set]
indicies = [sum(segments[:i+1]) for i in range(len(segments))]
ms_s['headers'] = np.split(rawheaders, indicies)[:-1]
......@@ -203,7 +203,7 @@ def main():
ms = dict(annotation=[], name="Spectrum", xlabel="m/z",
ylabel="ion count", xtics=20, predict=None,
params=[], headers=[], texts=[])
chrom = dict(x=[0], y=[0], t_start=None, t_end=None,
chrom = dict(x=[0], y=[0], t_start=None, t_end=None, machtype=None,
name="Chromatogram", xlabel="time(min)",
ylabel="total ion count", timesarg=[])
filename = [None]
......
......@@ -377,12 +377,17 @@ def legendize(rawlegend, chrom_data):
marks = ["-","+"]
quads = ["q3","q1"]
def translate(wut):
if chrom_data['machtype'] == 47:
if wut[1] in (0,1):
text = "{}{}ms; m/z = {:.1f}-{:.1f}".format(
marks[int(wut[0])], quads[int(wut[1])], *wut[4:])
else:
text = "{}ms^{} {:.2f}@{:.1f}V; m/z = {:.1f}-{:.1f}".format(
marks[int(wut[0])], *wut[1:])
elif chrom_data['machtype'] == 57:
text = "ms; m/z = {:.2f}@{:.1f}V; m/z = {:.1f}-{:.1f}".format(*wut)
else:
text = "unknown header type"
return text
strdata = [translate(i) for i in np.unique(np.array(rawlegend), axis=0)]
strtext = " and ".join(strdata) + "; t = {:.2f}-{:.2f} min".format(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment