AccLattice#

class orbit.lattice.AccLattice(name='no name')[source]#

Bases: orbit.utils.NamedObject.NamedObject, orbit.utils.TypedObject.TypedObject

Class. The accelerator lattice class contains child nodes.

Attributes Summary

AFTER

BEFORE

BODY

ENTRANCE

EXIT

Methods Summary

addNode(node[, index])

Method.

getLength()

Method.

getNodeForName(name)

Method.

getNodeIndex(node)

Method.

getNodePositionsDict()

Method.

getNodes()

Method.

getNodesForName(name)

Method.

getNodesForSubstring(sub[, no_sub])

Method.

getNodesOfClass(class_of_node)

Method.

getSubLattice([index_start, index_stop])

It returns the sub-accelerator lattice with children with indexes between index_start and index_stop inclusive.

initialize()

Method.

isInitialized()

Method.

reverseOrder()

This method is used for a lattice reversal and a bunch backtracking.

setNodes(childrenNodes)

Method.

structureToText()

Returns the text with the lattice structure.

trackActions(actionsContainer[, paramsDict, ...])

Method.

Attributes Documentation

AFTER = 1#
BEFORE = 0#
BODY = 1#
ENTRANCE = 0#
EXIT = 2#

Methods Documentation

addNode(node, index=- 1)[source]#

Method. Adds a child node into the lattice. If the user specifies the index >= 0 the element will be inserted in the specified position into the children array

getLength()[source]#

Method. Returns the physical length of the lattice.

getNodeForName(name)[source]#

Method. Returns the node with certain name.

getNodeIndex(node)[source]#

Method. Returns the index of the node in the upper level of the lattice children-nodes.

getNodePositionsDict()[source]#

Method. Returns a dictionary of {node:(start position, stop position)} tuples for all children of the first level in the lattice.

getNodes()[source]#

Method. Returns a list of all children of the first level in the lattice.

getNodesForName(name)[source]#

Method. Returns nodes with a certain name.

getNodesForSubstring(sub, no_sub=None)[source]#

Method. Returns nodes with names each of them has the certain substring. It is also possible to specify the unwanted substring as no_sub parameter.

getNodesOfClass(class_of_node)[source]#

Method. Returns nodes off a certain class.

getSubLattice(index_start=- 1, index_stop=- 1)[source]#

It returns the sub-accelerator lattice with children with indexes between index_start and index_stop inclusive. The subclasses of AccLattice should override this method to replace AccLattice() constructor by the sub-class type constructor

initialize()[source]#

Method. Initializes the lattice and child node structures.

isInitialized()[source]#

Method. Returns the initialization status (True or False).

reverseOrder()[source]#

This method is used for a lattice reversal and a bunch backtracking. This method will reverse the order of the children nodes. It will apply the reverse recursively to the all children nodes.

setNodes(childrenNodes)[source]#

Method. Set up a new list of all children of the first level in the lattice.

structureToText()[source]#

Returns the text with the lattice structure.

trackActions(actionsContainer, paramsDict={}, index_start=- 1, index_stop=- 1)[source]#

Method. Tracks the actions through all nodes in the lattice. The indexes are inclusive.