AffineTransformation2D¶
- class astropy.modeling.projections.AffineTransformation2D(matrix=Parameter('matrix', value=[[1. 0.] [0. 1.]]), translation=Parameter('translation', value=[0. 0.]), **kwargs)[source]¶
Bases:
Model
Perform an affine transformation in 2 dimensions.
- Parameters:
- matrix
array
A 2x2 matrix specifying the linear transformation to apply to the inputs
- translation
array
A 2D vector (given as either a 2x1 or 1x2 array) specifying a translation to apply to the inputs
- matrix
Attributes Summary
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).The number of inputs.
The number of outputs.
Names of the parameters that describe models of this type.
Methods Summary
__call__
(*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¶
- matrix = Parameter('matrix', value=[[1. 0.] [0. 1.]])¶
- n_inputs = 2¶
The number of inputs.
- n_outputs = 2¶
The number of outputs.
- param_names = ('matrix', 'translation')¶
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.
- standard_broadcasting = False¶
- translation = Parameter('translation', value=[0. 0.])¶
Methods Documentation
- __call__(*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.