at.lattice.deprecated#

Functions

get_cells(...)

Returns a bool array of element indices, selecting ring elements.

get_refpts(ring, refpts[, regex])

Return a uint32 array of element indices selecting ring elements.

get_cells(ring, filtfunc) BoolRefpts[source]#
get_cells(ring, element_type) BoolRefpts
get_cells(ring, attrname) BoolRefpts
get_cells(ring, attrname, attrvalue) BoolRefpts

Returns a bool array of element indices, selecting ring elements.

Deprecated: get_cells(ring, refpts) is ring.bool_refpts(refpts) except for str arguments: get_cells(ring, attrname [, attrvalue]) is ring.bool_refpts(checkattr(strkey [, attrvalue]))

Parameters:
  • ring (Sequence[Element]) – Lattice description

  • filtfunc (ElementFilter) – Filter function. Selects Elements satisfying the filter function

  • element_type (Type[Element]) – Element type

  • attrname (str) – Attribute name

  • attrvalue (Any) – Attribute value. If absent, select the presence of an attrname attribute. If present, select Elements with attrname == attrvalue.

  • regex – Use regular expression for refpts string matching; Default: False (Unix shell-style wildcards)

Returns:

bool_refs (BoolRefpts) – numpy Array of bool with length len(ring)+1

Examples

>>> refpts = get_cells(ring, 'Frequency')

Returns a numpy array of booleans where all elements having a Frequency attribute are True

>>> refpts = get_cells(ring, 'K', 0.0)

Returns a numpy array of booleans where all elements having a K attribute equal to 0.0 are True

get_refpts(ring, refpts, regex=False)[source]#

Return a uint32 array of element indices selecting ring elements.

Deprecated: get_elements(ring, refpts) is ring.uint32_refpts(refpts)

Parameters:
Returns:

uint32_refs (Uint32Refs) – uint32 numpy array as long as the number of refpts