Skip to content
Snippets Groups Projects
Commit b614c32f authored by Gamelin Alexis's avatar Gamelin Alexis
Browse files

Fix profile monitor

Fix profile monitor
Add detune to cavity monitor
parent f27db5cd
No related branches found
No related tags found
No related merge requests found
......@@ -615,10 +615,10 @@ class ProfileMonitor(Monitor):
dict_buffer = {}
dict_file = {}
for index, dim in enumerate(self.dimensions):
dict_buffer.update({dim : (self.n_bin[index], buffer_size)})
dict_buffer.update({dim + "_bin" : (self.n_bin[index] + 1, buffer_size)})
dict_file.update({dim : (self.n_bin[index], total_size)})
dict_file.update({dim + "_bin" : (self.n_bin[index] + 1, total_size)})
dict_buffer.update({dim : (self.n_bin[index] - 1, buffer_size)})
dict_buffer.update({dim + "_bin" : (self.n_bin[index] - 1, buffer_size)})
dict_file.update({dim : (self.n_bin[index] - 1, total_size)})
dict_file.update({dim + "_bin" : (self.n_bin[index] - 1, total_size)})
self.monitor_init(group_name, save_every, buffer_size, total_size,
dict_buffer, dict_file, file_name, mpi_mode)
......@@ -637,11 +637,9 @@ class ProfileMonitor(Monitor):
self.time[self.buffer_count] = self.track_count
for index, dim in enumerate(self.dimensions):
bins, sorted_index, profile = bunch.binning(dim, self.n_bin[index])
bin_array = np.append(np.array(bins.left), bins.right[-1])
profile_array = np.array(profile)
self.__getattribute__(dim + "_bin")[:, self.buffer_count] = bin_array
self.__getattribute__(dim)[:, self.buffer_count] = profile_array
bins, sorted_index, profile, center = bunch.binning(dim, self.n_bin[index])
self.__getattribute__(dim + "_bin")[:, self.buffer_count] = center
self.__getattribute__(dim)[:, self.buffer_count] = profile
self.buffer_count += 1
......@@ -1044,11 +1042,14 @@ class CavityMonitor(Monitor):
group_name = cavity_name
dict_buffer = {"cavity_phasor_record":(ring.h, buffer_size,),
"beam_phasor_record":(ring.h, buffer_size,)}
"beam_phasor_record":(ring.h, buffer_size,),
"detune":(buffer_size,)}
dict_file = {"cavity_phasor_record":(ring.h, total_size,),
"beam_phasor_record":(ring.h, total_size,)}
"beam_phasor_record":(ring.h, total_size,),
"detune":(total_size,)}
dict_dtype = {"cavity_phasor_record":complex,
"beam_phasor_record":complex}
"beam_phasor_record":complex,
"detune":float}
self.monitor_init(group_name, save_every, buffer_size, total_size,
dict_buffer, dict_file, file_name, mpi_mode,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment