print("Calculating energy %g eV (%d of %d)"%(e,ie+1,photon_energy.size))
simulation_test = create_simulation(magnetic_structure=myundulator,electron_beam=myelectronbeam,
magnetic_field=None, photon_energy=e,
traj_method=TRAJECTORY_METHOD_ANALYTIC,Nb_pts_trajectory=None,
rad_method=RADIATION_METHOD_APPROX_FARFIELD,initial_condition=None,
distance=D,
X=X.flatten(),Y=Y.flatten(),XY_are_list=True)
# TODO: this is not nice: I redo the calculations because I need the electric vectors to get polarization
# this should be avoided after refactoring pySRU to include electric field in simulations!!
electric_field = simulation_test.radiation_fact.calculate_electrical_field(
simulation_test.trajectory, simulation_test.source, X.flatten(), Y.flatten(), D)
See problem in the use of pySRU for shadow3:
`` See problem in the use of pySRU for shadow3:
''