Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Detector size, in OASYS #55

Open
capitanevs opened this issue Jul 19, 2021 · 1 comment
Open

Bug: Detector size, in OASYS #55

capitanevs opened this issue Jul 19, 2021 · 1 comment
Labels
solution found STAND BY featured topic right now.

Comments

@capitanevs
Copy link
Collaborator

These two diagrams give a different detector size in the end. The detector size is probed by the last two widgets (A and B).
The captions contain the result: A has mistmatching dimensions, B has matching dimension.

immagine

I used for the first time the "Code generator" of WISER. It is working quite well (I just had to correct the positioning directives and the names, as it supports just python compatible name, with no spaces etc.)

This is the code


# -*- coding: utf-8 -*-
"""
Created on Mon Jul 19 17:13:08 2021

@author: Mike
"""

from LibWiser.EasyGo import *

#%%
s =LibWiser.Foundation.OpticalElement(	Name = 'Gaussian Source',
	IsSource = True,
	CoreOpticsElement =LibWiser.Optics.SourceGaussian(		Lambda = 1.000000e-08,
		Waist0 = 1.800000e-04,
		M2 = 1.000000e+00,
		AnglePropagation = 0.000000e+00,
		Orientation = OPTICS_ORIENTATION.ANY,
	),
	PositioningDirectives =LibWiser.Foundation.PositioningDirectives(		ReferTo = 'absolute',
		PlaceWhat = 'centre',
		PlaceWhere = 'centre',
		GrazingAngle = 0,
		Distance = None,
	),
)
Detector =LibWiser.Foundation.OpticalElement(	Name = 'Detector',
	IsSource = False,
	CoreOpticsElement =LibWiser.Optics.Detector(		L = 5.000000e-03,
		AngleGrazing = 1.5707963267948966,
		Orientation = OPTICS_ORIENTATION.ANY,
	),
	PositioningDirectives =LibWiser.Foundation.PositioningDirectives(		ReferTo = 'source',
		PlaceWhat = 'centre',
		PlaceWhere = 'centre',
		GrazingAngle = np.pi/2,
		Distance = 10,
	),
)
	
#%%
WiserBeamline = BeamlineElements([s, Detector])
WiserBeamline.RefreshPositions()

for _ in WiserBeamline.ItemList:
	_.ComputationSettings.UseCustomSampling = True
	_.ComputationSettings.NSamples = 5000




#%%
WiserBeamline.ComputeFields()

Detector.PlotIntensity() # makes a plot

the plot of the last line has a correct transverse size (5mm)

immagine

PROBLEM: we are hiding something, probably in OASYS, but I have no idea of the position.

@capitanevs
Copy link
Collaborator Author

FOUND

  • The problem is in LibWiser:
  • When distance is 0 (or <0.157?), strange behavior arise. I guess this is because of the numerical approximation of the transformation system.

ACTION
not a priority now. I'll get it sooner or later

@capitanevs capitanevs added STAND BY featured topic right now. and removed help wanted Extra attention is needed invalid This doesn't seem right labels Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution found STAND BY featured topic right now.
Projects
None yet
Development

No branches or pull requests

1 participant