Transpose

class of dascore.proc.coords
inherits from: PatchProcessor, DascoreBaseModel, pydantic.main.BaseModel
source

Transpose(
    *args ,
    dims: tuple[Any, …] = (),
)-> None

Transpose the data array to any dimension order desired.

Parameters

Parameter Description
*dims Dimension names which define the new data axis order.
Can also include … to indicate dimensions that should be left
alone.

Examples

import dascore # import dascore library
pa = dascore.get_example_patch() # generate example patch

# Transpose the time and data array dimensions in the example patch
out = pa.transpose("time", "distance")

# Set "distance" as the last dimension
out = pa.transpose(..., "distance")

# Set distance as the first dimension.
out = pa.transpose("distance", ...)

Methods

Name Description
check Refuse a patch which does not carry what the operation needs.
derive Return the coordinates in their new order; the input if unchanged.
kernel Return the data with its axes permuted, or as it was.
new Create new instance with some attributed updated.
transpose Transpose the data array to any dimension order desired.
plan Return the permutation from the old axis order to the new.
reconcile Return the result’s metadata once the data are known; default as is.
run Run the operation: check, derive, plan, kernel, reconcile, record.