Bases: BaseRepresentationOrDifferential
A base class representing differentials of representations.
These represent differences or derivatives along each component. E.g., for physics spherical coordinates, these would be \(\delta r, \delta \theta, \delta \phi\).
Quantity
or subclass
The components of the 3D differentials. The names are the keys and the subclasses the values of the attr_classes
attribute.
If True
(default), arrays will be copied. If False
, arrays will be references, though possibly broadcast to ensure matching shapes.
Notes
All differential representation classes should subclass this base class, and define an base_representation
attribute with the class of the regular BaseRepresentation
for which differential coordinates are provided. This will set up a default attr_classes
instance with names equal to the base component names prefixed by d_
, and all classes set to Quantity
, plus properties to access those, and a default __init__
for initialization.
Attributes Summary
Methods Summary
Attributes Documentation
Name of the representation or differential.
When a subclass is defined, by default, the name is the lower-cased name of the class with with any trailing ‘representation’ or ‘differential’ removed. (E.g., ‘spherical’ for SphericalRepresentation
or SphericalDifferential
.)
This can be customized when defining a subclass by setting the class attribute.
Methods Documentation
Convert the differential from 3D rectangular cartesian coordinates to the desired class.
The object to convert into this differential.
BaseRepresentation
The points for which the differentials are to be converted: each of the components is multiplied by its unit vectors and scale factors. Will be converted to cls.base_representation
if needed.
BaseDifferential
subclass instance
A new differential object that is this class’ type.
Create a new instance of this representation from another one.
BaseRepresentation
instance
The presentation that should be converted to this class.
cls.base_representation
The base relative to which the differentials will be defined. If the representation is a differential itself, the base will be converted to its base_representation
to help convert it.
Vector norm.
The norm is the standard Frobenius norm, i.e., the square root of the sum of the squares of all components with non-angular units.
self.base_representation
Base relative to which the differentials are defined. This is required to calculate the physical size of the differential for all but Cartesian differentials or radial differentials.
astropy.units.Quantity
Vector norm, with the same shape as the representation.
Convert coordinates to another representation.
If the instance is of the requested class, it is returned unmodified. By default, conversion is done via cartesian coordinates.
BaseRepresentation
subclass
The type of representation to turn the coordinates into.
self.base_representation
Base relative to which the differentials are defined. If the other class is a differential representation, the base will be converted to its base_representation
.
Convert the differential to 3D rectangular cartesian coordinates.
self.base_representation
The points for which the differentials are to be converted: each of the components is multiplied by its unit vectors and scale factors.
CartesianDifferential
This object, converted.
Transform differential using a 3x3 matrix in a Cartesian basis.
This returns a new differential and does not modify the original one.
A 3x3 (or stack thereof) matrix, such as a rotation matrix.
cls.base_representation
Base relative to which the differentials are defined. If the other class is a differential representation, the base will be converted to its base_representation
.
cls.base_representation
Base relative to which the transformed differentials are defined. If the other class is a differential representation, the base will be converted to its base_representation
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4