Skip to content

Commit 3cf4722

Browse files
v0.0.1.4
bpm: add condition to display the last point. fixed a possible error for airy_zero not being int. display max mode when at least one beam uses all_mode. add ylim condition to scale up if last intensity is higher than first one.
1 parent 02c7ef7 commit 3cf4722

22 files changed

+62
-39
lines changed

beampy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# module
3030
from beampy import examples
3131

32-
__version__ = "0.0.1.3.post1"
32+
__version__ = "0.0.1.4"
3333

3434

3535
def help():

beampy/bpm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,6 @@ def all_modes(self, lo, offset_light=0):
571571
except ValueError:
572572
break
573573

574-
print("This guide can propagate up to the modes", i-1)
575574
return [field, h, gamma, beta]
576575

577576
def check_modes(self, lo):
@@ -1184,7 +1183,8 @@ def main_compute(self, chi3=1e-19, kerr=False, kerr_loop=1,
11841183

11851184
# Display condition: if i+1 is a multiple of pas: i+1 % pas = 0
11861185
# = False, so must use if not to have True
1187-
if not (self.i + 1) % self.pas:
1186+
# last condition to have last point if not a multiple of pas
1187+
if not (self.i + 1) % self.pas or self.i+1 == self.nbr_z-1:
11881188
index += 1
11891189
self.progress_pow[index, :] = np.array([self.current_power])
11901190

beampy/user_interface.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(self):
5656
self.mode = np.array([], dtype=int)
5757
self.offset_light_peak = np.array([], dtype=int)
5858
self.airy_check = []
59-
self.airy_zero = []
59+
self.airy_zero = np.array([], dtype=int)
6060
self.lobe_size = []
6161
self.previous_beam = 0
6262

@@ -304,7 +304,6 @@ def calculate_guide(self, topology='array'):
304304
self.checkBox_check_power.setEnabled(True)
305305

306306
# Define new min/max for light and looses, based on selected guides
307-
self.doubleSpinBox_offset_light.setSingleStep(1.0)
308307
self.doubleSpinBox_width_lost.setMaximum(self.length_x-self.dist_x)
309308
self.doubleSpinBox_lobe_size.setMaximum(self.length_x-self.dist_x)
310309
# If want to use min/max for offset: multiple beams will have issue if
@@ -338,6 +337,9 @@ def calculate_light(self):
338337
nbr_light = self.comboBox_light.count() # Number of beams
339338
field = np.zeros((nbr_light, self.nbr_x))
340339

340+
if sum(self.all_modes_check) > 0: # Display only once the max mode
341+
self.check_modes_display()
342+
341343
for i in range(nbr_light):
342344

343345
# Check if offset relative to guide number or else in µm
@@ -377,7 +379,7 @@ def calculate_light(self):
377379
self.mode[i], self.lo, offset_light=offset_light)[0]
378380

379381
except ValueError as ex: # Say that no mode exist
380-
print(ex)
382+
print(ex, "for the beam", i)
381383
continue # Go to the next field
382384

383385
elif self.airy_check[i]:
@@ -545,8 +547,12 @@ def addmpl(self, tab='guide', pow_index=0):
545547

546548
ax2.set_xlim(x_min, x_max)
547549

548-
ax2.set_ylim(0,
549-
max(self.dn[0, :])*1.1 + 1E-20)
550+
if max(self.dn[0, :]) > max(self.dn[-1, :]):
551+
ax2.set_ylim(0,
552+
max(self.dn[0, :])*1.1 + 1E-20)
553+
else:
554+
ax2.set_ylim(0,
555+
max(self.dn[-1, :])*1.1 + 1E-20)
550556

551557
ax2.plot(self.x, self.dn[pow_index_guide], 'k')
552558

docs/html/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 0d720dd1f008c44a89fa7d947d94833c
3+
config: 956ffc6ad44730b3bf032dd75d98bcab
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

docs/html/.doctrees/beampy.doctree

0 Bytes
Binary file not shown.

docs/html/.doctrees/codes.doctree

1.4 KB
Binary file not shown.
0 Bytes
Binary file not shown.

docs/html/.doctrees/index.doctree

0 Bytes
Binary file not shown.

docs/html/LICENSE.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<meta name="viewport" content="width=device-width, initial-scale=1.0">
1010

11-
<title>MIT License &mdash; beampy 0.0.1.3 documentation</title>
11+
<title>MIT License &mdash; beampy 0.0.1.4 documentation</title>
1212

1313

1414

docs/html/_static/documentation_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var DOCUMENTATION_OPTIONS = {
22
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
3-
VERSION: '0.0.1.3',
3+
VERSION: '0.0.1.4',
44
LANGUAGE: 'None',
55
COLLAPSE_INDEX: false,
66
FILE_SUFFIX: '.html',

0 commit comments

Comments
 (0)