#NEWLINE# def sim_GaussPeaks( xx , yy , width , eV0 ) : #NEWLINE# #INDENT# xline = [ ] #NEWLINE# yline = [ ] #NEWLINE# dX = 10.0 #NEWLINE# minX = fluo_emit_min #NEWLINE# amp = 100 #NEWLINE# NumOfSteps = int ( ( ( eV0 - minX ) / dX ) ) #NEWLINE# NumOfPeaks = len ( xx ) #NEWLINE# for ix in range ( ( NumOfSteps + 1 ) ) : #NEWLINE# #INDENT# xline . append ( 0 ) #NEWLINE# yline . append ( 0 ) #NEWLINE# #UNINDENT# for ( iy , peak ) in enumerate ( xx ) : #NEWLINE# #INDENT# X0 = float ( peak ) #NEWLINE# Y0 = float ( yy [ iy ] ) #NEWLINE# for ix in range ( ( NumOfSteps + 1 ) ) : #NEWLINE# #INDENT# energy = ( minX + ( ix * dX ) ) #NEWLINE# inten = ( ( Y0 * math . exp ( ( - ( ( ( energy - X0 ) / width ) ** 2 ) ) ) ) * amp ) #NEWLINE# xline [ ix ] = energy #NEWLINE# yline [ ix ] += inten #NEWLINE# #UNINDENT# #UNINDENT# outputfile = 'simSpectrum_plot.txt' #NEWLINE# fo = open ( outputfile , 'w' ) #NEWLINE# LoLimit = 0.001 #NEWLINE# factor = 1.0 #NEWLINE# for ix in range ( ( NumOfSteps + 1 ) ) : #NEWLINE# #INDENT# if ( yline [ ix ] < LoLimit ) : #NEWLINE# #INDENT# yline [ ix ] = LoLimit #NEWLINE# #UNINDENT# #UNINDENT# for ix in range ( ( NumOfSteps + 1 ) ) : #NEWLINE# #INDENT# yline [ ix ] = ( yline [ ix ] / factor ) #NEWLINE# out1 = ( ( ( str ( xline [ ix ] ) + '\t' ) + str ( yline [ ix ] ) ) + '\n' ) #NEWLINE# fo . write ( out1 ) #NEWLINE# #UNINDENT# fo . close ( )