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

Modified zoneplate #138

Open mano2931 opened 1 year ago

mano2931 commented 1 year ago

I would like to use the zoneplate as a focusing element in my simulation but i would like to input the radii of the nth zone. How would i be able to introduce a custom optical element in XRT? Is that possible? Can you help me with it

kklmn commented 1 year ago

Inherit from xrt.backends.raycing.oes.NormalFZP or xrt.backends.raycing.oes.GeneralFZPin0YZ and modify the method rays_good_gn() that for local 3D coordinates returns grating vector and ray state. The latter class is more general, where one can modify the shape of the zones and set a phase shift to the zones. In the former class, the zones are always circular.

mano2931 commented 1 year ago

Sorry. I didn't quite understand what you mean by inherit. Should i modify the backend files or is there a way to clone it.

Pardon me, iam not an advanced user.

Also, i would like to couple the zoneplate with refractive lenses to simulate an achromatic hybrid lens as in https://www.nature.com/articles/s41467-022-28902-8. I was also looking for modules of spherical lenses but i didnt find any. Could you please clarify that also

mano2931 commented 1 year ago

The idea behind modifiying the periodicity of the zoneplate comes from the notion that the spherical abberation introduced by the spheres can be compensated by the zoneplate. Its my first time with XRT and so i need a little assistance to get going :)

kklmn commented 1 year ago

Google will help you with "Python Inheritance".

I was also looking for modules of spherical lenses but i didnt find any

Inherit from Plate or ParaboloidFlatLens. Create your desired shape by providing height and normal for both sides of the lens: local_z1, local_n1, local_z2, local_n2.