Genesis 4 Output¶
genesis.version4.Genesis4Output ¶
Bases: Mapping, BaseModel
Genesis 4 command output.
Attributes:
| Name | Type | Description |
|---|---|---|
run |
RunInfo
|
Execution information - e.g., how long did it take and what was the output from Genesis 4. |
alias |
dict[str, str]
|
Dictionary of aliased data keys. |
Attributes¶
genesis.version4.Genesis4Output.beam_globals
property
¶
beam_globals
Genesis 4 output beam global information (/Beam/Global).
genesis.version4.Genesis4Output.field
property
¶
field
Genesis 4 output field information (/Field) - 1st harmonic.
genesis.version4.Genesis4Output.field_globals
property
¶
field_globals
Genesis 4 output 1st harmonic field global information (/Field/Global).
Functions¶
genesis.version4.Genesis4Output.archive ¶
archive(dest, *, format='hdf5')
Dump output data into the given file or HDF5 group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dest
|
Group
|
The HDF5 file in which to write the information. |
required |
Source code in genesis/version4/output.py
1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 | |
genesis.version4.Genesis4Output.from_archive
classmethod
¶
from_archive(arch, *, format=None)
Loads output from archived file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arch
|
(str, Path or File)
|
The filename or handle on h5py.File from which to load data. |
required |
Source code in genesis/version4/output.py
1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 | |
genesis.version4.Genesis4Output.from_files
classmethod
¶
from_files(filename, load_fields=False, load_particles=False, smear=True)
Load Genesis 4 output from the given filename.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
Path or str
|
|
required |
load_fields
|
bool
|
After execution, load all field files. These are assumed to be in the same directory as the primary output filename. |
True
|
load_particles
|
bool
|
After execution, load all particle files. These are assumed to be in the same directory as the primary output filename. |
True
|
smear
|
bool
|
If set, this will smear the particle phase over the sample (skipped) slices, preserving the modulus. |
True
|
Returns:
| Type | Description |
|---|---|
Genesis4Output
|
The output data. |
Source code in genesis/version4/output.py
1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 | |
genesis.version4.Genesis4Output.from_input_settings
classmethod
¶
from_input_settings(input, workdir, load_fields=False, load_particles=False, smear=True)
Load Genesis 4 output based on the configured input settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
load_fields
|
bool
|
After execution, load all field files. |
False
|
load_particles
|
bool
|
After execution, load all particle files. |
False
|
smear
|
bool
|
If set, for particles, this will smear the phase over the sample (skipped) slices, preserving the modulus. |
True
|
Returns:
| Type | Description |
|---|---|
Genesis4Output
|
The output data. |
Source code in genesis/version4/output.py
1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 | |
genesis.version4.Genesis4Output.get_array ¶
get_array(key)
Gets an array by its string alias.
For alias information, see .alias.
Returns:
| Type | Description |
|---|---|
ndarray
|
|
Source code in genesis/version4/output.py
1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 | |
genesis.version4.Genesis4Output.get_output_filename
staticmethod
¶
get_output_filename(input, workdir)
Get the output filename based on the input/run-related settings.
Source code in genesis/version4/output.py
1503 1504 1505 1506 1507 1508 1509 1510 1511 | |
genesis.version4.Genesis4Output.info ¶
info(limit=None)
Get information about available string keys for the output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int or None
|
Limit the number of items shown. |
None
|
Source code in genesis/version4/output.py
1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 | |
genesis.version4.Genesis4Output.load_field_by_key ¶
load_field_by_key(key)
Loads a single field file by name into a dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str or int
|
The label of the particles (e.g., "end" of "end.fld.h5"), or the integer integration step. |
required |
Returns:
| Type | Description |
|---|---|
FieldFile
|
|
Source code in genesis/version4/output.py
1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 | |
genesis.version4.Genesis4Output.load_fields ¶
load_fields()
Loads all field files produced.
Returns:
| Type | Description |
|---|---|
list of str
|
Key names of all loaded fields. |
Source code in genesis/version4/output.py
1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 | |
genesis.version4.Genesis4Output.load_particles ¶
load_particles(smear=True)
Loads all particle files produced.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
smear
|
bool
|
If set, for particles, this will smear the phase over the sample (skipped) slices, preserving the modulus. |
True
|
Returns:
| Type | Description |
|---|---|
list of str
|
Key names of all loaded particles. |
Source code in genesis/version4/output.py
1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 | |
genesis.version4.Genesis4Output.load_particles_by_key ¶
load_particles_by_key(key, smear=True)
Loads a single particle file into openPMD-beamphysics ParticleGroup object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str or int
|
The label of the particles (e.g., "end" of "end.par.h5"), or the integer integration step. |
required |
smear
|
bool
|
If set, will smear the phase over the sample (skipped) slices, preserving the modulus. |
True
|
Source code in genesis/version4/output.py
1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 | |
genesis.version4.Genesis4Output.load_raw_particles_by_key ¶
load_raw_particles_by_key(key)
Loads a single particle file into a raw Genesis4ParticleData object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str or int
|
The label of the particles (e.g., "end" of "end.par.h5"), or the integer integration step. |
required |
Source code in genesis/version4/output.py
1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 | |
genesis.version4.Genesis4Output.plot ¶
plot(
y="field_energy",
x="zplot",
xlim=None,
ylim=None,
ylim2=None,
yscale="linear",
yscale2="linear",
y2=(),
nice=True,
include_layout=True,
include_legend=True,
return_figure=False,
tex=False,
**kwargs,
)
Plots output multiple keys.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y
|
str or list of str
|
List of keys to be displayed on the Y axis |
'field_energy'
|
x
|
str
|
Key to be displayed as X axis |
'zplot'
|
xlim
|
list
|
Limits for the X axis |
None
|
ylim
|
list
|
Limits for the Y axis |
None
|
ylim2
|
list
|
Limits for the secondary Y axis |
None
|
yscale
|
str
|
one of "linear", "log", "symlog", "logit", ... for the Y axis |
'linear'
|
yscale2
|
str
|
one of "linear", "log", "symlog", "logit", ... for the secondary Y axis |
'linear'
|
y2
|
list
|
List of keys to be displayed on the secondary Y axis |
()
|
nice
|
bool
|
Whether or not a nice SI prefix and scaling will be used to make the numbers reasonably sized. Default: True |
True
|
include_layout
|
bool
|
Whether or not to include a layout plot at the bottom. Default: True Whether or not the plot should include the legend. Default: True |
True
|
return_figure
|
bool
|
Whether or not to return the figure object for further manipulation. Default: True |
False
|
kwargs
|
dict
|
Extra arguments can be passed to the specific plotting function. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
fig |
Figure
|
The plot figure for further customizations or |
Source code in genesis/version4/output.py
1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 | |
genesis.version4.Genesis4Output.to_hdf_summary ¶
to_hdf_summary()
Summarize the data based on HDF5 keys.
Source code in genesis/version4/output.py
1666 1667 1668 | |
genesis.version4.Genesis4Output.units ¶
units(key)
pmd_unit of a given key
Source code in genesis/version4/output.py
1779 1780 1781 1782 | |
genesis.version4.Genesis4Output.update_aliases ¶
update_aliases()
Update aliases based on available data.
Source code in genesis/version4/output.py
1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 | |
genesis.version4.output.Genesis4Output ¶
Bases: Mapping, BaseModel
Genesis 4 command output.
Attributes:
| Name | Type | Description |
|---|---|---|
run |
RunInfo
|
Execution information - e.g., how long did it take and what was the output from Genesis 4. |
alias |
dict[str, str]
|
Dictionary of aliased data keys. |
Attributes¶
genesis.version4.output.Genesis4Output.beam_globals
property
¶
beam_globals
Genesis 4 output beam global information (/Beam/Global).
genesis.version4.output.Genesis4Output.field
property
¶
field
Genesis 4 output field information (/Field) - 1st harmonic.
genesis.version4.output.Genesis4Output.field_globals
property
¶
field_globals
Genesis 4 output 1st harmonic field global information (/Field/Global).
Functions¶
genesis.version4.output.Genesis4Output.archive ¶
archive(dest, *, format='hdf5')
Dump output data into the given file or HDF5 group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dest
|
Group
|
The HDF5 file in which to write the information. |
required |
Source code in genesis/version4/output.py
1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 | |
genesis.version4.output.Genesis4Output.from_archive
classmethod
¶
from_archive(arch, *, format=None)
Loads output from archived file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arch
|
(str, Path or File)
|
The filename or handle on h5py.File from which to load data. |
required |
Source code in genesis/version4/output.py
1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 | |
genesis.version4.output.Genesis4Output.from_files
classmethod
¶
from_files(filename, load_fields=False, load_particles=False, smear=True)
Load Genesis 4 output from the given filename.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
Path or str
|
|
required |
load_fields
|
bool
|
After execution, load all field files. These are assumed to be in the same directory as the primary output filename. |
True
|
load_particles
|
bool
|
After execution, load all particle files. These are assumed to be in the same directory as the primary output filename. |
True
|
smear
|
bool
|
If set, this will smear the particle phase over the sample (skipped) slices, preserving the modulus. |
True
|
Returns:
| Type | Description |
|---|---|
Genesis4Output
|
The output data. |
Source code in genesis/version4/output.py
1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 | |
genesis.version4.output.Genesis4Output.from_input_settings
classmethod
¶
from_input_settings(input, workdir, load_fields=False, load_particles=False, smear=True)
Load Genesis 4 output based on the configured input settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
load_fields
|
bool
|
After execution, load all field files. |
False
|
load_particles
|
bool
|
After execution, load all particle files. |
False
|
smear
|
bool
|
If set, for particles, this will smear the phase over the sample (skipped) slices, preserving the modulus. |
True
|
Returns:
| Type | Description |
|---|---|
Genesis4Output
|
The output data. |
Source code in genesis/version4/output.py
1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 | |
genesis.version4.output.Genesis4Output.get_array ¶
get_array(key)
Gets an array by its string alias.
For alias information, see .alias.
Returns:
| Type | Description |
|---|---|
ndarray
|
|
Source code in genesis/version4/output.py
1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 | |
genesis.version4.output.Genesis4Output.get_output_filename
staticmethod
¶
get_output_filename(input, workdir)
Get the output filename based on the input/run-related settings.
Source code in genesis/version4/output.py
1503 1504 1505 1506 1507 1508 1509 1510 1511 | |
genesis.version4.output.Genesis4Output.info ¶
info(limit=None)
Get information about available string keys for the output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int or None
|
Limit the number of items shown. |
None
|
Source code in genesis/version4/output.py
1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 | |
genesis.version4.output.Genesis4Output.load_field_by_key ¶
load_field_by_key(key)
Loads a single field file by name into a dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str or int
|
The label of the particles (e.g., "end" of "end.fld.h5"), or the integer integration step. |
required |
Returns:
| Type | Description |
|---|---|
FieldFile
|
|
Source code in genesis/version4/output.py
1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 | |
genesis.version4.output.Genesis4Output.load_fields ¶
load_fields()
Loads all field files produced.
Returns:
| Type | Description |
|---|---|
list of str
|
Key names of all loaded fields. |
Source code in genesis/version4/output.py
1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 | |
genesis.version4.output.Genesis4Output.load_particles ¶
load_particles(smear=True)
Loads all particle files produced.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
smear
|
bool
|
If set, for particles, this will smear the phase over the sample (skipped) slices, preserving the modulus. |
True
|
Returns:
| Type | Description |
|---|---|
list of str
|
Key names of all loaded particles. |
Source code in genesis/version4/output.py
1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 | |
genesis.version4.output.Genesis4Output.load_particles_by_key ¶
load_particles_by_key(key, smear=True)
Loads a single particle file into openPMD-beamphysics ParticleGroup object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str or int
|
The label of the particles (e.g., "end" of "end.par.h5"), or the integer integration step. |
required |
smear
|
bool
|
If set, will smear the phase over the sample (skipped) slices, preserving the modulus. |
True
|
Source code in genesis/version4/output.py
1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 | |
genesis.version4.output.Genesis4Output.load_raw_particles_by_key ¶
load_raw_particles_by_key(key)
Loads a single particle file into a raw Genesis4ParticleData object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str or int
|
The label of the particles (e.g., "end" of "end.par.h5"), or the integer integration step. |
required |
Source code in genesis/version4/output.py
1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 | |
genesis.version4.output.Genesis4Output.plot ¶
plot(
y="field_energy",
x="zplot",
xlim=None,
ylim=None,
ylim2=None,
yscale="linear",
yscale2="linear",
y2=(),
nice=True,
include_layout=True,
include_legend=True,
return_figure=False,
tex=False,
**kwargs,
)
Plots output multiple keys.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y
|
str or list of str
|
List of keys to be displayed on the Y axis |
'field_energy'
|
x
|
str
|
Key to be displayed as X axis |
'zplot'
|
xlim
|
list
|
Limits for the X axis |
None
|
ylim
|
list
|
Limits for the Y axis |
None
|
ylim2
|
list
|
Limits for the secondary Y axis |
None
|
yscale
|
str
|
one of "linear", "log", "symlog", "logit", ... for the Y axis |
'linear'
|
yscale2
|
str
|
one of "linear", "log", "symlog", "logit", ... for the secondary Y axis |
'linear'
|
y2
|
list
|
List of keys to be displayed on the secondary Y axis |
()
|
nice
|
bool
|
Whether or not a nice SI prefix and scaling will be used to make the numbers reasonably sized. Default: True |
True
|
include_layout
|
bool
|
Whether or not to include a layout plot at the bottom. Default: True Whether or not the plot should include the legend. Default: True |
True
|
return_figure
|
bool
|
Whether or not to return the figure object for further manipulation. Default: True |
False
|
kwargs
|
dict
|
Extra arguments can be passed to the specific plotting function. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
fig |
Figure
|
The plot figure for further customizations or |
Source code in genesis/version4/output.py
1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 | |
genesis.version4.output.Genesis4Output.to_hdf_summary ¶
to_hdf_summary()
Summarize the data based on HDF5 keys.
Source code in genesis/version4/output.py
1666 1667 1668 | |
genesis.version4.output.Genesis4Output.units ¶
units(key)
pmd_unit of a given key
Source code in genesis/version4/output.py
1779 1780 1781 1782 | |
genesis.version4.output.Genesis4Output.update_aliases ¶
update_aliases()
Update aliases based on available data.
Source code in genesis/version4/output.py
1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 | |
Shared output information¶
genesis.version4.output._OutputBase ¶
_OutputBase(**kwargs)
Bases: BaseModel
Output model base class.
Source code in genesis/version4/output.py
155 156 157 | |
Run and general information¶
genesis.version4.output.RunInfo ¶
Bases: BaseModel
Genesis 4 run information.
Attributes:
| Name | Type | Description |
|---|---|---|
error |
bool
|
True if an error occurred during the Genesis run. |
error_reason |
str or None
|
Error explanation, if |
run_script |
str
|
The command-line arguments used to run Genesis |
output_log |
str
|
Genesis 4 output log |
start_time |
float
|
Start time of the process |
end_time |
float
|
End time of the process |
run_time |
float
|
Wall clock run time of the process |
genesis.version4.output.OutputGlobal ¶
OutputGlobal(**kwargs)
Bases: _OutputBase
Global information from Genesis 4 output. (HDF5 /Global)
Source code in genesis/version4/output.py
155 156 157 | |
Field information¶
genesis.version4.output.FieldFile ¶
Bases: BaseModel
Attributes¶
genesis.version4.output.FieldFile.hdf5_filename
property
¶
hdf5_filename
The label-based HDF5 filename which Genesis would write.
For a label of 'end' this would be 'end.fld.h5'.
Returns:
| Type | Description |
|---|---|
str
|
|
Functions¶
genesis.version4.output.FieldFile.from_file
classmethod
¶
from_file(file)
Load a single Genesis 4-format field file (*.fld.h5).
Returns:
| Type | Description |
|---|---|
FieldFile
|
|
Source code in genesis/version4/field.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
genesis.version4.output.FieldFile.to_wavefront ¶
to_wavefront()
Access this field data as an OpenPMD-beamphysics Wavefront.
Source code in genesis/version4/field.py
69 70 71 72 73 74 75 76 77 78 79 | |
genesis.version4.output.FieldFile.write_genesis4 ¶
write_genesis4(dest)
Write field data from memory to a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dest
|
(File, str or Path)
|
Destination to write to. May be an open HDF5 file handle or a filename. |
required |
Source code in genesis/version4/field.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
genesis.version4.output.FieldFile.write_openpmd_wavefront ¶
write_openpmd_wavefront(dest, verbose=True)
Write the field file information to the given HDF5 file in OpenPMD-wavefront format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dest
|
str, pathlib.Path, or h5py.Group
|
Filename or already-open h5py.Group to write to. |
required |
Source code in genesis/version4/field.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
genesis.version4.output.OutputFieldStat ¶
OutputFieldStat(*args, **kwargs)
Bases: _OutputBase
Calculated output field statistics. Mean field position and size.
Source code in genesis/version4/output.py
1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 | |
Functions¶
genesis.version4.output.OutputFieldStat.from_output_field
classmethod
¶
from_output_field(field)
Calculate all statistics given an OutputField instance.
Source code in genesis/version4/output.py
1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 | |
genesis.version4.output.OutputFieldGlobal ¶
OutputFieldGlobal(*args, **kwargs)
Bases: _OutputBase
Field-global information from Genesis 4 output. (HDF5 /Field/Global)
Source code in genesis/version4/output.py
1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 | |
genesis.version4.output.OutputField ¶
OutputField(*args, slen=None, **kwargs)
Bases: _OutputBase
Source code in genesis/version4/output.py
1222 1223 1224 1225 1226 1227 1228 | |
Attributes¶
genesis.version4.output.OutputField.stat
cached
property
¶
stat
Calculate statistics for the field.
Returns None if the field data is malformed and no statistics
are available.
Functions¶
genesis.version4.output.OutputField.calculate_field_energy ¶
calculate_field_energy(slen)
Calculate field energy, given global slen.
Source code in genesis/version4/output.py
1238 1239 1240 1241 1242 1243 1244 1245 | |
Lattice information¶
genesis.version4.output.OutputLattice ¶
OutputLattice(**kwargs)
Bases: _OutputBase
Genesis 4 lattice output information (HDF5 Group "/Lattice").
Array indices are per step of the simulation, which relates to the Z position.
The undulator strength, quadrupole field and other are resolved with the
resolution of the requested integration step size, which is given in the
dataset .dz.
For the z-position there are two datasets. The regular one .z has the same
length and describes the lattice quantities from the position .z[i] to
.z[i]+.dz[i] of the integration step i. The dataset .zplot is
used for plotting the beam or field parameters along the undulator.
Note that those are evaluated before the integration started, so that there can be one more entry than the lattice datasets. Also if the output is reduced by the output step option in the tracking command, the length of zplot is shorter because it has to match the length of the beam and field parameters.
Source code in genesis/version4/output.py
155 156 157 | |
Functions¶
genesis.version4.output.OutputLattice.plot ¶
plot(ax=None)
Plot the lattice \(aw\) and \(qf\) versus \(z\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ax
|
Axes
|
The axes to insert the plot. If not specified, a new plot will be generated. |
None
|
Returns:
| Type | Description |
|---|---|
Axes
|
|
Source code in genesis/version4/output.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | |
Beam information¶
genesis.version4.output.OutputBeamStat ¶
OutputBeamStat(**kwargs)
Bases: _OutputBase
Output Beam statistics, based on HDF5 /Beam.
These are calculated for you by LUME-Genesis.
Source code in genesis/version4/output.py
155 156 157 | |
Functions¶
genesis.version4.output.OutputBeamStat.calculate_bunching
staticmethod
¶
calculate_bunching(current, bunching, bunchingphase)
Calculate bunching, following this formula:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current
|
ndarray
|
|
required |
bunching
|
ndarray
|
|
required |
bunchingphase
|
ndarray
|
|
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
|
Source code in genesis/version4/output.py
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 | |
genesis.version4.output.OutputBeamStat.calculate_projected_sigma
staticmethod
¶
calculate_projected_sigma(current, position, size)
Calculate projected sigma.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current
|
ndarray
|
1D current array. |
required |
position
|
ndarray
|
2D |
required |
size
|
ndarray
|
2D |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
|
Source code in genesis/version4/output.py
519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 | |
genesis.version4.output.OutputBeamStat.from_output_beam
classmethod
¶
from_output_beam(beam)
Calculate all statistics given an OutputBeam instance.
Source code in genesis/version4/output.py
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 | |
genesis.version4.output.OutputBeamGlobal ¶
OutputBeamGlobal(*args, **kwargs)
Bases: _OutputBase
Output beam global information. (HDF5 /Beam/Global)
Source code in genesis/version4/output.py
671 672 673 674 675 676 677 678 679 | |
genesis.version4.output.OutputBeam ¶
OutputBeam(**kwargs)
Bases: _OutputBase
Output beam information. (HDF5 /Beam)
Source code in genesis/version4/output.py
155 156 157 | |
Metadata¶
genesis.version4.output.OutputMetaDumps ¶
OutputMetaDumps(**kwargs)
Bases: _OutputBase
Dump-related output information. (HDF5 /Meta/*dumps)
Source code in genesis/version4/output.py
871 872 873 874 875 876 877 878 | |
genesis.version4.output.OutputMetaVersion ¶
OutputMetaVersion(**kwargs)
Bases: _OutputBase
Version information from Genesis 4 output. (HDF5 /Meta/Version)
Source code in genesis/version4/output.py
155 156 157 | |
genesis.version4.output.OutputMeta ¶
OutputMeta(**kwargs)
Bases: _OutputBase
Meta information from Genesis 4 output. (HDF5 /Meta)
Source code in genesis/version4/output.py
155 156 157 | |