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

laterally graded thicknesses #155

Open
leverglow opened this issue Sep 12, 2023 · 16 comments
Open

laterally graded thicknesses #155

leverglow opened this issue Sep 12, 2023 · 16 comments

Comments

@leverglow
Copy link

Hi,
Depth graded multilayer can be set by xrtQook easily,but xrtQook says that'If you need laterally graded thicknesses, modify get_t_thickness and/or get_b_thickness in a subclass.'
My question is how to set the laterally graded multilayer.I don't know how to'modify get_t_thickness and/or get_b_thickness in a subclass'

@kklmn
Copy link
Owner

kklmn commented Sep 12, 2023

Hi,
The method's signature can be found in the docs. x and y are in mm, the returned thickness is in Å.

@leverglow
Copy link
Author

Thanks for your reply,I found what it means in the docs.So may I set the laterally graded multilayer directly in xrtQook by commenting or uncommenting codes?Or I need to wirte codes myself to set it.

@kklmn
Copy link
Owner

kklmn commented Sep 12, 2023

If you want it in xrtQook then it's a bit harder. You have to create a derived class of Multilayer yourself where you implement the methods get_t_thickness and get_b_thickness, xrtQook cannot know the lateral thickness variation you are going to implement. There is a mechanism in xrtQook for registering custom (user) optical element classes, but not custom material classes. So you will have to also make a derived class from the optical element you're using, in whose __init__ you specify the custom multilayer material. Then you register this OE class in xrtQook, as explained in xrtQookStart.py.

@leverglow
Copy link
Author

OK,that's too difficult for me.So how I can directly use 'get_t_thickness'.If I use gradedMultilayer,the codes are'gradedMultilayer02 = rmats.GradedMultilayer(
tLayer=Ru,
tThickness=16.5,
bLayer=C,
bThickness=16.5,
nPairs=60,
tThicknessLow=19.9,
bThicknessLow=19.9,
name=None)'
I can determine depth graded multilayer's thickness through' tThickness=16.5',so how to determine laterally graded thicknesses through'get_t_thickness'

@kklmn
Copy link
Owner

kklmn commented Sep 12, 2023

So how I can directly use 'get_t_thickness'.

It is not you who uses the method, xrt uses it. You create it.

@leverglow
Copy link
Author

So in which program(.py) should I modify the code to implement laterally graded thicknesses.

@kklmn
Copy link
Owner

kklmn commented Sep 13, 2023

You should subclass Multilayer from xrt/backends/raycing/materials.

@leverglow
Copy link
Author

I write the code
'class LMultilayer(Multilayer):
def get_t_thickness(self, x, y, iPair):
global XY # to extract x,y values
XY = np.array([x,y])
return self.dti[iPair]
def get_b_thickness(self, x, y, iPair):
return self.dti[iPair]'in materials.py.
Then I tried to use it through
'gradedMultilayer01 = rmats.LMultilayer(
tLayer=Ru,
bLayer=C,
tThickness=19.5,
bThickness=19.5,
nPairs=150,
tThicknessLow=15.2,
bThicknessLow=15.2,
name=None)'
but it does't work,the results are the same when I change'gradedMultilayer01 = rmats.LMultilayer(' to 'gradedMultilayer01 = rmats.GradedMultilayer('.
I don't know if I'm calling the function(class LMultilayer) in a wrong way or if the function itself is wrong

@kklmn
Copy link
Owner

kklmn commented Sep 13, 2023

How do you want to define the graded thickness? How does it change in space as a function of x and y?

@leverglow
Copy link
Author

The laterally graded multilayer consists of two materials and their thickness only varies with x,so no matter where the laser hits, it can have a high reflectivity.There is a function between x and thickness.So do I need to write complex computational relationships between them as part of the code?Or just modify parts of depth graded multilayer's code.

@kklmn
Copy link
Owner

kklmn commented Sep 13, 2023

There is a function between x and thickness.

You need to implement this dependence inside the two methods get_t_thickness and get_b_thickness in your subclass.

@leverglow
Copy link
Author

Okay, so how does the depth gradient multilayer set up the function between x and depth? I would like to refer to it to set up the lateral gradient multilayer.

@kklmn
Copy link
Owner

kklmn commented Sep 24, 2023

If I understand your question correctly (I am not sure about it) then my first reply in this thread is the answer to it.

@leverglow
Copy link
Author

I know the function'get_b_thickness(x, y, iPair)' and what each parameter represents,but how can I use it in my python program.For example, my lateral gradient multilayer goes from 30nm to 20nm, and there are 100 pairs.I mean what exactly is the code to use 'get_b_thickness(x, y, iPair)'and 'get_t_thickness(x, y, iPair)'.

@kklmn
Copy link
Owner

kklmn commented Sep 24, 2023

Any reason why somebody should code for you?

@kklmn
Copy link
Owner

kklmn commented Sep 26, 2023

One such reason could be your will to share experimental data that you're trying to model. Another reason for me could be in seeing that this study is a part of a bigger and attractive project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants