Refractive Index#

class lasy.utils.refractive_index.RefractiveIndexDatabase(database_path=None, auto_download=False)[source]#

Refractive index database for various materials.

Class that opens and stores the refractiveindex.info YAML database. The entire database will be downloaded if it does not exist and download is requested (typically on the first time it is run).

Parameters:
database_pathstr or None

Is None, defaults to user home directory. If passed, should be the directory containing the database structure.

auto_downloadbool, default is True

If True, database will be downloaded. If False and no database found, an error will be thrown.

class lasy.utils.refractive_index.Material(shelf=None, book=None, page=None, name=None, db=None)[source]#

Description of material and its optical properties.

Class that contains material specific data: its refractive index and extinction coefficient. Input arguments can either be a known name defined in the dict above or a combination of shelf, book and page. The latter follow the definitions on refractiveindex.info website.

Parameters:
shelfstr or None

refractiveindex.info shelf name.

bookstr or None

refractiveindex.info book name.

pagestr or None

refractiveindex.info page name.

namestr or None

A known name, defined in the dict above.

dbRefractiveIndexDatabase instance or None

An instance of RefractiveIndexDatabase can be given, which speeds up material initialisation.

calc_k(lambda_um)[source]#

Calculate extinction coefficient for this material.

Performs the calculation and checks for wavelength being in the required range.

Parameters:
lambda_umfloat or iterable

Wavelength(s) at which to evaluate the extinction coefficient. Must be in microns.

Returns:
kfloat or xp.array

Extinction coefficient, same shape as lambda_mu. 0 is returned for wavelengths outside the applicable range

calc_n(lambda_um)[source]#

Calculate refractive index for this material.

Performs the calculation and checks for wavelength being in the required range.

Parameters:
lambda_umfloat or iterable

Wavelength(s) at which to evaluate the refractive index. Must be in microns.

Returns:
nfloat or np.array

Refractive index value, same shape as lambda_mu. 0 is returned for wavelengths outside the applicable range

calc_spectral_phase_expansion(omega0)[source]#

Calculate spectral phase expansion terms.

More precisely, the first three terms of the Taylor expansion of the spectral phase around \(\omega_0\) are calculated:

\[ \begin{align}\begin{aligned}\phi_1 = \left.\frac{\mathrm{d}\phi}{\mathrm{d}\omega}\right\vert_{\omega_0}\\\phi_2 = \left.\frac{\mathrm{d}^2\phi}{\mathrm{d}\omega^2}\right\vert_{\omega_0}\\\phi_3 = \left.\frac{\mathrm{d}^3\phi}{\mathrm{d}\omega^3}\right\vert_{\omega_0}\end{aligned}\end{align} \]

Definitions can be found at https://www.newport.com/n/the-effect-of-dispersion-on-ultrashort-pulses

Parameters:
omega0float (in rad/s)

Central frequency at which to evaluate the spectral phase expansion terms.

Returns:
dphi_dwfloat

First term (group delay), in units s/m

d2phi_dw2float

Second term (GVD), in units s^2/m

d3phi_dw3float

Third term (TOD), in units s^3/m

get_n2(lambda_mu, page=None, return_mean=False)[source]#

Retrieve n2 from the database.

If page is not passed, the code will look through all the available data and return data, which contain the passed wavelength.

Parameters:
lambda_mufloat

The wavelength at which n2 should be evaluated. Must be in microns.

pagestr or None, default is None

If given, will only return n2 data from the requested page, ignoring all other data for the material.

return_meanbool, default is False

If False, all data where n2 can be evaluated will be returned. If True, a mean value of all available data is returned.

Returns:
n2float or array

n2 value (in m^2/W) at the given lambda_mu. If return_mean is True, a mean of all available data. If return_mean is False, all available data in an array.

0 is returned if no data exists or was found.

pageslist

List of page names which contain n2 data for the requested wavelength.

print_n2_data()[source]#

Nicely print out all the known data for n2.