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
79 stars 29 forks source link

How to add and use compound refractive index materials? #185

Open HGL2023 opened 1 week ago

HGL2023 commented 1 week ago

Hello! I added photoresist polymer named SU8, which has chemical formula C65.715 O13.934 F18.82 S0.957 H0.574 and refractive index is complex refractive index ((1-δ)-i*β; δ is refractive index; β is absorptive index), and I add the material information in the materials_compounds.py file (fig. 1), but the use of the method seems to be wrong all the time (fig. 2). I hope you can point out my mistake, thank you very much! Your advice is very important to me, thanks again! fig 1 fig 2

kklmn commented 1 week ago

Hi,

I guess you haven't read the docs of Material class, have you? Otherwise, you wouldn't assign a string representation of a complex value to refractiveIndex.

Are you sure you want to override the default material's refractive index? What is your target energy?

Inserting your code directly into an external library is very uncommon. How would you upgrade the library to new versions? Your insertions would get lost.

HGL2023 commented 1 week ago

Thanks for your tips!

You are talking about this part of the diagram, right? Honestly, I saw this but I really don't know how to correctly represent this 3-column numpy array. My energy is set to 15 keV with δ in the real part and β in the imaginary part. Thanks for your guidance! I really don't get it. Thanks! fig

I'll keep track of the modification method so that if there's a new version, I can download it and make the changes again. I really want to implement the kinoform OVAL lens simulation using XRT!

kklmn commented 1 week ago

15 keV is in the range of all three tabulations of scattering factors, so you don't need to define refractiveIndex. If you want to check the calculated refractive index, use the method get_refractive_index() of the created Material object.

HGL2023 commented 1 week ago

I referenced ([Henke] http://henke.lbl.gov/optical_constants/asf.html B.L. Henke, E.M. Gullikson, and J.C. Davis, X-ray interactions. Photoabsorption, scattering, transmission, and reflection at E=50-30000 eV, Z=1-92, Atomic Data and Nuclear Data Tables 54 (no.2) (1993) 181-342).

This software calculates for SU8 at an energy of 15 keV: delta (δ) = 2.124207e-6 beta (β) = 2.379735e-9 The refractive index is given by: n=(1−δ)−iβ.

According to the tutorial, it should be represented as a 3-column array. However, I'm unsure how to correctly represent this 3-column array in the script. f3196fa8e72e548a07c3f109425db74

I'm really sorry to keep bothering you with these basic questions.