Exemplo n.º 1
0
# DEFINE BEAM------------------------------------------------------------------
bigaussian(general_params, RF_sct_par, my_beam, sigma_dt, seed=1)

# DEFINE SLICES----------------------------------------------------------------
slice_beam = Profile(
    my_beam,
    CutOptions(cut_left=-5.72984173562e-7,
               cut_right=5.72984173562e-7,
               n_slices=100))

# MONITOR----------------------------------------------------------------------

bunchmonitor = BunchMonitor(general_params,
                            RF_sct_par,
                            my_beam,
                            this_directory +
                            '../output_files/EX_02_output_data',
                            buffer_time=1)

# LOAD IMPEDANCE TABLES--------------------------------------------------------

var = str(kin_beam_energy / 1e9)

# ejection kicker
Ekicker = np.loadtxt(
    this_directory + '../input_files/EX_02_Ekicker_1.4GeV.txt',
    skiprows=1,
    dtype=complex,
    converters={
        0: lambda s: complex(bytes(s).decode('UTF-8').replace('i', 'j')),
        1: lambda s: complex(bytes(s).decode('UTF-8').replace('i', 'j'))
Exemplo n.º 2
0
alpha_order_test = rf_params.alpha_order

bigaussian(general_params,
           rf_params,
           beam,
           tau_0 / 4,
           reinsertion='on',
           seed=1)

# Need slices for the Gaussian fit
slice_beam = Profile(beam, CutOptions(n_slices=100))

# Define what to save in file
bunchmonitor = BunchMonitor(general_params,
                            rf_params,
                            beam,
                            this_directory +
                            '../output_files/EX_07_output_data',
                            Profile=slice_beam)

format_options = {'dirname': this_directory + '../output_files/EX_07_fig'}
plots = Plot(general_params,
             rf_params,
             beam,
             dt_plt,
             N_t,
             0,
             8.e-7,
             -400e6,
             400e6,
             separatrix_plot=True,
             Profile=slice_beam,
Exemplo n.º 3
0
                                   bunch_length=bunch_length,
                                   distribution_type=distribution_type,
                                   distribution_variable=distribution_variable,
                                   seed=1223)

slices_ring.track()

# Accelerator map
map_ = [long_tracker] + [slices_ring]

if worker.isMaster:
    #Monitor
    bunch_monitor = BunchMonitor(general_params,
                                 rf_params,
                                 my_beam,
                                 this_directory +
                                 '../mpi_output_files/EX_09_output_data',
                                 Profile=slices_ring,
                                 PhaseLoop=phase_loop)

    #Plots
    format_options = {
        'dirname': this_directory + '../mpi_output_files/EX_09_fig'
    }
    plots = Plot(general_params,
                 rf_params,
                 my_beam,
                 100,
                 n_turns,
                 0.0,
                 2.0 * 0.9e-6,

# Define beam and distribution

bigaussian(general_params, rf_params_tot, beam, tau_0/4, 
                              reinsertion = 'on', seed=1)

print("Beam set and distribution generated...")


# Need slices for the Gaussian fit; slice for the first plot
slice_beam = Profile(beam, CutOptions(n_slices=100),
                 FitOptions(fit_option='gaussian'))       
# Define what to save in file
bunchmonitor = BunchMonitor(general_params, rf_params_tot, beam,
                            this_directory + '../output_files/EX_04_output_data',
                            Profile=slice_beam, buffer_time=1)

# PLOTS
format_options = {'dirname': this_directory + '../output_files/EX_04_fig', 'linestyle': '.'}
plots = Plot(general_params, rf_params_tot, beam, dt_plt, dt_plt, 0, 
             0.0001763*h, -450e6, 450e6, xunit='rad',
             separatrix_plot=True, Profile=slice_beam,
             h5file=this_directory + '../output_files/EX_04_output_data',
             histograms_plot=True, format_options=format_options)

# For testing purposes
test_string = ''
test_string += '{:<17}\t{:<17}\t{:<17}\t{:<17}\n'.format(
    'mean_dE', 'std_dE', 'mean_dt', 'std_dt')
test_string += '{:+10.10e}\t{:+10.10e}\t{:+10.10e}\t{:+10.10e}\n'.format(
Exemplo n.º 5
0
                             n_slices=number_slices,
                             RFSectionParameters=ring_RF_section_res,
                             cuts_unit='rad')
slice_beam_res = Profile(my_beam_res, cut_options_res,
                         FitOptions(fit_option='gaussian'))

slice_beam.track()
slice_beam_freq.track()
slice_beam_res.track()

# MONITOR----------------------------------------------------------------------

bunchmonitor = BunchMonitor(general_params,
                            ring_RF_section,
                            my_beam,
                            this_directory +
                            '../output_files/EX_05_output_data',
                            Profile=slice_beam,
                            buffer_time=1)

bunchmonitor_freq = BunchMonitor(general_params_freq,
                                 ring_RF_section_freq,
                                 my_beam_freq,
                                 this_directory +
                                 '../output_files/EX_05_output_data_freq',
                                 Profile=slice_beam_freq,
                                 buffer_time=1)
bunchmonitor_res = BunchMonitor(general_params_res,
                                ring_RF_section_res,
                                my_beam_res,
                                this_directory +
Exemplo n.º 6
0
long_tracker = RingAndRFTracker(rf, beam)

bigaussian(ring, rf, beam, tau_0 / 4, reinsertion=True, seed=1)

# Need slices for the Gaussian fit
profile = Profile(beam, CutOptions(n_slices=100),
                  FitOptions(fit_option='gaussian'))

# Accelerator map
map_ = [long_tracker] + [profile]

# Define what to save in file
if worker.isMaster:
    bunchmonitor = BunchMonitor(ring,
                                rf,
                                beam,
                                this_directory +
                                '../mpi_output_files/EX_01_output_data',
                                Profile=profile)
    format_options = {
        'dirname': this_directory + '../mpi_output_files/EX_01_fig'
    }
    plots = Plot(ring,
                 rf,
                 beam,
                 dt_plt,
                 N_t,
                 0,
                 0.0001763 * h,
                 -400e6,
                 400e6,
                 xunit='rad',