viperleed.calc.classes.beam.Beam
- class viperleed.calc.classes.beam.Beam(hk, maxdenom=99)[source]
Class storing properties and data of a diffraction beam.
Stores h,k, and can store intensity over energy.
- hkfrac
The h and k coordinates of the beam as Fractions
- Type:
tuple (Fraction, Fraction)
- hk
The h and k coordinates of the beam as float
- Type:
tuple (float, float)
- intens
contains {energy: intensity} pairs
- Type:
dict {float: float}
- complex_amplitude
contains {energy: amplitude} pairs
- Type:
dict {float: complex}
- label
Label for the beam
- Type:
str
Methods
__init__
(hk[, maxdenom])getLabel
([style, lwidth])Returns a string of format '( 1/2 | -1 )', where a,b in '(a|b)' are justified to at least the given width.
isEqual
(beam[, eps])Checks whether the beam is equal to another beam with a given tolerance.
isEqual_hk
(hk[, eps])Checks whether the beam hk is equal to a tuple hk with a given tolerance.
normMax
()Normalizes the beam to maximum, i.e. sets the highest value to 1.0 and rescales the others accordingly.
updateIndex
(hk[, maxdenom])Keep values but change indices
Attributes
energies
intensities