rotation=67.5, color='grey', alpha=0.8) first_fill = False ax1.set_xlim(tc(t_start_unix), tc(t_end_unix)) ax11.set_ylim(0, 7) ax1.set_ylim(0, None) ax1.grid('on') ax1.set_ylabel('Total intensity\n[10$^{14}$ p$^+$]',fontsize = 24) ax11.set_ylabel('Energy [TeV]',fontsize = 24) time_conv.set_x_for_plot(fig, ax1) lg = ms.comb_legend(ax1,ax11, bbox_to_anchor=(1.06, 1.05), loc='upper left', prop={'size':fontsz_leg}) if normalization_to_length_of is None: ax2.set_ylabel('Heat load\n[W/half-cell]',fontsize = 24) else: ax2.set_ylabel('Heat load\n[W/m]',fontsize = 24) ax2.legend(bbox_to_anchor=(1.06, 1.05), loc='upper left', prop={'size':fontsz_leg})#, frameon=False) #ax2.set_ylim(0, None) ax2.grid('on') if mode == 'integrated': hl_for_integrated = np.array(hl_for_integrated) hl_for_integrated[hl_for_integrated<0.] = 0. t_for_integrated = np.array(t_for_integrated) hl_for_integrated[t_for_integrated < t_start_unix] = 0. integrated_hl = cumtrapz(hl_for_integrated, t_for_integrated)
sptotint.set_ylim(0, None) if flag_bunch_length and not normtointen: spavbl.plot((blength_bx[beam_n].t_stamps-t_ref)/3600., blength_bx[beam_n].avblen/1e-9, '.-', color=colstr[beam_n]) spavbl.set_ylabel('Bunch length\n[ns]',fontsize = 24) spavbl.set_ylim(0.8,1.8) spavbl.grid('on') #spavbl.set_xlabel('Time [h]',fontsize = 24) # Count number of bunches if args.vs_bunch_inten: bint = fbct_bx[beam_n].bint min_int = 0.1 * np.max(bint) mask_filled = bint > min_int n_bunches_bx[beam_n] = np.max(np.sum(mask_filled, axis=1)) ms.comb_legend(sptotint, spenergy, bbox_to_anchor=(1.07, 1.05), loc='upper left', prop={'size':myfontsz}) if use_recalculated: string = 'Recalculated data - %s'%({True: 'with_dP', False: 'no_dP'}[args.with_press_drop]) else: string = 'Logged data' if args.devide_heatload_by!=1.: string+=', devided by %.1f'%args.devide_heatload_by fig_h.suptitle(' Fill. %d started on %s\n%s (%s)'%(filln, tref_string, group_name, string)) fig_h.canvas.set_window_title(group_name) hl_var_names = dict_hl_groups[group_name][:] hl_var_names_copy = dict_hl_groups[group_name][:] for varname in hl_var_names_copy:
qbs_ob.data[:, cell_index_dict[cell]], label='Cell recalc.', ls='-', lw=2., c='orange') cell_index = heatloads.variables.index(cell_vars['Cell']) if logged: sp.plot(timestamps, heatloads.data[:, cell_index], label='Cell logged', ls='--', lw=2., c='orange') sp.set_ylim(-20, None) if sp_ctr == 2: ms.comb_legend(sp, sp2, bbox_to_anchor=(1.8, 1), fontsize=myfontsz) sp.set_xlim(force_xlim) # Also show LHC hist def round_to(arr, precision): return np.round(arr / precision) * precision bins = np.arange( round_to(arc_hist_total.min(), binwidth) - binwidth, round_to(arc_hist_total.max(), binwidth) + binwidth * 3 / 2, binwidth) if separate_fig_for_hist: fig = ms.figure('Special cells in histogram of heatloads', figs) sp = plt.subplot(2, 2, 1)
first_fill = False ax1.set_xlim(tc(t_start_unix), tc(t_end_unix)) ax11.set_ylim(0, 7) ax1.set_ylim(0, None) ax1.grid('on') ax1.set_ylabel('Total intensity\n[10$^{14}$ p$^+$]', fontsize=24) ax11.set_ylabel('Energy [TeV]', fontsize=24) time_conv.set_x_for_plot(fig, ax1) #ax1.text( 1.,1., 'matplotlib',fontsize = 24) #lg = ms.comb_legend(ax1,ax11, bbox_to_anchor=(1., 1.), prop={'size':fontsz_leg-4}, frameon=False) lg = ms.comb_legend(ax1, ax11, loc='upper left', prop={'size': fontsz_leg}, frameon=False) if normalization_to_length_of is None: ax2.set_ylabel('Heat load\n[W/half-cell]', fontsize=24) else: ax2.set_ylabel('Heat load\n[W/m]', fontsize=24) #ax2.legend(ncol = 3, columnspacing = 1, loc='upper right', prop={'size':fontsz_leg-4}, frameon=False) ax2.legend(ncol=3, columnspacing=1, loc='upper left', prop={'size': fontsz_leg}, frameon=False) #ax2.set_ylim(0, None) ax2.grid('on')