Skip to content

Commit

Permalink
chore: fix save max min paek
Browse files Browse the repository at this point in the history
  • Loading branch information
Lan Le committed Oct 19, 2023
1 parent c780e1a commit 81ec376
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions chem_spectra/lib/composer/ni.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ def __gen_cyclic_voltammetry_data_peaks(self):
y_pecker = self.core.ys[idx]

for peak in listMaxMinPeaks:
max_peak, min_peak = peak['max'], peak['min']
max_peak, min_peak = None, None
if 'max' in peak:
max_peak = peak['max']
if 'min' in peak:
min_peak = peak['min']
x_max_peak, y_max_peak = self.__get_xy_of_peak(max_peak)
x_min_peak, y_min_peak = self.__get_xy_of_peak(min_peak)

Expand Down Expand Up @@ -302,7 +306,11 @@ def tf_img(self):
listMaxMinPeaks = self.core.params['list_max_min_peaks']

for peak in listMaxMinPeaks:
max_peak, min_peak = peak['max'], peak['min']
max_peak, min_peak = None, None
if 'max' in peak:
max_peak = peak['max']
if 'min' in peak:
min_peak = peak['min']
x_max_peak, y_max_peak = self.__get_xy_of_peak(max_peak)
x_min_peak, y_min_peak = self.__get_xy_of_peak(min_peak)

Expand Down Expand Up @@ -529,7 +537,11 @@ def tf_csv(self):
y_pecker = self.core.ys[idx]

for peak in listMaxMinPeaks:
max_peak, min_peak = peak['max'], peak['min']
max_peak, min_peak = None, None
if 'max' in peak:
max_peak = peak['max']
if 'min' in peak:
min_peak = peak['min']
x_max_peak, y_max_peak = self.__get_xy_of_peak(max_peak)
x_min_peak, y_min_peak = self.__get_xy_of_peak(min_peak)

Expand Down

0 comments on commit 81ec376

Please sign in to comment.