Skip to content

Commit 65310c2

Browse files
committed
Update interactive MonitorTest to test new feature of ParticleMonitor
allowing to add on the fly more quantities to store. (see 160c72b).
1 parent 4c4ed8a commit 65310c2

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

testing/interactive-tests/MonitorTest.ipynb

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"metadata": {
33
"name": "",
4-
"signature": "sha256:dfff2f627b552921077821c4363a152f9af9e974b4c53e6434e2d24a4b077c40"
4+
"signature": "sha256:40730948c653f14f34c07a1fed2c8a8d06c79f2381ae5f9084b77273c9fcb345"
55
},
66
"nbformat": 3,
77
"nbformat_minor": 0,
@@ -44,7 +44,7 @@
4444
"output_type": "stream",
4545
"stream": "stdout",
4646
"text": [
47-
"PyHEADTAIL v1.0.0\n",
47+
"PyHEADTAIL v1.0.4\n",
4848
"\n",
4949
"\n"
5050
]
@@ -95,7 +95,6 @@
9595
" for key in particledata[step].keys():\n",
9696
" _[:] = particledata[step][key][:]\n",
9797
" \n",
98-
" \n",
9998
" bunchdata.close()\n",
10099
" slicedata.close()\n",
101100
" particledata.close()\n",
@@ -149,7 +148,7 @@
149148
"language": "python",
150149
"metadata": {},
151150
"outputs": [],
152-
"prompt_number": 3
151+
"prompt_number": 12
153152
},
154153
{
155154
"cell_type": "code",
@@ -176,7 +175,7 @@
176175
"language": "python",
177176
"metadata": {},
178177
"outputs": [],
179-
"prompt_number": 4
178+
"prompt_number": 9
180179
},
181180
{
182181
"cell_type": "heading",
@@ -211,7 +210,7 @@
211210
"language": "python",
212211
"metadata": {},
213212
"outputs": [],
214-
"prompt_number": 5
213+
"prompt_number": 10
215214
},
216215
{
217216
"cell_type": "code",
@@ -240,13 +239,17 @@
240239
" write_buffer_every=20)\n",
241240
"particle_monitor = ParticleMonitor(filename=particle_filename, stride=10, parameters_dict={'Q_x': Q_x})\n",
242241
"\n",
242+
"arrays_dict = {}\n",
243243
"map_ = trans_map\n",
244244
"for i in xrange(n_turns):\n",
245245
" for m_ in map_:\n",
246246
" m_.track(bunch)\n",
247247
" bunch_monitor.dump(bunch)\n",
248248
" slice_monitor.dump(bunch)\n",
249-
" particle_monitor.dump(bunch)\n",
249+
" \n",
250+
" slice_set_pmon = bunch.get_slices(unibin_slicer)\n",
251+
" arrays_dict.update({'slidx': slice_set_pmon.slice_index_of_particle, 'zz': bunch.z})\n",
252+
" particle_monitor.dump(bunch, arrays_dict)\n",
250253
"\n",
251254
"read_all_data(bunch_filename, slice_filename, particle_filename)\n",
252255
"read_n_plot_data(bunch_filename, slice_filename, particle_filename)"
@@ -258,11 +261,11 @@
258261
"output_type": "stream",
259262
"stream": "stdout",
260263
"text": [
261-
"0.0580668146353\n"
264+
"0.0576953432278\n"
262265
]
263266
}
264267
],
265-
"prompt_number": 8
268+
"prompt_number": 13
266269
},
267270
{
268271
"cell_type": "code",

0 commit comments

Comments
 (0)