Bases: astropy.modeling.core._CompositeModel
Composite model that evaluates models in series.
Parameters: | transforms : list
inmap : list of lists or None
outmap : list or None
n_inputs : int
n_outputs : int
|
---|
Notes
Output values of one model are used as input values of another. Obviously the order of the models matters.
Examples
Apply a 2D rotation followed by a shift in x and y:
>>> import numpy as np
>>> from astropy.modeling import models, LabeledInput, SerialCompositeModel
>>> y, x = np.mgrid[:5, :5]
>>> rotation = models.Rotation2D(angle=23.5)
>>> offset_x = models.Shift(-4.23)
>>> offset_y = models.Shift(2)
>>> labeled_input = LabeledInput([x, y], ["x", "y"])
>>> transform = SerialCompositeModel([rotation, offset_x, offset_y],
... inmap=[['x', 'y'], ['x'], ['y']],
... outmap=[['x', 'y'], ['x'], ['y']])
>>> result = transform(labeled_input)
Attributes Summary
input_names | list() -> new empty list |
Methods Summary
__call__(*data) | Transforms data using this model. |
inverse() |
Attributes Documentation
Methods Documentation
Transforms data using this model.