class Atoms(struct, absorbing_atom, radius)[source]

Bases: monty.json.MSONable

Atomic cluster centered around the absorbing atom.

  • struct (Structure) – input structure
  • absorbing_atom (str/int) – Symbol for absorbing atom or site index
  • radius (float) – radius of the atom cluster in Angstroms.
static atoms_string_from_file(filename)[source]

Reads atomic shells from file such as feff.inp or ATOMS file The lines are arranged as follows:

x y z ipot Atom Symbol Distance Number

with distance being the shell radius and ipot an integer identifying the potential used.

Parameters:filename – File name containing atomic coord data.
Returns:Atoms string.

Returns the atomic cluster as a Molecule object.

static cluster_from_file(filename)[source]

Parse the feff input file and return the atomic cluster as a Molecule object.

Parameters:filename (str) – path the feff input file
the atomic cluster as Molecule object. The absorbing atom
is the one at the origin.
Return type:Molecule

Returns a list of string representations of the atomic configuration information(x, y, z, ipot, atom_symbol, distance, id).

list of strings, sorted by the distance from the absorbing
Return type:list

Write Atoms list to file.

Parameters:filename – path for file to be written
exception FeffParserError(msg)[source]

Bases: Exception

Exception class for Structure. Raised when the structure has problems, e.g., atoms that are too close.

class Header(struct, source='', comment='')[source]

Bases: monty.json.MSONable

Creates Header for the FEFF input file.

Has the following format:

* This feff.inp file generated by pymatgen,
TITLE comment:
TITLE Source: CoO19128.cif
TITLE Structure Summary: (Co2 O2)
TITLE Reduced formula: CoO
TITLE space group: P1,   space number: 1
TITLE abc: 3.297078 3.297078 5.254213
TITLE angles: 90.0 90.0 120.0
TITLE sites: 4
* 1 Co     0.666666     0.333332     0.496324
* 2 Co     0.333333     0.666667     0.996324
* 3 O     0.666666     0.333332     0.878676
* 4 O     0.333333     0.666667     0.378675
  • struct – Structure object, See pymatgen.core.structure.Structure.
  • source – User supplied identifier, i.e. for Materials Project this would be the material ID number
  • comment – Comment for first header line

Formula of structure

static from_cif_file(cif_file, source='', comment='')[source]

Static method to create Header object from cif_file

  • cif_file – cif_file path and name
  • source – User supplied identifier, i.e. for Materials Project this would be the material ID number
  • comment – User comment that goes in header

Header Object

static from_file(filename)[source]

Returns Header object from file

static from_string(header_str)[source]

Reads Header string and returns Header object if header was generated by pymatgen. Note: Checks to see if generated by pymatgen, if not it is impossible

to generate structure object so it is not possible to generate header object and routine ends
Parameters:header_str – pymatgen generated feff.inp header
Returns:Structure object.
static header_string_from_file(filename='feff.inp')[source]

Reads Header string from either a HEADER file or feff.inp file Will also read a header from a non-pymatgen generated feff.inp file

Parameters:filename – File name containing the Header data.
Returns:Reads header string.

Returns space number and space group

Returns:Space number and space group list

Writes Header into filename on disk.

Parameters:filename – Filename and path for file to be written to disk
class Paths(atoms, paths, degeneracies=None)[source]

Bases: monty.json.MSONable

Set FEFF scattering paths(‘paths.dat’ file used by the ‘genfmt’ module).

  • atoms (Atoms) – Atoms object
  • paths (list(list)) – list of paths. Each path is a list of atom indices in the atomic cluster(the molecular cluster created by Atoms class). e.g. [[0, 1, 2], [5, 9, 4, 1]] -> 2 paths: one with 3 legs and the other with 4 legs.
  • degeneracies (list) – list of degeneracies, one for each path. Set to 1 if not specified.

Write paths.dat.

class Potential(struct, absorbing_atom)[source]

Bases: monty.json.MSONable

FEFF atomic potential.

  • struct (Structure) – Structure object.
  • absorbing_atom (str/int) – Absorbing atom symbol or site index
static pot_dict_from_string(pot_data)[source]

Creates atomic symbol/potential number dictionary forward and reverse

pot_data: potential data in string format
Returns:forward and reverse atom symbol and potential number dictionaries.
static pot_string_from_file(filename='feff.inp')[source]

Reads Potential parameters from a feff.inp or FEFFPOT file. The lines are arranged as follows:

ipot Z element lmax1 lmax2 stoichometry spinph
Parameters:filename – file name containing potential data.
Returns:FEFFPOT string.

Write to file.

Parameters:filename – filename and path to write potential file to.
class Tags(params=None)[source]

Bases: dict

FEFF control parameters.

Parameters:params – A set of input parameters as a dictionary.

Dict representation.

Returns:Dictionary of parameters from fefftags object

Diff function. Compares two PARAMETER files and indicates which parameters are the same and which are not. Useful for checking whether two runs were done using the same parameters.

Parameters:other – The other PARAMETER dictionary to compare to.
Returns:parameters_that_are_the_same, “Different”: parameters_that_are_different} Note that the parameters are return as full dictionaries of values.
Return type:Dict of the format {“Same”
static from_dict(d)[source]

Creates Tags object from a dictionary.

Parameters:d – Dict of feff parameters and values.
Returns:Tags object
static from_file(filename='feff.inp')[source]

Creates a Feff_tag dictionary from a PARAMETER or feff.inp file.

Parameters:filename – Filename for either PARAMETER or feff.inp file
Returns:Feff_tag object
get_string(sort_keys=False, pretty=False)[source]

Returns a string representation of the Tags. The reason why this method is different from the __str__ method is to provide options for pretty printing.

  • sort_keys – Set to True to sort the Feff parameters alphabetically. Defaults to False.
  • pretty – Set to True for pretty aligned output. Defaults to False.

String representation of Tags.

static proc_val(key, val)[source]

Static helper method to convert Feff parameters to proper types, e.g. integers, floats, lists, etc.

  • key – Feff parameter key
  • val – Actual value of Feff parameter.

Write Tags to a Feff parameter tag file.

Parameters:filename – filename and path to write to.
get_absorbing_atom_symbol_index(absorbing_atom, structure)[source]

Return the absorbing atom symboll and site index in the given structure.

  • absorbing_atom (str/int) – symbol or site index
  • structure (Structure) –

symbol and site index

Return type:

str, int


Returns a dict that maps each atomic symbol to a unique integer starting from 1.

Parameters:structure (Structure) –