Skip to content

Commit

Permalink
added stacked plot
Browse files Browse the repository at this point in the history
  • Loading branch information
ludwigc committed Nov 8, 2023
1 parent b6a9d2d commit 6492c30
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
14 changes: 13 additions & 1 deletion metabolabpy/nmr/nmrConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def __init__(self):
self.print_light_mode = True
self.print_dataset_colours = False
self.print_standard_colours = True
self.print_stacked_plot = False
self.print_auto_scale = False
self.print_spc_linewidth = 2
self.print_axes_linewidth = 2
self.print_ticks_font_size = 10
Expand All @@ -52,6 +54,8 @@ def make_config(self):
print_light_mode = 'yes' if self.print_light_mode is True else 'no'
print_dataset_colours = 'yes' if self.print_dataset_colours is True else 'no'
print_standard_colours = 'yes' if self.print_standard_colours is True else 'no'
print_stacked_plot = 'yes' if self.print_stacked_plot is True else 'no'
print_auto_scale = 'yes' if self.print_auto_scale is True else 'no'
config['GUI'] = {'auto_plot': auto_plot,
'keep_zoom': keep_zoom,
'font_size': str(self.font_size),
Expand Down Expand Up @@ -81,7 +85,9 @@ def make_config(self):
'print_spc_linewidth': self.print_spc_linewidth,
'print_axes_linewidth': self.print_axes_linewidth,
'print_ticks_font_size': self.print_ticks_font_size,
'print_label_font_size': self.print_label_font_size}
'print_label_font_size': self.print_label_font_size,
'print_stacked_plot': print_stacked_plot,
'print_auto_scale': print_auto_scale}
return config

def save_config(self):
Expand Down Expand Up @@ -148,6 +154,12 @@ def set_print_dataset_colours(self, value):
def set_print_standard_colours(self, value):
self.print_standard_colours = True if value == "yes" else False

def set_print_stacked_plot(self, value):
self.print_stacked_plot = True if value == "yes" else False

def set_print_auto_scale(self, value):
self.print_auto_scale = True if value == "yes" else False

def set_print_spc_linewidth(self, value):
self.print_spc_linewidth = int(value)

Expand Down
15 changes: 4 additions & 11 deletions metabolabpy/nmr/nmrDataSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -1367,18 +1367,11 @@ def read_spc(self, data_set_name='', data_set_number='', dataset=1):
nd1.data_set_number = data_set_number
nd1.read_spc()
if nd1.acq.pul_prog_name.find('stddiff') > 0:
nd2 = nd.NmrData()
nd2.data_set_name = data_set_name
nd2.data_set_number = data_set_number
nd2.read_spc()
nd1.dim = 1
nd2.dim = 1
nd1.fid[0] -= nd1.fid[1]
nd1.fid = np.copy(np.delete(nd1.fid, 1, 0))
nd2.fid = np.copy(np.delete(nd2.fid, 0, 0))
self.nmrdat[self.s].append(nd1)
self.nmrdat[self.s].append(nd2)
else:
self.nmrdat[self.s].append(nd1)
nd1.dim = 1

self.nmrdat[self.s].append(nd1)
# end read_spc

def read_spcs(self, data_path, data_exp, dataset=1):
Expand Down

0 comments on commit 6492c30

Please sign in to comment.