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
importosimportsysimportglobimportpylabaspltsys.path.insert(0,os.path.join('..','WPG'))
fromwpgimportWavefront#get list of all files by mask (without recursive directory discovering)wavefront_files=glob.glob('simulation_test/FELsource/*.h5')
printwavefront_filesforwavefront_fileinwavefront_files:
printwavefront_filew=Wavefront()
w.load_hdf5(wavefront_file)
#load data/arrEhordata_hor=w.data.arrEhorprintdata_hor.shapeintensity=w.get_intensity().flat#filter intensity to remove near zero valuesintensity=intensity[intensity>1e10]
plt.hist(intensity, bins=100)
On Fri, Nov 7, 2014 at 9:36 AM, Alexey Buzmakov [email protected]
wrote:
import osimport sysimport globimport pylab as plt
sys.path.insert(0,os.path.join('..','WPG'))
from wpg import Wavefront
#get list of all files by mask (without recursive directory discovering)
wavefront_files = glob.glob('simulation_test/FELsource/*.h5') print wavefront_files
for wavefront_file in wavefront_files:
print wavefront_file
w = Wavefront()
w.load_hdf5(wavefront_file)
#load data/arrEhor
data_hor = w.data.arrEhor
print data_hor.shape
intensity = w.get_intensity().flat
#filter intensity to remove near zero values
intensity = intensity[intensity>1e10]
plt.hist(intensity, bins=100)
Reply to this email directly or view it on GitHub #14 (comment).
the script read every FELsource_out.h5 file in a folder and fill a vector with values of calculated total pulse energy
output: a text file with header and values (in J) and a histogram for pulses energy distribution
Questions:
The text was updated successfully, but these errors were encountered: