kklmn / xrt

Package xrt (XRayTracer) is a python software library for ray tracing and wave propagation in x-ray regime. It is primarily meant for modeling synchrotron sources, beamlines and beamline elements.
MIT License
83 stars 30 forks source link

adding surface error on Ellipsoidal mirror #194

Open leahwang1962 opened 1 month ago

leahwang1962 commented 1 month ago

Hi, need more help to add surface error on the Ellipsoidal mirror following last week's topic. Basically copy your warp.py of Gaussian bump(ray),local_z_distorted(self, x, y), local_n_distorted(self, x, y). But the surface 3D goes back to partially display and the ray tracing results seems to me show sections of ellipsoidal are not involved in the reflection. 3DWithoutSurfaceError 3DWithGaussianbump AtOpticExit_noError AtOpticExit_addGaussianBump Gaussianbump Thanks.

kklmn commented 1 month ago

docs

leahwang1962 commented 1 month ago

Thanks for the docs. After some tests, I found in def gaussian_bump(self) after changing #x = np.linspace(-opticcenterR, opticcenterR, nX) to x = np.linspace(-1000, 1000, nX) , the closed circle of ellipsoidal shows correctly now, and the simulation results are reasonable. It makes sense because in def gaussian_bump(self), x = np.linspace(-opticcenterR, opticcenterR, nX) changes the optics' x limits. Now the problem is how to build the gaussian_bump surface error on this closed circle. Do you think the XY mesh grid method is still valid?