def __init__(Lambda): theta_I = ThetaI(Lambda) Waist0 = Waist0E(Lambda) source_k = Optics.SourceGaussian(Lambda, Waist0) source_pd = Fundation.PositioningDirectives( ReferTo = 'absolute', XYCentre = [0,0], Angle = 0) source = Fundation.OpticalElement(source_k, Name = 'Fel1 source', IsSource = True, PositioningDirectives = source_pd)
def do_wise_calculation(self): position_directives = self.get_PositionDirectives() position_directives.WhichAngle = Optics.TypeOfAngle.SelfFrameOfReference position_directives.Angle = 0.0 wise_source = WiseGaussianSource(name=self.source_name, source_gaussian=Optics.SourceGaussian(self.source_lambda*1e-9, self.source_waist*self.workspace_units_to_m) , position_directives=position_directives) data_to_plot = numpy.zeros((2, 100)) sigma = self.source_waist/2 mu = 0.0 if self.XYCentre_checked else self.YCentre data_to_plot[0, :] = numpy.linspace((-5*sigma) + mu, mu + (5*sigma), 100) data_to_plot[1, :] = (norm.pdf(data_to_plot[0, :], mu, sigma))**2 return wise_source, data_to_plot
plt.figure(id) plt.plot(S*1e3, abs(E)**2/max(abs(E)**2)) plt.xlabel('mm') plt.title('|E| (' + oe.Name + ')') print(__name__) if __name__ == '__main__': tl.Debug.On = True N = 7000 UseCustomSampling = True # SOURCE #========================================================================== Lambda = 32e-9 Waist0 = Fermi.Waist0E(Lambda) s_k = Optics.SourceGaussian(Lambda, Waist0) # Kernel delle ottiche s_pd = Fundation.PositioningDirectives( # Direttive di posizionamento ReferTo = Fundation.PositioningDirectives.ReferTo.AbsoluteReference, XYCentre = [0.0, 0.0], Angle = 0.0) s = OpticalElement(s_k, PositioningDirectives = s_pd, Name = 'source', IsSource = True) # PM1A (h) #========================================================================== pm1a_k = Optics.MirrorPlane(L=0.4, AngleGrazing = deg2rad(2.5) ) pm1a_pd = Fundation.PositioningDirectives( ReferTo = 'upstream', PlaceWhat = 'centre',
importlib.reload(rm) importlib.reload(Fermi) from wiselib2.must import * from wiselib2.Fundation import OpticalElement print(__name__) if __name__ == '__main__': tl.Debug.On = True # SOURCE #------------------------------------------------------------ Lambda = 5e-9 Waist0 =Fermi.Waist0E(Lambda) s_k = Optics.SourceGaussian(Lambda, Waist0) s_pd = Fundation.PositioningDirectives( ReferTo = 'absolute', XYCentre = [0,0], Angle = np.deg2rad(0)) s = OpticalElement( s_k, PositioningDirectives = s_pd, Name = 'source', IsSource = True) # KB(h) #------------------------------------------------------------ f1 = Fermi.Dpi.Kbv.f1 f2 = Fermi.Dpi.Kbv.f2 GrazingAngle = Fermi.Dpi.Kbv.GrazingAngle
def get_inner_wise_optical_element(self): return Optics.MirrorElliptic(f1=self.f1 * self.workspace_units_to_m, f2=self.f2 * self.workspace_units_to_m, L=self.length * self.workspace_units_to_m, Alpha=numpy.deg2rad(self.alpha))
def get_inner_wise_optical_element(self): return Optics.Detector(L=self.length * self.workspace_units_to_m, AngleGrazing=numpy.deg2rad(self.alpha))
from wiselib2.Fundation import OpticalElement # SOURCE #---------------------------------------------------- tl.Debug.On = False Lambda = 5e-9 # Gaussian Source (if used) FermiFactor = {'fel1': 1.25, 'fel2': 1.5}['fel2'] FermiSigma = FermiFactor * Lambda * 1e9 FermiWaist = FermiSigma * np.sqrt(2) FermiDivergence = Lambda / np.pi / FermiWaist s = OpticalElement( Optics.SourceGaussian(Lambda, FermiWaist, PropagationAngle=0 * 0.0008257924757473173), PositioningDirectives=Fundation.PositioningDirectives(ReferTo='absolute', XYCentre=[0, 1], Angle=np.deg2rad(0)), Name='source', IsSource=True) #---------------------------------------------------- # kb1 #---------------------------------------------------- kb1 = OpticalElement(Optics.MirrorElliptic(f1=98.5, f2=1.180, L=0.4, Alpha=np.deg2rad(2)), PositioningDirectives=Fundation.PositioningDirectives(