Rotation2D#

class astropy.modeling.rotations.Rotation2D(angle=Parameter('angle', value=0.0), **kwargs)[source]#

Bases: Model

Perform a 2D rotation given an angle.

Positive angles represent a counter-clockwise rotation and vice-versa.

Parameters:
anglepython:float or Quantity [:ref: ‘angle’]

Angle of rotation (if float it should be in deg).

Attributes Summary

angle

n_inputs

n_outputs

param_names

Names of the parameters that describe models of this type.

Methods Summary

__call__

Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.

evaluate(x, y, angle)

Rotate (x, y) about angle.

Attributes Documentation

angle = Parameter('angle', value=0.0)#
n_inputs = 2#
n_outputs = 2#
param_names = ('angle',)#

Names of the parameters that describe models of this type.

The parameters in this tuple are in the same order they should be passed in when initializing a model of a specific type. Some types of models, such as polynomial models, have a different number of parameters depending on some other property of the model, such as the degree.

When defining a custom model class the value of this attribute is automatically set by the Parameter attributes defined in the class body.

Methods Documentation

__call__()#

Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.

classmethod evaluate(x, y, angle)[source]#

Rotate (x, y) about angle.

Parameters:
x, ynumpy:array_like

Input quantities

anglepython:float or Quantity [:ref: ‘angle’]

Angle of rotations. If float, assumed in degrees.