Example #1
0
    if args.use_recalc:
        import GasFlowHLCalculator.qbs_fill as qf
        try:
            fill_dict.update(qf.get_fill_dict(filln,h5_storage=H5_storage(recalc_h5_folder),use_dP=True))
        except ValueError:
            'Skipped due to ValueError'

    if plot_model:
        try:
            fill_dict.update(tm.timber_variables_from_h5(data_folder_fill+'/heatloads_fill_h5s/imp_and_SR_fill_%i.h5' % filln))
        except IOError:
            print "model datafile not found" 


    bct_b1 = BCT.BCT(fill_dict, beam=1)
    bct_b2 = BCT.BCT(fill_dict, beam=2)
    energy = Energy.energy(fill_dict, beam=1, t_start_fill=t_startfill, t_end_fill=t_endfill)
    ax1.plot(tc(bct_b1.t_stamps), bct_b1.values*1e-14, lw=2, c='b', label = 'Intensity B1' if i_fill==0 else "")
    ax1.plot(tc(bct_b2.t_stamps), bct_b2.values*1e-14, lw=2, c='r', label = 'Intensity B2' if i_fill==0 else "")
    ax11.plot(tc(energy.t_stamps), energy.energy/1e3, c='black', linestyle = '--',lw=2,label='Energy' if i_fill==0 else "") #was alpha=.5

    heatloads = SetOfHomogeneousNumericVariables(variable_list=hl_varlist, timber_variables=fill_dict)


    # remove offset
    if zero_at is not None:
        for device in hl_varlist:
            heatloads.timber_variables[device].values = heatloads.timber_variables[device].values - dict_offsets[device]

    # normalize to the length
Example #2
0
                  t_start_fill,
                  t_end_fill,
                  scaleAlgorithm='AVG',
                  scaleInterval='SECOND',
                  scaleSize='30'))

print('Done')

##################
## Data manip   ##
##################

bsrt_calib_dict = BSRT_calib.emittance_dictionary(filln=filln)

energy = Energy.energy(fill_dict, beam=beam)
bct = BCT.BCT(fill_dict, beam=beam)
bsrt = BSRT.BSRT(fill_dict,
                 beam=beam,
                 calib_dict=bsrt_calib_dict,
                 average_repeated_meas=average_repeated_meas)
bsrt.calculate_emittances(energy)

dict_bunches, t_bbb, emit_h_bbb, emit_v_bbb, bunch_n_un = bsrt.get_bbb_emit_evolution(
)

#resample with uniform time step
resampled_emit_h_bbb = []
resampled_emit_v_bbb = []

t_resampled = np.arange(t_start_fill, t_end_fill, t_step_resample_s)