Skip to content
Snippets Groups Projects
SimulatedDensityOfStates-v1.rst 2.67 KiB
Newer Older
.. algorithm::

.. summary::

.. alias::

.. properties::

Description
-----------

Calculates phonon densities of states, Raman and IR spectrum from the
output of CASTEP code obtained in the form of *.phonon* and *.castep* files.
Dan Nixon's avatar
Dan Nixon committed
The PeakWidth property may be passed a function containg the variable "energy"
(e.g. *0.1*energy*) to set the FWHM of the peak as a function of the energy
(centre point of the peak). This can be useful for comparison with experimental
data by allowing the peak width to change according to the resolution of the
instrument.

Dan Nixon's avatar
Dan Nixon committed
If the IonTable spectrum type is used then the output workspace will be
a table workspace containing each ion that is present in a *.phonon* file.

If the BondTable spectrum type is used then the output workspace will be
a table workspace containing details of the bonds defined in the *.castep*
file.
Dan Nixon's avatar
Dan Nixon committed
.. include:: ../usagedata-note.txt

**Example - loading data from phonon & castep files:**
Dan Nixon's avatar
Dan Nixon committed
.. testcode:: ExSimulatedDensityOfStatesSimple
Dan Nixon's avatar
Dan Nixon committed
    # Loading the same data from a castep and phonon file
Dan Nixon's avatar
Dan Nixon committed
    phonon_ws = SimulatedDensityOfStates(PHONONFile='squaricn.phonon')
    castep_ws = SimulatedDensityOfStates(CASTEPFile='squaricn.castep')
    print CheckWorkspacesMatch(phonon_ws, castep_ws)
Dan Nixon's avatar
Dan Nixon committed
.. testoutput:: ExSimulatedDensityOfStatesSimple
**Example - loading partial contributions of ions:**
Dan Nixon's avatar
Dan Nixon committed
.. testcode:: ExSimulatedDensityOfStatesPartial
Dan Nixon's avatar
Dan Nixon committed
    squaricn = SimulatedDensityOfStates(PHONONFile='squaricn.phonon',
                                        Ions=['H', 'C', 'O'])

    for name in squaricn.getNames():
Dan Nixon's avatar
Dan Nixon committed
.. testoutput:: ExSimulatedDensityOfStatesPartial
    squaricn_H
    squaricn_C
    squaricn_O

**Example - loading summed partial contributions of ions:**
Dan Nixon's avatar
Dan Nixon committed
.. testcode:: ExSimulatedDensityOfStatesPartialSummed
Dan Nixon's avatar
Dan Nixon committed
    sum_ws = SimulatedDensityOfStates(PHONONFile='squaricn.phonon',
                                      Ions=['H', 'C', 'O'],
                                      SumContributions=True)
    total_ws = SimulatedDensityOfStates(PHONONFile='squaricn.phonon')
    print CheckWorkspacesMatch(total_ws, sum_ws, Tolerance=1e-12)
Dan Nixon's avatar
Dan Nixon committed
.. testoutput:: ExSimulatedDensityOfStatesPartialSummed
Dan Nixon's avatar
Dan Nixon committed
**Example - Getting the list of ions in a phonon file:**

Dan Nixon's avatar
Dan Nixon committed
.. testcode:: ExSimulatedDensityOfStatesIonTable
Dan Nixon's avatar
Dan Nixon committed
    ion_ws = SimulatedDensityOfStates(PHONONFile='squaricn.phonon',
                                      SpectrumType='IonTable')
Dan Nixon's avatar
Dan Nixon committed
    print ', '.join(ion_ws.column('Species'))
Dan Nixon's avatar
Dan Nixon committed

Output:

Dan Nixon's avatar
Dan Nixon committed
.. testoutput:: ExSimulatedDensityOfStatesIonTable
    H, H, H, H, C, C, C, C, C, C, C, C, O, O, O, O, O, O, O, O
  :cpp: None
  :h: None