Skip to content

Commit

Permalink
peak positions bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cfuselli committed Dec 6, 2023
1 parent 65f23fa commit fab4a77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions amstrax/plugins/peaks/peak_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ def compute(self, peaks):
center_position = (r['center_time'] - p['time']) / (p['dt'] * p['length'])

is_s1 = p['area'] >= self.config['s1_min_area']
is_s1 &= range_50p_area > self.config['s1_min_width']
is_s1 &= range_50p_area < self.config['s1_max_width']
is_s1 &= r['range_50p_area'] > self.config['s1_min_width']
is_s1 &= r['range_50p_area'] < self.config['s1_max_width']
is_s1 &= center_position > self.config['s1_min_center_position']
is_s1 &= center_position < self.config['s1_max_center_position']
is_s1 &= r['area_fraction_top'] <= self.config['s1_max_area_fraction_top']
is_s1 &= r['n_channels'] >= self.config['s1_min_channels']

is_s2 = p['area'] > self.config['s2_min_area']
is_s2 &= range_50p_area > self.config['s2_min_width']
is_s2 &= r['range_50p_area'] > self.config['s2_min_width']
is_s2 &= r['area_fraction_top'] >= self.config['s2_min_area_fraction_top']
is_s2 &= r['n_channels'] >= self.config['s2_min_channels']

Expand Down
2 changes: 1 addition & 1 deletion amstrax/plugins/peaks/peak_positions.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ def compute(self, peaks):

result['x_cgr'] = f_12
result['y_cgr'] = f_13
result['r_cgr'] = np.sqrt(result['x']**2+result['y']**2)
result['r_cgr'] = np.sqrt(result['x_cgr']**2+result['y_cgr']**2)

return result

0 comments on commit fab4a77

Please sign in to comment.