at.load.matfile#
Load lattices from Matlab files.
Functions
|
Create a |
|
Save a |
|
Create a |
|
Save a |
|
Create a |
- load_m(filename, **kwargs)[source]#
Create a
Lattice
from a Matlab m-file- Parameters:
filename (str) – Name of a ‘.m’ file
- Keyword Arguments:
keep_all (bool) – Keep RingParam elements as Markers. Default:
False
name (str) – Name of the lattice. Default: taken from the lattice, or
''
energy (float) – Energy of the lattice [eV]. Default: taken from the lattice elements
periodicity (int) – Number of periods. Default: taken from the elements, or 1
* – All other keywords will be set as Lattice attributes
- Returns:
lattice (Lattice) – New
Lattice
object
See also
load_lattice()
for a generic lattice-loading function.
- load_mat(filename, **kwargs)[source]#
Create a
Lattice
from a Matlab mat-file- Parameters:
filename (str) – Name of a ‘.mat’ file
- Keyword Arguments:
use (str) – Name of the Matlab variable containing the lattice. Default: it there is a single variable, use it, otherwise select ‘RING’
mat_key (str) – deprecated alias for use
quiet (bool) – Suppress the warning for non-standard classes. Default:
False
keep_all (bool) – Keep RingParam elements as Markers. Default:
False
name (str) – Name of the lattice. Default: taken from the lattice, or
''
energy (float) – Energy of the lattice [eV]. Default: taken from the lattice elements
periodicity (int) – Number of periods. Default: taken from the elements, or 1
* – All other keywords will be set as Lattice attributes
- Returns:
lattice (Lattice) – New
Lattice
object
See also
load_lattice()
for a generic lattice-loading function.
- load_var(matlat, **kwargs)[source]#
Create a
Lattice
from a Matlab cell array- Parameters:
- Keyword Arguments:
keep_all (bool) – Keep RingParam elements as Markers. Default:
False
name (str) – Name of the lattice. Default: taken from the lattice, or
''
energy (float) – Energy of the lattice [eV]. Default: taken from the lattice elements
periodicity (int) – Number of periods. Default: taken from the elements, or 1
* – All other keywords will be set as Lattice attributes
- Returns:
lattice (Lattice) – New
Lattice
object
- save_m(ring, filename=None)[source]#
Save a
Lattice
as a Matlab m-file- Parameters:
ring (Lattice) – Lattice description
filename (str | None) – Name of the ‘.m’ file. Default: outputs on
sys.stdout
See also
save_lattice()
for a generic lattice-saving function.
- save_mat(ring, filename, **kwargs)[source]#
Save a
Lattice
as a Matlab mat-file- Parameters:
- Keyword Arguments:
See also
save_lattice()
for a generic lattice-saving function.