AffineTransformation2D

class astropy.modeling.projections.AffineTransformation2D(matrix=Parameter('matrix', value=[[1. 0.] [0. 1.]]), translation=Parameter('translation', value=[0. 0.]), **kwargs)[source]

Bases: astropy.modeling.Model

Perform an affine transformation in 2 dimensions.

Parameters
matrixarray

A 2x2 matrix specifying the linear transformation to apply to the inputs

translationarray

A 2D vector (given as either a 2x1 or 1x2 array) specifying a translation to apply to the inputs

Attributes Summary

input_units

This property is used to indicate what units or sets of units the evaluate method expects, and returns a dictionary mapping inputs to units (or None if any units are accepted).

matrix

n_inputs

n_outputs

param_names

standard_broadcasting

translation

Methods Summary

__call__(self, *inputs[, model_set_axis, …])

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

evaluate(x, y, matrix, translation)

Apply the transformation to a set of 2D Cartesian coordinates given as two lists–one for the x coordinates and one for a y coordinates–or a single coordinate pair.

Attributes Documentation

input_units

This property is used to indicate what units or sets of units the evaluate method expects, and returns a dictionary mapping inputs to units (or None if any units are accepted).

Model sub-classes can also use function annotations in evaluate to indicate valid input units, in which case this property should not be overridden since it will return the input units based on the annotations.

matrix = Parameter('matrix', value=[[1. 0.] [0. 1.]])
n_inputs = 2
n_outputs = 2
param_names = ('matrix', 'translation')
standard_broadcasting = False
translation = Parameter('translation', value=[0. 0.])

Methods Documentation

__call__(self, *inputs, model_set_axis=None, with_bounding_box=False, fill_value=nan, equivalencies=None, inputs_map=None, **new_inputs)

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

classmethod evaluate(x, y, matrix, translation)[source]

Apply the transformation to a set of 2D Cartesian coordinates given as two lists–one for the x coordinates and one for a y coordinates–or a single coordinate pair.

Parameters
x, yarray, float

x and y coordinates