viperleed.calc.lib.base
Contains generic functions used in the TensErLEED scripts.
Functions
|
Adds all points from l1 to l2, if they are not already in l2 (+- epsilon). |
|
Add atoms at edges and corners to the Cartesian coordinates given. |
|
Returns the angle between two 2D vectors |
|
Number of available virtual or physical CPUs on this system, i.e. user/real as output by time(1) when called with an optimally scaling userspace-only program. |
|
Collapse Cartesian coordinates to the base cell. |
|
Collapse fractional coordinates to the base cell. |
|
Copy the whole tree at the source directory to destination. |
|
Returns the cosine of the angle between two vectors |
|
Checks whether two dictionaries are equal, i.e. contain the same set of keys with the same values. |
|
Calculates the distance of a point from a line, with the line defined by two other points. |
|
Return a rounded version of matrix. |
|
Takes a sting that might be too long to fit on a single line of fortran code and splits it into continuation lines as necessary. |
|
Takes float time in seconds, returns a formatted string giving the elapsed times in minutes, hours or seconds, as appropriate. |
|
Calculate the lowest common multiple of two integers a and b |
|
Helper function to remove duplicates from list. |
|
Find the index in a list such that list[i] - list[i-1] is the largest value difference in the list (after sorting). |
|
Return a generator of pairs of subsequent elements. |
|
Return a version of dotted_name with the last attribute removed. |
|
|
|
Takes a list of integers, sorts them and returns a string short form. |
|
Reads an (arbitrary length) line of integers with fixed width. |
|
Takes a string, returns a list of integers. |
|
For reading PARAMETERS files; takes a list, returns elements until the first one that starts with an exclamation mark. |
|
Takes a string 'xyz[f1 f2 f3]', 'abc[f1 f2 f3]' or just '[f1 f2 f3]' and returns the corresponding vector in cartesian coordinates, or None if the string cannot be parsed. |
|
Takes a list, checks in each element whether the first/last characters are the given combination character, and if so, combines list elements with the list element before/after. |
|
Returns a (2x2) matrix for in-plane rotation of the given rotation angle. |
|
Returns a (2x2) matrix for in-plane rotation of the given rotation order. |
|
Same as s.split(sep, maxsplit=1), but splitting at the first instance from the right. |
|
Takes a list and a separator, splits strings in the list by the separator, returns results as list of lists |
|
Return start and stop as strings from "start:stop" or "start-stop". |
|
Return the part of line to the left of comments. |
Classes
|
Simple class for reading a large file in reverse without having to read the entire file to memory. |
|
Logging Formatter for level-dependent message formatting |
Exceptions
|
A matrix that should have integer values does not. |
|
A matrix that needs inversion is singular. |