Debian Codegraph @

lib/Ifeffit/Elements.pm

raw
1 package Ifeffit::Elements; # -*- cperl -*-
2 ######################################################################
3 ## Ifeffit::Elements: Element manipulation utilities for Athena
4 ##
5 ## Athena is copyright (c) 2001-2006 Bruce Ravel
6 ## [email protected]
7 ## http://feff.phys.washington.edu/~ravel/
8 ##
9 ## Ifeffit is copyright (c) 1992-2006 Matt Newville
10 ## [email protected]
11 ## http://cars9.uchicago.edu/~newville/ifeffit/
12 ##
13 ## The latest version of Athena can always be found at
14 ## http://feff.phys.washington.edu/~ravel/software/exafs
15 ##
16 ## -------------------------------------------------------------------
17 ## All rights reserved. This program is free software; you can
18 ## redistribute it and/or modify it provided that the above notice
19 ## of copyright, these terms of use, and the disclaimer of
20 ## warranty below appear in the source code and documentation, and
21 ## that none of the names of The Naval Research Laboratory, The
22 ## University of Chicago, University of Washington, or the authors
23 ## appear in advertising or endorsement of works derived from this
24 ## software without specific prior written permission from all
25 ## parties.
26 ##
27 ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28 ## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
29 ## OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30 ## NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
31 ## HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
32 ## WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
33 ## FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
34 ## OTHER DEALINGS IN THIS SOFTWARE.
35 ## -------------------------------------------------------------------
36 ######################################################################
37
38 use strict;
39 use vars qw($VERSION $cvs_info $module_version @ISA @EXPORT @EXPORT_OK);
40 use Chemistry::Elements qw/get_name get_symbol/;
41 use Xray::Absorption;
42 Xray::Absorption -> load("elam");
43
44 require Exporter;
45
46 @ISA = qw(Exporter AutoLoader);
47 # Items to export into callers namespace by default. Note: do not export
48 # names by default without a very good reason. Use EXPORT_OK instead.
49 # Do not simply export all your public functions/methods/constants.
50 @EXPORT_OK = qw();
51
52 $VERSION = '0.00';
53 $cvs_info = '$Id: $ ';
54 $module_version = (split(' ', $cvs_info))[2] || 'pre_release';
55
56
57 my @k1 = ();
58 foreach (5..25) {
59 my ($name, $sym) = (get_name($_), get_symbol($_));
60 push @k1, [command=>"$_ $name ($sym)",
61 -command=>[\&Ifeffit::Elements::set_e0, $sym, 'K']];
62 };
63 my @k2 = ();
64 foreach (26..50) {
65 my ($name, $sym) = (get_name($_), get_symbol($_));
66 push @k2, [command=>"$_ $name ($sym)",
67 -command=>[\&Ifeffit::Elements::set_e0, $sym, 'K']];
68 };
69 my @k3 = ();
70 foreach (51..75) {
71 my ($name, $sym) = (get_name($_), get_symbol($_));
72 push @k3, [command=>"$_ $name ($sym)",
73 -command=>[\&Ifeffit::Elements::set_e0, $sym, 'K']];
74 };
75 my @k4 = ();
76 foreach (76..84) {
77 my ($name, $sym) = (get_name($_), get_symbol($_));
78 push @k4, [command=>"$_ $name ($sym)",
79 -command=>[\&Ifeffit::Elements::set_e0, $sym, 'K']];
80 };
81
82 my @l31;
83 foreach (15..25) {
84 my ($name, $sym) = (get_name($_), get_symbol($_));
85 push @l31, [command=>"$_ $name ($sym)",
86 -command=>[\&Ifeffit::Elements::set_e0, $sym, 'L3']];
87 };
88 my @l32;
89 foreach (26..50) {
90 my ($name, $sym) = (get_name($_), get_symbol($_));
91 push @l32, [command=>"$_ $name ($sym)",
92 -command=>[\&Ifeffit::Elements::set_e0, $sym, 'L3']];
93 };
94 my @l33;
95 foreach (51..75) {
96 my ($name, $sym) = (get_name($_), get_symbol($_));
97 push @l33, [command=>"$_ $name ($sym)",
98 -command=>[\&Ifeffit::Elements::set_e0, $sym, 'L3']];
99 };
100 my @l34;
101 foreach (76..94) {
102 my ($name, $sym) = (get_name($_), get_symbol($_));
103 push @l34, [command=>"$_ $name ($sym)",
104 -command=>[\&Ifeffit::Elements::set_e0, $sym, 'L3']];
105 };
106
107 use vars qw/@element_menu/;
108 @element_menu = ([cascade => "K-edge: B-Mn", -tearoff=>0,
109 -menuitems=>\@k1],
110 [cascade => "K-edge: Fe-Sn", -tearoff=>0,
111 -menuitems=>\@k2],
112 [cascade => "K-edge: Sb-Re", -tearoff=>0,
113 -menuitems=>\@k3],
114 [cascade => "K-edge: Os-Po", -tearoff=>0,
115 -menuitems=>\@k4],
116 "-",
117 [cascade => "L3-edge: P-Mn", -tearoff=>0,
118 -menuitems=>\@l31],
119 [cascade => "L3-edge: Fe-Sn", -tearoff=>0,
120 -menuitems=>\@l32],
121 [cascade => "L3-edge: Sb-Re", -tearoff=>0,
122 -menuitems=>\@l33],
123 [cascade => "L3-edge: Os-Pu", -tearoff=>0,
124 -menuitems=>\@l34]);
125
126
127
128 sub set_e0 {
129 my $en = Xray::Absorption->get_energy(@_);
130 &::set_e0($en, @_);
131 };
132
133 1;
134 __END__