StokesVector

class kgpy.optics.vectors.StokesVector(i=<Quantity 1.>, q=<Quantity 0.>, u=<Quantity 0.>, v=<Quantity 0.>)

Bases: AbstractVector

Parameters:
__init__(i=<Quantity 1.>, q=<Quantity 0.>, u=<Quantity 0.>, v=<Quantity 0.>)
Parameters:
Return type:

None

Attributes

array

array_labeled

broadcasted

centers

component_sum

components

coordinates

dtype

i

indices

length

ndim

normalize

normalized

q

shape

tuple

type_coordinates

type_matrix

u

unit

v

Methods

__init__([i, q, u, v])

add_axes(axes)

rtype:

typing.TypeVar(VectorInterfaceT, bound= VectorInterface)

aligned(shape)

rtype:

typing.TypeVar(AbstractVectorT, bound= AbstractVector)

all([axis, where])

rtype:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

any([axis, where])

rtype:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

astype(dtype[, order, casting, subok, copy])

rtype:

typing.TypeVar(VectorInterfaceT, bound= VectorInterface)

broadcast_to(shape)

rtype:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

combine_axes(axes[, axis_new])

rtype:

typing.TypeVar(VectorInterfaceT, bound= VectorInterface)

copy()

rtype:

typing.TypeVar(CopyableT, bound= Copyable)

copy_shallow()

rtype:

typing.TypeVar(CopyableT, bound= Copyable)

from_coordinates(coordinates)

rtype:

typing.TypeVar(AbstractVectorT, bound= AbstractVector)

index(value[, axis])

rtype:

typing.Dict[str, typing.TypeVar(ArrayInterfaceT, bound= ArrayInterface)]

index_below_brute(value[, axis])

rtype:

typing.Dict[str, typing.TypeVar(ArrayInterfaceT, bound= ArrayInterface)]

index_nearest_brute(value[, axis, where])

rtype:

typing.Dict[str, typing.TypeVar(ArrayInterfaceT, bound= ArrayInterface)]

index_nearest_secant(value[, axis])

rtype:

typing.Dict[str, kgpy.labeled.Array]

index_secant(value[, axis, damping])

rtype:

typing.Dict[str, typing.TypeVar(ArrayT, bound= Array)]

interp_linear(item)

linear_space(start, stop, num[, endpoint])

rtype:

typing.TypeVar(AbstractVectorT, bound= AbstractVector)

max([axis, initial, where])

rtype:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

mean([axis, where])

rtype:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

min([axis, initial, where])

rtype:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

ndindex([axis_ignored])

rtype:

typing.Iterator[typing.Dict[str, int]]

outer(other)

rtype:

typing.TypeVar(AbstractMatrixT, bound= AbstractMatrix)

plot(ax, axis_plot, **kwargs)

rtype:

typing.List[matplotlib.lines.Line2D]

plot_filled(ax, axis_plot, **kwargs)

rtype:

typing.List[matplotlib.patches.Polygon]

prototype()

rtype:

typing.Type[typing.TypeVar(AbstractVectorT, bound= AbstractVector)]

ptp([axis])

rtype:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

reshape(shape)

rtype:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

rms([axis, where])

rtype:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

std([axis, where])

rtype:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

stratified_random_space(start, stop, num, axis)

rtype:

typing.TypeVar(AbstractVectorT, bound= AbstractVector)

sum([axis, where])

rtype:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

to(unit)

rtype:

typing.TypeVar(AbstractVectorT, bound= AbstractVector)

to_matrix()

rtype:

typing.TypeVar(AbstractMatrixT, bound= AbstractMatrix)

Inheritance Diagram

digraph inheritance5ec49b61a1 { bgcolor=transparent; rankdir=TB; size="8.0, 12.0"; "abc.ABC" [URL="https://docs.python.org/3/library/abc.html#abc.ABC",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Helper class that provides a standard way to create an ABC using"]; "kgpy.labeled.ArrayInterface" [URL="kgpy.labeled.ArrayInterface.html#kgpy.labeled.ArrayInterface",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="ArrayInterface()"]; "kgpy.mixin.Copyable" -> "kgpy.labeled.ArrayInterface" [arrowsize=0.5,style="setlinewidth(0.5)"]; "kgpy.labeled.NDArrayMethodsMixin" -> "kgpy.labeled.ArrayInterface" [arrowsize=0.5,style="setlinewidth(0.5)"]; "numpy.lib.mixins.NDArrayOperatorsMixin" -> "kgpy.labeled.ArrayInterface" [arrowsize=0.5,style="setlinewidth(0.5)"]; "abc.ABC" -> "kgpy.labeled.ArrayInterface" [arrowsize=0.5,style="setlinewidth(0.5)"]; "typing.Generic" -> "kgpy.labeled.ArrayInterface" [arrowsize=0.5,style="setlinewidth(0.5)"]; "kgpy.labeled.NDArrayMethodsMixin" [URL="kgpy.labeled.NDArrayMethodsMixin.html#kgpy.labeled.NDArrayMethodsMixin",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="NDArrayMethodsMixin()"]; "kgpy.mixin.Copyable" [URL="kgpy.mixin.Copyable.html#kgpy.mixin.Copyable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "abc.ABC" -> "kgpy.mixin.Copyable" [arrowsize=0.5,style="setlinewidth(0.5)"]; "kgpy.optics.vectors.StokesVector" [URL="kgpy.optics.vectors.StokesVector.html#kgpy.optics.vectors.StokesVector",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="StokesVector(i: 'kgpy.uncertainty.ArrayLike' = <Quantity 1.>, q: 'kgpy.uncertainty.ArrayLike' = <Quantity 0.>, u: 'kgpy.uncertainty.ArrayLike' = <Quantity 0.>, v: 'kgpy.uncertainty.ArrayLike' = <Quantity 0.>)"]; "kgpy.vectors.AbstractVector" -> "kgpy.optics.vectors.StokesVector" [arrowsize=0.5,style="setlinewidth(0.5)"]; "kgpy.vectors.AbstractVector" [URL="kgpy.vectors.AbstractVector.html#kgpy.vectors.AbstractVector",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="AbstractVector()"]; "kgpy.vectors.VectorInterface" -> "kgpy.vectors.AbstractVector" [arrowsize=0.5,style="setlinewidth(0.5)"]; "kgpy.vectors.VectorInterface" [URL="kgpy.vectors.VectorInterface.html#kgpy.vectors.VectorInterface",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="VectorInterface()"]; "kgpy.labeled.ArrayInterface" -> "kgpy.vectors.VectorInterface" [arrowsize=0.5,style="setlinewidth(0.5)"]; "numpy.lib.mixins.NDArrayOperatorsMixin" [URL="https://numpy.org/doc/stable/reference/generated/numpy.lib.mixins.NDArrayOperatorsMixin.html#numpy.lib.mixins.NDArrayOperatorsMixin",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mixin defining all operator special methods using __array_ufunc__."]; "typing.Generic" [URL="https://docs.python.org/3/library/typing.html#typing.Generic",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Abstract base class for generic types."]; }
add_axes(axes)
Return type:

typing.TypeVar(VectorInterfaceT, bound= VectorInterface)

Parameters:
  • self (VectorInterfaceT) –

  • axes (List) –

aligned(shape)
Return type:

typing.TypeVar(AbstractVectorT, bound= AbstractVector)

Parameters:
  • self (VectorInterfaceT) –

  • shape (Dict[str, int]) –

all(axis=None, where=<no value>)
Return type:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

Parameters:
  • self (NDArrayMethodsMixinT) –

  • axis (str | Sequence[str] | None) –

  • where (NDArrayMethodsMixinT) –

any(axis=None, where=<no value>)
Return type:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

Parameters:
  • self (NDArrayMethodsMixinT) –

  • axis (str | Sequence[str] | None) –

  • where (NDArrayMethodsMixinT) –

astype(dtype, order='K', casting='unsafe', subok=True, copy=True)
Return type:

typing.TypeVar(VectorInterfaceT, bound= VectorInterface)

Parameters:
broadcast_to(shape)
Return type:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

Parameters:
  • self (NDArrayMethodsMixinT) –

  • shape (Dict[str, int]) –

combine_axes(axes, axis_new=None)
Return type:

typing.TypeVar(VectorInterfaceT, bound= VectorInterface)

Parameters:
  • self (VectorInterfaceT) –

  • axes (Sequence[str]) –

  • axis_new (str | None) –

copy()
Return type:

typing.TypeVar(CopyableT, bound= Copyable)

Parameters:

self (CopyableT) –

copy_shallow()
Return type:

typing.TypeVar(CopyableT, bound= Copyable)

Parameters:

self (CopyableT) –

classmethod from_coordinates(coordinates)
Return type:

typing.TypeVar(AbstractVectorT, bound= AbstractVector)

Parameters:

coordinates (Dict[str, int | float | ndarray | Quantity | AbstractArray | AbstractArray | VectorInterface]) –

index(value, axis=None)
Return type:

typing.Dict[str, typing.TypeVar(ArrayInterfaceT, bound= ArrayInterface)]

Parameters:
  • self (ArrayInterfaceT) –

  • value (ArrayInterfaceT) –

  • axis (str | Sequence[str] | None) –

index_below_brute(value, axis=None)
Return type:

typing.Dict[str, typing.TypeVar(ArrayInterfaceT, bound= ArrayInterface)]

Parameters:
  • self (ArrayInterfaceT) –

  • value (ArrayInterfaceT) –

  • axis (str | Sequence[str] | None) –

index_nearest_brute(value, axis=None, where=None)
Return type:

typing.Dict[str, typing.TypeVar(ArrayInterfaceT, bound= ArrayInterface)]

Parameters:
  • self (ArrayInterfaceT) –

  • value (ArrayInterfaceT) –

  • axis (str | Sequence[str] | None) –

  • where (ArrayInterfaceT | None) –

index_nearest_secant(value, axis=None)
Return type:

typing.Dict[str, kgpy.labeled.Array]

Parameters:
  • self (AbstractVectorT) –

  • value (AbstractVectorT) –

  • axis (str | Sequence[str] | None) –

index_secant(value, axis=None, damping=1)
Return type:

typing.Dict[str, typing.TypeVar(ArrayT, bound= Array)]

Parameters:
  • self (ArrayInterfaceT) –

  • value (ArrayInterfaceT) –

  • axis (str | Sequence[str] | None) –

  • damping (float) –

interp_linear(item)
Parameters:
classmethod linear_space(start, stop, num, endpoint=True)
Return type:

typing.TypeVar(AbstractVectorT, bound= AbstractVector)

Parameters:
  • start (AbstractVectorT) –

  • stop (AbstractVectorT) –

  • num (AbstractVectorT) –

  • endpoint (bool) –

max(axis=None, initial=None, where=<no value>)
Return type:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

Parameters:
mean(axis=None, where=<no value>)
Return type:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

Parameters:
  • self (NDArrayMethodsMixinT) –

  • axis (str | Sequence[str] | None) –

  • where (NDArrayMethodsMixinT) –

min(axis=None, initial=None, where=<no value>)
Return type:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

Parameters:
ndindex(axis_ignored=None)
Return type:

typing.Iterator[typing.Dict[str, int]]

Parameters:
outer(other)
Return type:

typing.TypeVar(AbstractMatrixT, bound= AbstractMatrix)

Parameters:
  • self (AbstractVectorT) –

  • other (AbstractVectorT) –

plot(ax, axis_plot, **kwargs)
Return type:

typing.List[matplotlib.lines.Line2D]

Parameters:
  • self (AbstractVectorT) –

  • ax (Axes) –

  • axis_plot (str) –

  • kwargs (Any) –

plot_filled(ax, axis_plot, **kwargs)
Return type:

typing.List[matplotlib.patches.Polygon]

Parameters:
  • self (AbstractVectorT) –

  • ax (Axes) –

  • axis_plot (str) –

  • kwargs (Any) –

classmethod prototype()
Return type:

typing.Type[typing.TypeVar(AbstractVectorT, bound= AbstractVector)]

ptp(axis=None)
Return type:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

Parameters:
  • self (NDArrayMethodsMixinT) –

  • axis (str | Sequence[str] | None) –

reshape(shape)
Return type:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

Parameters:
  • self (NDArrayMethodsMixinT) –

  • shape (Dict[str, int]) –

rms(axis=None, where=<no value>)
Return type:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

Parameters:
  • self (NDArrayMethodsMixinT) –

  • axis (str | Sequence[str] | None) –

  • where (NDArrayMethodsMixinT) –

std(axis=None, where=<no value>)
Return type:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

Parameters:
  • self (NDArrayMethodsMixinT) –

  • axis (str | Sequence[str] | None) –

  • where (NDArrayMethodsMixinT) –

classmethod stratified_random_space(start, stop, num, axis, endpoint=True, shape_extra=None)
Return type:

typing.TypeVar(AbstractVectorT, bound= AbstractVector)

Parameters:
  • start (AbstractVectorT) –

  • stop (AbstractVectorT) –

  • num (AbstractVectorT) –

  • axis (AbstractVectorT) –

  • endpoint (bool) –

  • shape_extra (Dict[str, int] | None) –

sum(axis=None, where=<no value>)
Return type:

typing.TypeVar(NDArrayMethodsMixinT, bound= NDArrayMethodsMixin)

Parameters:
  • self (NDArrayMethodsMixinT) –

  • axis (str | Sequence[str] | None) –

  • where (NDArrayMethodsMixinT) –

to(unit)
Return type:

typing.TypeVar(AbstractVectorT, bound= AbstractVector)

Parameters:
  • self (AbstractVectorT) –

  • unit (UnitBase) –

to_matrix()
Return type:

typing.TypeVar(AbstractMatrixT, bound= AbstractMatrix)

Parameters:

self (AbstractVectorT) –

property array: ndarray
property array_labeled: ArrayInterface
astropy = <module 'astropy' from '/home/docs/checkouts/readthedocs.org/user_builds/kgpy/envs/latest/lib/python3.9/site-packages/astropy/__init__.py'>
property broadcasted: ArrayInterfaceT
property centers: AbstractVectorT
property component_sum: int | float | ndarray | Quantity | AbstractArray | AbstractArray
property components: List[str]
property coordinates: Dict[str, int | float | ndarray | Quantity | AbstractArray | AbstractArray | VectorInterface]
property dtype
i: typing.Union[int, float, numpy.ndarray, astropy.units.quantity.Quantity, kgpy.labeled.AbstractArray, kgpy.uncertainty.AbstractArray] = <Quantity 1.>
property indices: Dict[str, ArrayT]
property length: int | float | ndarray | Quantity | AbstractArray | AbstractArray
property ndim: int
property normalize: AbstractVectorT
property normalized: VectorInterfaceT
q: typing.Union[int, float, numpy.ndarray, astropy.units.quantity.Quantity, kgpy.labeled.AbstractArray, kgpy.uncertainty.AbstractArray] = <Quantity 0.>
property shape: Dict[str, int]
property tuple: Tuple[int | float | ndarray | Quantity | AbstractArray | AbstractArray | VectorInterface, ...]
type_coordinates = (<class 'str'>, <class 'bool'>, <class 'int'>, <class 'float'>, <class 'complex'>, <class 'numpy.generic'>, <class 'numpy.ndarray'>, <class 'kgpy.labeled.AbstractArray'>, <class 'kgpy.uncertainty.AbstractArray'>)
property type_matrix: Type[AbstractMatrix]
u: typing.Union[int, float, numpy.ndarray, astropy.units.quantity.Quantity, kgpy.labeled.AbstractArray, kgpy.uncertainty.AbstractArray] = <Quantity 0.>
property unit
v: typing.Union[int, float, numpy.ndarray, astropy.units.quantity.Quantity, kgpy.labeled.AbstractArray, kgpy.uncertainty.AbstractArray] = <Quantity 0.>