astropy/astropy — pull request #2905 by mwcraig (2014-08-29 03:18:59+00:00)
Title: WIP: Refactoring NDData

This PR is a companion to astropy/astropy#2855 and also came out of the NDData telecon. The goal is to simplify the base NDData class so that the base class becomes a simple container for data interchange.

The arithmetic methods on the current ``NDData`` are factored out into an ``NDarithmetic`` mixin class. The class ``NDDataArithmetic`` is include as a convenience and works as a replacement for the current ``NDData`` (I've check that the current ccdproc tests pass if I make make one change to the code: subclass from ``NDDataArithmetic`` instead of ``NDData``).

I've also moved the ``NDData`` arithmetic tests into a separate file.

A rendered version of the documentation changes is [here](http://physics.mnstate.edu/craig/astropy/nddata).

Still not done:
- [ ] Remove checks for ``FlagCollection`` shape (should this be done?)
- [ ] Attempt to make ``mask``, ``unit`` point to the ``mask`` of the data (if it has one) instead of separating the mask from the data, and the same for the unit.

@Cadair -- please check to see whether this revision has ``wcs`` working the way you wanted.

cc @astrofrog @cdeil @perrygreenfield @crawfordsm @larrybradley @adamginsburg @bsipocz