'fill_bunchbybunch_data_csvs/bunchbybunch_data_fill_%d.csv' % filln, verbose=False)) bint_thresh = 8e9 totint_thresh = 2e11 t_inter = 60. #seconds i_fig = 0 plt.close('all') # Loop over beams beam_col = ['b', 'r'] for beam in [1, 2]: print '\nPreparing plot beam %d...' % beam fbct = FBCT.FBCT(fill_dict, beam=beam) fbct_t_all, fbct_v_all = fbct.uniform_time() nslots = fbct_v_all.shape[1] # Remove time without beam mask_beam_presence = np.float_(fbct.totint > totint_thresh) # Identify fills within file i_start_fills = np.where(np.diff(mask_beam_presence) == 1)[0] i_stop_fills = np.where(np.diff(mask_beam_presence) == -1)[0] + 1 n_fills = len(i_start_fills) # Loop over fills for fill_curr in xrange(n_fills): i_fig += 1 i_start_fill = i_start_fills[fill_curr]
import LHCMeasurementTools.LHC_BQM as BQM import LHCMeasurementTools.LHC_BSRT as BSRT import LHCMeasurementTools.LHC_Fills as Fills from LHCMeasurementTools.LHC_Fill_LDB_Query import save_variables_and_pickle import pickle import os csv_folder = 'fill_bunchbybunch_data_csvs' filepath = csv_folder + '/bunchbybunch_data_fill' if not os.path.isdir(csv_folder): os.mkdir(csv_folder) fills_pkl_name = 'fills_and_bmodes.pkl' with open(fills_pkl_name, 'rb') as fid: dict_fill_bmodes = pickle.load(fid) saved_pkl = csv_folder + '/saved_fills.pkl' varlist = [] varlist += FBCT.variable_list() varlist += BQM.variable_list() varlist += BSRT.variable_list() save_variables_and_pickle(varlist=varlist, file_path_prefix=filepath, save_pkl=saved_pkl, fills_dict=dict_fill_bmodes)
import LHCMeasurementTools.LHC_BQM as BQM import LHCMeasurementTools.LHC_BSRT as BSRT import LHCMeasurementTools.LHC_Fills as Fills from LHCMeasurementTools.LHC_Fill_LDB_Query import save_variables_and_pickle import pickle import os csv_folder = 'fill_bunchbybunch_data_csvs' filepath = csv_folder+'/bunchbybunch_data_fill' if not os.path.isdir(csv_folder): os.mkdir(csv_folder) fills_pkl_name = 'fills_and_bmodes.pkl' with open(fills_pkl_name, 'rb') as fid: dict_fill_bmodes = pickle.load(fid) saved_pkl = csv_folder+'/saved_fills.pkl' varlist = [] varlist += FBCT.variable_list() varlist += BQM.variable_list() varlist += BSRT.variable_list() save_variables_and_pickle(varlist=varlist, file_path_prefix=filepath, save_pkl=saved_pkl, fills_dict=dict_fill_bmodes)