You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import numpy as np
from srxraylib.plot.gol import plot
import scipy.constants as codata
# this part is to read the incoming signals
energy = np.copy(in_object_1.get_contents("xoppy_data")[:,0])
pow_w_ev = np.copy(in_object_1.get_contents("xoppy_data")[:,-1])
#this transforms the power spectra in photons/s/eV
flux_in_bandwidth = (pow_w_ev/codata.e)/1000
flux_ps_ev = flux_in_bandwidth / (energy / 1000)
#plotting part
plot(energy, flux_ps_ev, xlog=False, ylog=True, xtitle="Photon energy [eV]",ytitle="Flux", legend=["Flux(Ph/s/eV)"])
#calculation of the total number of photons/s
total_ph = np.trapz(flux_ps_ev, x=energy, axis = -1)
print(f'Total photons per second {total_ph:.5E} at 5000 eV')
The text was updated successfully, but these errors were encountered:
See script in hercules tutorial
The text was updated successfully, but these errors were encountered: