podpac.coordinates.GroupCoordinates

class podpac.coordinates.GroupCoordinates(coords_list)[source]

Bases: traitlets.traitlets.HasTraits

List of multi-dimensional Coordinates.

GroupCoordinates contains a list of Coordinates containing the same set of unstacked dimensions.

The GroupCoordinates object is list-like and can be indexed, appended, looped, etc like a standard list. The following Coordinates methods are wrapped for convenience:

Parameters

udims (tuple) – Tuple of shared dimensions.

Alternative Constructors

from_definition(d)

Create a Coordinates group from a group definition.

from_json(s)

Create a Coordinates group from a group JSON definition.

Methods

__init__(coords_list)

Create a Coordinates group.

append(c)

Append Coordinates to the group.

intersect(other[, outer, return_indices])

Intersect each Coordinates in the group with the given coordinates.

Attributes

definition

Serializable coordinates group definition.

hash

GroupCoordinates hash.

json

Serialized coordinates group definition.

udims

Tuple of shared dimensions.

Members

__init__(coords_list)[source]

Create a Coordinates group.

Parameters

coords_list (list) – list of Coordinates

append(c)[source]

Append Coordinates to the group.

Parameters

c (Coordinates) – Coordinates to append.

definition

Serializable coordinates group definition.

The definition can be used to create new GroupCoordinates:

g = podpac.GroupCoordinates([...])
g2 = podpac.GroupCoordinates.from_definition(g.definition)

See also

from_definition, json

classmethod from_definition(d)[source]

Create a Coordinates group from a group definition.

Parameters

d (list) – group definition

Returns

Coordinates group

Return type

CoordinatesGroup

classmethod from_json(s)[source]

Create a Coordinates group from a group JSON definition.

Parameters

s (str) – group JSON definition

Returns

Coordinates group

Return type

CoordinatesGroup

See also

json()

hash

GroupCoordinates hash.

Note: To be replaced with the __hash__ method.

intersect(other, outer=False, return_indices=False)[source]

Intersect each Coordinates in the group with the given coordinates.

Parameters
  • other (Coordinates1d, StackedCoordinates, Coordinates) – Coordinates to intersect with.

  • outer (bool, optional) – If True, do an outer intersection. Default False.

  • return_indices (bool, optional) – If True, return slice or indices for the selection in addition to coordinates. Default False.

Returns

  • intersections (GroupCoordinates) – Coordinates group consisting of the intersection of each Coordinates.

  • idx (list) – List of lists of indices for each Coordinates item, only if return_indices is True.

json

Serialized coordinates group definition.

The definition can be used to create new GroupCoordinates:

g = podpac.GroupCoordinates(...)
g2 = podpac.GroupCoordinates.from_json(g.json)

See also

json

udims

Tuple of shared dimensions.

Type

tuple