Ejemplo n.º 1
0
    if detuning_fit_order > 0:
        obdet = mfm.myloadmat_to_obj(z_strength_file)
        z_slices = obdet.z_slices
        p = np.polyfit(obdet.z_slices,
                       obdet.k_z_integrated,
                       deg=detuning_fit_order)
        alpha_N = p[::-1] * ecloud_strength_scale  # Here I fit the strength
        print('Detuning cefficients alpha_N:')
        print(alpha_N)
    else:
        alpha_N = alpha_N_custom

    alpha_N = alpha_N[:N_poly_cut] * alpha_scale

# Instantiate simulation
sim_content = sim_mod.Simulation(param_file=sim_param_file)

# Here sim_content.pp can be edited (directly and through files)
for ff in sim_param_amend_files:
    sim_content.pp.update(param_file=ff)

# Make the slice output file smaller
sim_content.pp.slice_stats_to_store = [
    'mean_x', 'mean_z', 'n_macroparticles_per_slice'
]

sim_content.pp.Qp_x = Qp_x

if add_alpha_0_to_tune:
    assert (only_phase_shift)
    sim_content.pp.Q_x += -(factor_alpha_0_to_tune * alpha_N[0] *
Ejemplo n.º 2
0
import sys
sys.path.append('../../../')

import PyPARIS_sim_class.Simulation as sim_mod
import PyPARIS.util as pu

sim_content = sim_mod.Simulation(
    param_file='param_folder/Simulation_parameters.py')

ring = pu.get_serial_CPUring(sim_content, init_sim_objects_auto=True)
ring.run()