podpac.coordinates.ArrayCoordinates1d

class podpac.coordinates.ArrayCoordinates1d(coordinates, name=None)[source]

Bases: podpac.core.coordinates.coordinates1d.Coordinates1d

1-dimensional array of coordinates.

ArrayCoordinates1d is a basic array of 1d coordinates created from an array of coordinate values. Numerical coordinates values are converted to float, and time coordinate values are converted to numpy datetime64. For convenience, podpac automatically converts datetime strings such as '2018-01-01' to datetime64. The coordinate values must all be of the same type.

Parameters
  • name (str) – Dimension name, one of ‘lat’, ‘lon’, ‘time’, or ‘alt’.

  • coordinates (array, read-only) – Full array of coordinate values.

Alternative Constructors

from_definition(d)

Create 1d coordinates from a coordinates definition.

from_xarray(x, **kwargs)

Create 1d Coordinates from named xarray coordinates.

Methods

__init__(coordinates[, name])

Create 1d coordinates from an array.

copy()

Make a deep copy of the 1d Coordinates array.

get_area_bounds(boundary)

Get low and high coordinate area bounds.

issubset(other)

Report whether other coordinates contains these coordinates.

select(bounds[, return_indices, outer])

Get the coordinate values that are within the given bounds.

simplify()

Get the simplified/optimized representation of these coordinates.

Attributes

argbounds

bounds

Low and high coordinate bounds.

coordinates

A coercing numpy array trait.

coords

xarray coordinates (container of coordinate arrays)

definition

Serializable 1d coordinates definition.

deltatype

dims

dtype

Coordinates dtype.

full_definition

Serializable 1d coordinates definition, containing all properties.

idims

is_descending

is_monotonic

is_uniform

name

properties

Dictionary of the coordinate properties.

shape

size

Number of coordinates.

start

step

stop

udims

Members

__init__(coordinates, name=None)[source]

Create 1d coordinates from an array.

Parameters
  • coordinates (array-like) – coordinate values.

  • name (str, optional) – Dimension name, one of ‘lat’, ‘lon’, ‘time’, or ‘alt’.

property argbounds
property bounds

Low and high coordinate bounds.

coordinates

A coercing numpy array trait.

copy()[source]

Make a deep copy of the 1d Coordinates array.

Returns

Copy of the coordinates.

Return type

ArrayCoordinates1d

property dtype

Coordinates dtype.

float for numerical coordinates and numpy datetime64 for datetime coordinates.

Type

type

classmethod from_definition(d)[source]

Create 1d coordinates from a coordinates definition.

The definition must contain the coordinate values:

c = ArrayCoordinates1d.from_definition({
    "values": [0, 1, 2, 3]
})

The definition may also contain any of the 1d Coordinates properties:

c = ArrayCoordinates1d.from_definition({
    "values": [0, 1, 2, 3],
    "name": "lat"
})
Parameters

d (dict) – 1d coordinates array definition

Returns

1d Coordinates

Return type

ArrayCoordinates1d

See also

definition()

classmethod from_xarray(x, **kwargs)[source]

Create 1d Coordinates from named xarray coordinates.

Parameters

x (xarray.DataArray) – Nade DataArray of the coordinate values

Returns

1d coordinates

Return type

ArrayCoordinates1d

property is_descending
property is_monotonic
property is_uniform
simplify()[source]

Get the simplified/optimized representation of these coordinates.

Returns

simplified – UniformCoordinates1d if the coordinates are uniform, otherwise ArrayCoordinates1d

Return type

ArrayCoordinates1d, UniformCoordinates1d

property size

Number of coordinates.

property start
property step
property stop