The Material Handler Reference

This class will automatically retrieve the lattice parameter and the crystal structure of a given element

class neutronbraggedge.material_handler.retrieve_material_metadata.RetrieveMaterialMetadata(material=None, use_local_table=True)[source]

Retrieve the metadata for a given material

This class retrieves the lattice parameter and the crystal structure of a given material.

>>> from braggedge.material_handler.retrieve_material_metadata import RetrieveMaterialMetadata
>>> retrieve_metadata = RetrieveMaterialMetadata("Si")
>>> print ("Structure is: %s" %retrieve_metadata.crystal_structure)
Structure is: FCC
>>> print ("Lattice parameter is %.2f Angstroms" %retrieve_metadata.lattice)
Lattice parameter is 5.43 Angstroms

This class will retrieve the table from the URL and reformat it to be able to quickly retrieve the metadata for a given material

class neutronbraggedge.material_handler.retrieve_metadata_table.RetrieveMetadataTable(use_local_table=True)[source]

Metadata table retriever

This class retrieves the metadata table that will allow us to get the lattice parameter and the crystal structure for a given material.

By default the program will retrieve the local version, but the web version can be retrieved by using the local_version=False flag. In this case, the table is retrieved from the following web page: Lattice constant <https://en.wikipedia.org/wiki/Lattice_constant>.

>>> from braggedge.material_hanlder.retrieve_metadata_table import RetrieveMetadataTable
>>> retrieve_local_meta = RetrieveMetadataTable()
>>> _table = retrieve_local_meta.get_table()
>>> retrieve_url_meta = RetrieveMetadataTable()
>>> _table = retrieve_url_meta.get_table(use_local_table = False)
format_table_from_url()[source]

reformat the table from the url to easily extrade the metadata

get_table()[source]

return the table (via url or locally) according to flag used

Args: use_local_table (boolean): get the local table or via the url defined in the config file (default True)

Returns: Pandas table of material/lattice parameters ...

retrieve_table()[source]

retrieve the table that contain the material/lattice parameters.... by default, the local version is retrieved first, but the web version can be selected instead by using False on use_local_table flag

retrieve_table_from_url()[source]

retrieve the table using the url defined in the config.cfg file

retrieve_table_local()[source]

retrieve the local table