Module calculator¶
This module contains different classes used to define a new calculator for specific spectroscopies understood by MsSpec.
These spectroscopies are listed here.
There is one calculator class for each spectroscopy. The class name is based
on the spectroscopy name. For instance, the class for PhotoElectron Diffraction
is called _PED
.
The helper function calculator.MSSPEC()
is used to create objects from
these classes by passing the kind of spectroscopy as a keyword argument.
For more information on MsSpec, follow this link
- calculator.MSSPEC(spectroscopy='PED', **kwargs)[source]¶
The MsSpec calculator constructor.
Instanciates a calculator for the given spectroscopy.
- Parameters
spectroscopy – See spectroscopy.
kwargs – Other keywords are passed to the spectroscopy-specific constructor.
- Returns
A
calculator._MSCALCULATOR
object.
- class calculator._EIG(algorithm='inversion', polarization=None, dichroism=None, spinpol=False, folder='./calc', txt='-')[source]¶
Bases:
calculator._MSCALCULATOR
Note
This class constructor is not meant to be called directly by the user. Use the
MSSPEC()
to instanciate any calculator.
- class calculator._MSCALCULATOR(spectroscopy='PED', algorithm='expansion', polarization=None, dichroism=None, spinpol=False, folder='./calc', txt='-', **kwargs)[source]¶
Bases:
ase.calculators.calculator.Calculator
This class defines an ASE calculator for doing Multiple scattering calculations.
- get_parameters()[source]¶
Get all the defined parameters in the calculator.
- Returns
A list of all parameters objects.
- Return type
List of
parameters.Parameter
- set_atoms(atoms)[source]¶
Defines the cluster on which the calculator will work.
- Parameters
atoms (
ase.Atoms
) – The cluster to attach the calculator to.
- shutdown()[source]¶
Removes the temporary folder and all its content.
The user may whish to keep the calculation folder (see folder) so it is not removed at the end of the calculation. The calculation folder contains raw results from Phagen and Spec programs as well as their input files and configuration. It allows the program to save some time by not repeating some tasks (such as the Fortran code generation, building the binaries, computing things that did not changed between runs…). Calling this function at the end of the calculation will erase this calculation folder.
Warning
Calling this function will erase the produced data without prompting you for confirmation, so take care of explicitly saving your results in your script, by using the
iodata.Data.save()
method for example.
- class calculator._PED(algorithm='expansion', polarization=None, dichroism=None, spinpol=False, folder='./calc', txt='-')[source]¶
Bases:
calculator._MSCALCULATOR
This class creates a calculator object for PhotoElectron DIffraction spectroscopy.
- Parameters
algorithm – The algorithm to use for the computation. See algorithm for more details about the allowed values and the type.
polarization – The incoming light polarization (see polarization)
dichroism – Wether to enable or not the dichroism (see dichroism)
spinpol – Enable or disable the spin polarization in the calculation (see spinpol)
folder – The path to the temporary folder for the calculations. See folder
txt (str) – The name of a file where to redirect standard output. The string ‘-’ will redirect the standard output to the screen (default).
Note
This class constructor is not meant to be called directly by the user. Use the
MSSPEC()
to instanciate any calculator.- get_energy_scan(phi=0, theta=0, level=None, kinetic_energy=None, data=None, **kwargs)[source]¶
Computes an energy scan of the emitted photoelectrons.
- Parameters
phi – All the values of the azimuthal angle to be computed. See phi.
theta – The polar angle in degrees. See theta.
level – The electronic level. See level.
kinetic_energy – see kinetic_energy.
data – a
iodata.Data
object to append the results to or None.
- Returns
The modified
iodata.Data
object passed as an argument or a newiodata.Data
object.
- get_phi_scan(phi=array([0.0, 1.0, 2.01, ..., 356.99, 358.0, 359.0]), theta=0, level=None, kinetic_energy=None, data=None, **kwargs)[source]¶
Computes an azimuthal scan of the emitted photoelectrons.
- Parameters
phi – All the values of the azimuthal angle to be computed. See phi.
theta – The polar angle in degrees. See theta.
level – The electronic level. See level.
kinetic_energy – see kinetic_energy.
data – a
iodata.Data
object to append the results to or None.
- Returns
The modified
iodata.Data
object passed as an argument or a newiodata.Data
object.
- get_potential(atom_index=None, data=None, units={'energy': 'eV', 'space': 'angstrom'})[source]¶
Computes the coulombic part of the atomic potential.
- Parameters
atom_index – The atom indices to get the potential of, either as a list or as a single integer
data – The data object to store the results to
units – The units to be used. A dictionary with the keys ‘energy’ and ‘space’
- Returns
A Data object
- get_scattering_factors(level='1s', kinetic_energy=None, data=None, **kwargs)[source]¶
Computes the scattering factors of all prototypical atoms in the cluster.
This function computes the real and imaginery parts of the scattering factor as well as its modulus for each non symetrically equivalent atom in the cluster. The results are stored in the data object if provided as a parameter.
- Parameters
level – The electronic level. See level.
kinetic_energy – see kinetic_energy.
data – a
iodata.Data
object to append the results to or None.
- Returns
The modified
iodata.Data
object passed as an argument or a newiodata.Data
object.
- get_theta_phi_scan(phi=array([0.0, 7.35, 14.69, ..., 345.31, 352.65, 360.0]), theta=array([0.0, 2.05, 4.09, ..., 85.91, 87.95, 90.0]), level=None, kinetic_energy=None, data=None, **kwargs)[source]¶
Computes a stereographic scan of the emitted photoelectrons.
The azimuth ranges from 0 to 360° and the polar angle ranges from 0 to 90°.
- Parameters
level – The electronic level. See level.
kinetic_energy – see kinetic_energy.
data – a
iodata.Data
object to append the results to or None.
- Returns
The modified
iodata.Data
object passed as an argument or a newiodata.Data
object.
- get_theta_scan(phi=0, theta=array([- 70.0, - 69.0, - 68.0, ..., 68.0, 69.0, 70.0]), level=None, kinetic_energy=None, data=None, **kwargs)[source]¶
Computes a polar scan of the emitted photoelectrons.
- Parameters
phi – The azimuthal angle in degrees. See phi.
theta – All the values of the polar angle to be computed. See theta.
level – The electronic level. See level.
kinetic_energy – see kinetic_energy.
data – a
iodata.Data
object to append the results to or None.
- Returns
The modified
iodata.Data
object passed as an argument or a newiodata.Data
object.