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
- __init__(material=None, use_local_table=True)[source]
Constructor that will automatically retrieve the metadata
Args: material: mandatory string (ex: “Si”) use_local_table: optional boolean. By default, a local table is used, but
user can turn off the flag to retrieve data from web site (<https://en.wikipedia.org/wiki/Lattice_constant>)
Exception: NameError: if no material is given
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 neutronbraggedge.material_handler.retrieve_metadata_table import RetrieveMetadataTable >>> retrieve_local_meta = RetrieveMetadataTable() >>> _table = retrieve_local_meta.get_table()
>>> retrieve_url_meta = RetrieveMetadataTable(use_local_table=False) >>> _table = retrieve_url_meta.get_table()
- Parameters:
use_local_table (bool)
- 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
- Return type:
None
- retrieve_table_from_url()[source]
retrieve the table using the url defined in the config.cfg file
- Return type:
None