BaseAffineTransform#

class astropy.coordinates.BaseAffineTransform(fromsys, tosys, priority=1, register_graph=None)[source]#

Bases: CoordinateTransform

Base class for common functionality between the AffineTransform-type subclasses.

This base class is needed because AffineTransform and the matrix transform classes share the __call__() method, but differ in how they generate the affine parameters. StaticMatrixTransform passes in a matrix stored as a class attribute, and both of the matrix transforms pass in None for the offset. Hence, user subclasses would likely want to subclass this (rather than AffineTransform) if they want to provide alternative transformations using this machinery.

Methods Summary

__call__(fromcoord, toframe)

Does the actual coordinate transformation from the fromsys class to the tosys class.

Methods Documentation

__call__(fromcoord, toframe)[source]#

Does the actual coordinate transformation from the fromsys class to the tosys class.

Parameters:
fromcoordBaseCoordinateFrame subclass instance

An object of class matching fromsys that is to be transformed.

toframeobject

An object that has the attributes necessary to fully specify the frame. That is, it must have attributes with names that match the keys of the dictionary tosys.frame_attributes. Typically this is of class tosys, but it might be some other class as long as it has the appropriate attributes.

Returns:
tocoordBaseCoordinateFrame subclass instance

The new coordinate after the transform has been applied.