Functions | |
def | nodes_by_type (G, typename) |
def | neighbors_by_type (G, seed, typename, radius=1) |
def | neighbors_by_path (G, seed, typenamepath) |
def | child_by_path (G, seed, edgepath) |
def | parent (G, child, parent_type) |
def | flatten_to_conductor (G, channel_hash) |
this assumes a particular hashing scheme. More... | |
def | to_celltree_wires (G, channel_ident, face='face0') |
def | to_schema (G, P, channel_ident) |
def | wires_in_plane (G, plane) |
def | wires_in_chip (G, chip, intermediates=False) |
def | wires_graph (G, wires) |
def | conductors_graph (G, conductors) |
Do fun stuff to a connectivity graph
def wirecell.util.wires.graph.child_by_path | ( | G, | |
seed, | |||
edgepath | |||
) |
Return a child by walking an "edgepath" from a seed node. The edgepath is a list of triples: >>> [(typename, attrname, attrval), ...] Where `typename` is the node type for the step in the path and `attrname` and `attrval` give a name/value for an edge attribute which must join current node with next node.
Definition at line 39 of file graph.py.
def wirecell.util.wires.graph.conductors_graph | ( | G, | |
conductors | |||
) |
Like wires graph but swap sign of the 2D "X" (3D "Z") coordinates so a conductor zig-zags across a transparent frame.
Definition at line 295 of file graph.py.
def wirecell.util.wires.graph.flatten_to_conductor | ( | G, | |
channel_hash | |||
) |
this assumes a particular hashing scheme.
def channel_node(G, addrhash): ''' Return channel node associated with address hash ''' a = str(addrhash) iconn,islot,ichip,iaddr = [int(n)-1 for n in [a[0], a[1], a[2], a[3:5]]] edgepath = [ ('wib', 'slot', islot), ('board', 'connector', iconn), ('chip', 'spot', ichip), ('channel', 'address', iaddr) ]
return child_by_path(G, 'apa', edgepath)
Flatten the graph to the conductor level. The channel_hash is a callable like apa.channel_hash().
Definition at line 94 of file graph.py.
def wirecell.util.wires.graph.neighbors_by_path | ( | G, | |
seed, | |||
typenamepath | |||
) |
Return all neighbor nodes by following a path of type names from given seed.
Definition at line 26 of file graph.py.
def wirecell.util.wires.graph.neighbors_by_type | ( | G, | |
seed, | |||
typename, | |||
radius = 1 |
|||
) |
Return a set of all neighbor nodes withing given radius of seed which are of the given typename.
Definition at line 16 of file graph.py.
def wirecell.util.wires.graph.nodes_by_type | ( | G, | |
typename | |||
) |
def wirecell.util.wires.graph.parent | ( | G, | |
child, | |||
parent_type | |||
) |
def wirecell.util.wires.graph.to_celltree_wires | ( | G, | |
channel_ident, | |||
face = 'face0' |
|||
) |
Return list of tuples: (ch, plane, wip, sx, sy, sz, ex, ey, ez) corresponding to rows in the "ChannelWireGeometry" file used by https://github.com/bnlif/wire-cell-celltree for the wires in the given face. Note: this only returns the one face of wires but channel numbers are calculated with full knowledge of wrapped wires.
Definition at line 148 of file graph.py.
def wirecell.util.wires.graph.to_schema | ( | G, | |
P, | |||
channel_ident | |||
) |
Return a wirecell.util.wires.schema store filled with information from connection graph G starting from given face.
Definition at line 186 of file graph.py.
def wirecell.util.wires.graph.wires_graph | ( | G, | |
wires | |||
) |
Return a new graph with wire endpoints as nodes and a dictionary of 2D points
Definition at line 278 of file graph.py.
def wirecell.util.wires.graph.wires_in_chip | ( | G, | |
chip, | |||
intermediates = False |
|||
) |
Return set of wire nodes connected to a chip node. If intermediates is true, return the conductor and channel nodes that form the connection to the wires.
Definition at line 257 of file graph.py.
def wirecell.util.wires.graph.wires_in_plane | ( | G, | |
plane | |||
) |
Return set of wire nodes connected to the given plane node.
Definition at line 251 of file graph.py.