astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v1.1.1 »
- Models and Fitting (`astropy.modeling`) »
- SerialCompositeModel

# SerialCompositeModel

class `astropy.modeling.``SerialCompositeModel`

  Bases: `astropy.modeling._compound_deprecated._CompositeModel`

  Deprecated since version 1.0: The SerialCompositeModel class is deprecated and may be removed in a future version. Use Compound Models as described in the Astropy documentation instead.

  Composite model that evaluates models in series.

  Parameters:

  transforms : list

  > a list of transforms in the order to be executed

  inmap : list of lists or None

  > labels in an input instance of LabeledInput if None, the number of input coordinates is exactly what the transforms expect

  outmap : list or None

  > labels in an input instance of LabeledInput if None, the number of output coordinates is exactly what the transforms expect

  n_inputs : int

  > dimension of input space (e.g. 2 for a spatial model)

  n_outputs : int

  > dimension of output

  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)

  Deprecated since version 1.0: The SerialCompositeModel class is deprecated and may be removed in a future version. Use Compound Models as described in the Astropy documentation instead.

  x.__init__(...) initializes x; see help(type(x)) for signature