Add in_frame_units kwarg and move unit shifting into frame represent_as()
Add in_frame_units kwarg and move unit shifting into frame represent_as()

Two coupled but significant changes. BaseCoordinateFrame.represent_as() is
now capable of returning a representation that has the frame units which
are specified in the representation_attrs[<ReprClass>]['frame_units'] dict.
In other words the returned representation is in the frame units (e.g.
degrees for ra,dec) instead of the native units (e.g. rad for Spherical).
This unit shifting functionality was moved out of __repr__ into
represent_as().

To achieve this a new "in_frame_units" kwarg was added which defaults to
False (reproducing the previous behavior).  Along with that the repr. cache
is now keyed by the tuple (Repr class name, in_frame_units).

This change solves a latent problem that was not apparent previously because
all built-in frames have a default SphericalRepresentation.  If instead you
start from a CartesianRepresentation  there is an issue::

  >>> c = ICRS(x, y, z, representation=CartesianRepresentation)
  >>> c.spherical
  # Output is in radians, not degrees, giving a non-useful view
  # of the spherical representation

With this commit the `spherical` property calls represent_as with
in_frame_units=True and the desired units of degrees are returned.

kelle/astropy,lpsinger/astropy,kelle/astropy,larrybradley/astropy,stargaser/astropy,MSeifert04/astropy,pllim/astropy,bsipocz/astropy,bsipocz/astropy,astropy/astropy,larrybradley/astropy,saimn/astropy,dhomeier/astropy,DougBurke/astropy,lpsinger/astropy,funbaker/astropy,kelle/astropy,pllim/astropy,aleksandr-bakanov/astropy,tbabej/astropy,saimn/astropy,saimn/astropy,joergdietrich/astropy,StuartLittlefair/astropy,bsipocz/astropy,aleksandr-bakanov/astropy,stargaser/astropy,kelle/astropy,StuartLittlefair/astropy,pllim/astropy,larrybradley/astropy,larrybradley/astropy,astropy/astropy,astropy/astropy,tbabej/astropy,funbaker/astropy,joergdietrich/astropy,tbabej/astropy,stargaser/astropy,StuartLittlefair/astropy,dhomeier/astropy,mhvk/astropy,AustereCuriosity/astropy,dhomeier/astropy,AustereCuriosity/astropy,MSeifert04/astropy,DougBurke/astropy,dhomeier/astropy,mhvk/astropy,AustereCuriosity/astropy,AustereCuriosity/astropy,StuartLittlefair/astropy,larrybradley/astropy,lpsinger/astropy,astropy/astropy,MSeifert04/astropy,joergdietrich/astropy,funbaker/astropy,funbaker/astropy,AustereCuriosity/astropy,pllim/astropy,saimn/astropy,kelle/astropy,pllim/astropy,joergdietrich/astropy,mhvk/astropy,DougBurke/astropy,tbabej/astropy,dhomeier/astropy,stargaser/astropy,aleksandr-bakanov/astropy,bsipocz/astropy,MSeifert04/astropy,mhvk/astropy,StuartLittlefair/astropy,mhvk/astropy,aleksandr-bakanov/astropy,DougBurke/astropy,joergdietrich/astropy,tbabej/astropy,lpsinger/astropy,astropy/astropy,lpsinger/astropy,saimn/astropy