dschick / udkm1Dsim

A Python Simulation Toolkit for 1D Ultrafast Dynamics in Condensed Matter
http://udkm1dsim.readthedocs.io
MIT License
21 stars 16 forks source link

Obtain effective refractive index from arbitrary layer #112

Open EmCeBeh opened 2 years ago

EmCeBeh commented 2 years ago

Any given layer is made of atoms, comprised of magnetic and non-magnetic scattering factors f1,f2,m1,m2.

It would be useful to obtain the refractive index from this layer, too. Except for physical constants, there are only two free parameters needed: The atomic density - which the simulation already knows via the mass density and the molar mass - and the wavelength which has to be enterable as an array, e.g. .

This could look like:

import numpy as np
atom_Fe = ud.Atom('Fe')
layer_Fe = ud.AmorphousLayer('Layer_Fe', 'Fe Layer', 15*u.nm, 8000*u.kg/u.m**3, atom=atom_Fe)
print(layer_Fe.refractive_index(np.arange(705,715,0.1)

which returns a 2D array with 5 coloumns, E, delta, beta, Deltadelta, deltabeta.

dschick commented 2 years ago

thanks a lot for this suggestion!

I think it is reasonable to have the atomic_form_factors as properties of the atoms and then add a new functionality to the Layer class to calculate the refractive_index as a function of photon_energy. In fact this calculation is already done in the XrayDynMag scattering simulation

You are very welcome to draft a PR