Parsing original Genesis lattice into a standard lattice¶
In [ ]:
Copied!
from genesis import parsers, lattice
from genesis import parsers, lattice
In [ ]:
Copied!
# Read a raw genesis-style lattice as elements and parameters
genesis_lat = "data/lcls.lat"
lat = parsers.parse_genesis_lattice(genesis_lat)
lat.keys()
# Read a raw genesis-style lattice as elements and parameters
genesis_lat = "data/lcls.lat"
lat = parsers.parse_genesis_lattice(genesis_lat)
lat.keys()
In [ ]:
Copied!
?lattice.standard_eles_from_eles
?lattice.standard_eles_from_eles
In [ ]:
Copied!
# Form a standard lattice from these
lat["eles"] = lattice.standard_eles_from_eles(lat["eles"])
lat["eles"][:10]
# Form a standard lattice from these
lat["eles"] = lattice.standard_eles_from_eles(lat["eles"])
lat["eles"][:10]
In [ ]:
Copied!
# Invent names for these
lattice.create_names(lat["eles"])
lat["eles"][:10]
# Invent names for these
lattice.create_names(lat["eles"])
lat["eles"][:10]
In [ ]:
Copied!
# Form original Genesis lattice
lines = lattice.genesis_lattice_from_standard_lattice(lat)
print("\n".join(lines))
# Form original Genesis lattice
lines = lattice.genesis_lattice_from_standard_lattice(lat)
print("\n".join(lines))