Skip to content

Commit 03ebf44

Browse files
author
dquartul
committed
BLonD v1.10.3. See README.md for details.
1 parent e1b70ea commit 03ebf44

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ STRUCTURE
6464

6565
VERSION CONTENTS
6666
================
67+
2015-1-15
68+
v1.10.3 - Fixed two bugs in potential_well-cut and beam_profile_derivative routines
69+
6770
2015-1-15
6871
v1.10.2 - Added the n_sampling option to the synchrotron_frequency_tracker.frequency_calculation method
6972

beams/slices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def beam_profile_derivative(self, mode = 'gradient', coord = 'theta'):
257257
elif mode is 'gradient':
258258
derivative = np.gradient(self.n_macroparticles, dist_centers)
259259
elif mode is 'diff':
260-
derivative = np.diff(self.n_macroparticles)
260+
derivative = np.diff(self.n_macroparticles) / dist_centers
261261
diffCenters = x[0:-1] + dist_centers/2
262262
derivative = np.interp(x, diffCenters, derivative)
263263
else:

trackers/utilities.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,13 @@ def potential_well_cut(theta_coord_array, potential_array):
549549
higher_maximum_value = np.max(max_potential_values)
550550
lower_maximum_theta = max_theta_positions[max_potential_values == lower_maximum_value]
551551
higher_maximum_theta = max_theta_positions[max_potential_values == higher_maximum_value]
552-
if min_theta_positions[0] > lower_maximum_theta:
552+
if len(lower_maximum_theta)==2:
553+
saved_indexes = (potential_array < lower_maximum_value) * \
554+
(theta_coord_array > lower_maximum_theta[0]) * \
555+
(theta_coord_array < lower_maximum_theta[1])
556+
theta_coord_sep = theta_coord_array[saved_indexes]
557+
potential_well_sep = potential_array[saved_indexes]
558+
elif min_theta_positions[0] > lower_maximum_theta:
553559
saved_indexes = (potential_array < lower_maximum_value) * \
554560
(theta_coord_array > lower_maximum_theta) * \
555561
(theta_coord_array < higher_maximum_theta)

0 commit comments

Comments
 (0)