Description | Perl tools for X-ray Absorption Spectroscopy |
Demeter::Constants - A library of constants
This documentation refers to Demeter version 0.9.26.
This provides a library of constants so as to avoid redefining then over and over.
use Demeter::Constants qw(:all);
or
use Demeter::Constants qw($NUMBER);
This collects all the commonly defined constants into one place. Please note that this exports variables into your module's namespace. This is a against good practice, but is a huge convenience, they are all upper case, and I am telling you about it!
The :all
tag can be used to import the entire library.
The following constants are numbers. They can be imported as a set using the :numbers
export tag.
$PI
This is 4*atan2(1,1)
.
$ETOK
The conversion constant between energy and wavenumber.
k = sqrt( ETOK * (E-E0) )
$ETOK
is about equal to 1 / 3.81. 10 inverse Angstroms is about 381 volts above the edge.
$HBARC
This is hbar*c in eV*Angstrom units.
$HC
This is h*c in eV*Angstrom units.
$HC = $HBARC * 2 * $PI;
$HBARC
This is hbar in eV*seconds units.
$R2D
The conversion constant between degrees and radians, 180/PI.
$EPSILONn
1e-n, for instance $EPSILON2
= 1e-2 and $EPSILON2
= 1e-7. These are defined for 2 through 7.
The following constants are strings. They can be imported as a set using the :strings
export tag.
$NULLFILE
This is @&^^null^^&@
, a nonesense string to indicate an undefined filename.
$ENDOFLINE
The platform specific end of line character.
$CTOKEN
The token, +
, denoting the central atom in a short representation of the path geometry.
The following constants are regular expressions. They can be imported as a set using the :regexps
export tag.
$NUMBER
This is $RE{num}{real}
from Regexp::Common, i.e. a match for floats.
$INTEGER
This is $RE{num}{int}
from Regexp::Common, i.e. a match for integers.
$SEPARATOR
This is [ \t]*[ \t=,][ \t]*
, the regular expression defining the separation between keyword and value in an input file for Feff, Atoms, etc.
$ELEMENT
A regular expression matching a valid element symbol.
$FEFFNOTOK
A regular expression used to scrub strings which, when used as site tags, will cause trouble with Feff. This currently matches a character that is not alphanumeric, a dot, a dash, or an underscore: [^-a-zA-Z0-9_.]
Please report problems to the Ifeffit Mailing List (http://cars9.uchicago.edu/mailman/listinfo/ifeffit/)
Patches are welcome.
Bruce Ravel, http://bruceravel.github.io/home
http://bruceravel.github.io/demeter/
Copyright (c) 2006-2018 Bruce Ravel (http://bruceravel.github.io/home). All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlgpl.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.