yasfpy.functions.material_handler#

Material table helpers.

Contains utilities for reading/interpolating refractive index tables used by YASF.

Attributes#

Functions#

material_handler(links[, cache, local])

Handles the processing of material data from various sources.

handle_refractiveindex_info(url)

Retrieves refractive index data from a given URL and processes it.

handle_eodg(url)

Handles the EODG material data retrieval from a given URL.

handle_csv(path)

Read a CSV file containing material data and extract the material name and data.

Module Contents#

yasfpy.functions.material_handler.HASH_TYPE = 'sha256'#
yasfpy.functions.material_handler.material_handler(links, cache=True, local=True)#

Handles the processing of material data from various sources.

Parameters:
  • links (str or list) – The link(s) to the material data source(s).

  • cache (bool) – cache the downloaded file using sha256 string

  • local (bool) – load locally cached files if available

Returns:

A dictionary containing the processed material data and information.

Return type:

(dict)

yasfpy.functions.material_handler.handle_refractiveindex_info(url)#

Retrieves refractive index data from a given URL and processes it.

Parameters:

url (str) – The URL to retrieve the refractive index data from.

Returns:

A tuple containing the processed data as a pandas DataFrame and the material name.

Return type:

(tuple)

Raises:

Exception – If the data retrieval fails.

yasfpy.functions.material_handler.handle_eodg(url)#

Handles the EODG material data retrieval from a given URL.

Parameters:

url (str) – The URL of the EODG material data.

Returns:

A tuple containing the retrieved material data and the material name.

Return type:

(tuple)

Raises:

Exception – If the data retrieval from the URL fails.

yasfpy.functions.material_handler.handle_csv(path)#

Read a CSV file containing material data and extract the material name and data.

Parameters:

path (str) – The path to the CSV file.

Returns:

A tuple containing the material data as a pandas DataFrame and the material name.

Return type:

(tuple)