astropy/astropy — pull request #2269 by embray (2014-04-02 19:37:43+00:00)
Title: Rotation model split

As discussed in #2149 and elsewhere, this removes the `MatrixRotation2D` model and replaces it with two new models: `Rotation2D` (essentially the same as the old `MatrixRotation2D`, but only accepts an `angle` parameter) and `AffineTransformation2D` which replaces the use of `MatrixRotation2D` with an arbitrary matrix, and also adds simple translations. This also incorporates/supersedes #2266 such that the sense of rotation used by `Rotation2D` is counter-clockwise.

A few notes on `AffineTranformation2D`:

* For now I put it in `astropy.modeling.projections` which seemed like the most appropriate place *for now*, but I'm not sure. I'm open to other suggestions.
* This PR does *not* attempt to resolve the problems with array values for parameters as addressed by #2149. Rather, making this split now allows simplification on #2149 and a few other issues by not requiring as many "special cases" that `MatrixRotation2D` seemed to demand.
* It's clear that this could easily be extended to support transformations in more than 2 dimensions, but for now this is just serving as a direct replacement for the existing functionality (which really only practically supported 2 dimensions). This could be extended later if need be.
* It's also true that in some sense `Rotation2D` could be implemented around `AffineTransformation2D`. The latter could also, eventually, be implemented as a composite model. But for the time being it's more straightforward to have a concrete implementation.