Commit 05535b14 authored by Ole Streicher's avatar Ole Streicher

New upstream version 2.0

parent 11bc3320
This diff is collapsed.
Copyright (c) 2011-2017, Astropy Developers
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
* Neither the name of the Astropy Team nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Metadata-Version: 1.2
Name: astropy
Version: 2.0rc1
Version: 2.0
Summary: Community-developed python astronomy tools
Home-page: http://astropy.org
Author: The Astropy Developers
......
......@@ -31,16 +31,23 @@ Project Status
.. image:: https://travis-ci.org/astropy/astropy.svg
:target: https://travis-ci.org/astropy/astropy
:alt: Astropy's Travis CI Status
.. image:: https://coveralls.io/repos/astropy/astropy/badge.svg
:target: https://coveralls.io/r/astropy/astropy
:alt: Astropy's Coveralls Status
.. image:: https://ci.appveyor.com/api/projects/status/ym7lxajcs5qwm31e/branch/master?svg=true
:target: https://ci.appveyor.com/project/Astropy/astropy/branch/master
:alt: Astropy's Appveyor Status
For an overview of the testing and build status of all packages associated
with the Astropy Project, see http://dashboard.astropy.org.
.. image:: https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A
:target: http://numfocus.org
:alt: Powered by NumFOCUS
License
-------
Astropy is licensed under a 3-clause BSD style license - see the
......
......@@ -176,7 +176,7 @@ class TestConvolve1D(object):
np.asarray(z, dtype=np.float16),
np.array([1., 0., 3.], dtype=np.float16), 10)
# ASSERT equality to better than 16 bit but worse than 32 bit precision
assert np.all(np.abs(z - np.array([1., 0., 3.])) < 1e-14)
assert_allclose(z, np.array([1., 0., 3.]), atol=1e-14)
inputs = (np.array([1., np.nan, 3.], dtype='float64'),
np.array([1., np.inf, 3.], dtype='float64'))
......@@ -210,7 +210,7 @@ class TestConvolve1D(object):
if hasattr(np, 'float16'):
assert_array_almost_equal_nulp(np.asarray(z, dtype=np.float16),
np.array([1., 0., 3.], dtype=np.float16), 10)
assert np.all(np.abs(z - outval) < 1e-14)
assert_allclose(z, outval, atol=1e-14)
@pytest.mark.parametrize(option_names, options)
def test_uniform_3_withnan(self, boundary, nan_treatment,
......@@ -280,25 +280,26 @@ class TestConvolve1D(object):
kernel = np.array([1, 1, 1])
masked_array = np.ma.masked_array(array, mask=[0, 1, 0])
result = convolve_fft(masked_array, kernel, boundary='fill', fill_value=np.nan)
assert_allclose(result, [1, 2, 3], atol=1E-10)
assert_allclose(result, [1, 2, 3], atol=1e-14)
def test_masked_array(self):
"""
Check whether convolve_fft works with masked arrays.
"""
# Test masked array
array = np.array([1., np.nan, 3.], dtype='float64')
kernel = np.array([1, 1, 1])
masked_array = np.ma.masked_array(array, mask=[0, 1, 0])
result = convolve_fft(masked_array, kernel, boundary='fill', fill_value=np.nan)
assert_allclose(result, [1, 2, 3], atol=1E-10)
assert_allclose(result, [1, 2, 3], atol=1e-14)
# Test masked kernel
array = np.array([1., np.nan, 3.], dtype='float64')
kernel = np.array([1, 1, 1])
masked_array = np.ma.masked_array(array, mask=[0, 1, 0])
result = convolve_fft(masked_array, kernel, boundary='fill', fill_value=np.nan)
assert_allclose(result, [1, 2, 3], atol=1E-10)
assert_allclose(result, [1, 2, 3], atol=1e-14)
def test_normalize_function(self):
"""
......@@ -307,7 +308,7 @@ class TestConvolve1D(object):
array = [1, 2, 3]
kernel = [3, 3, 3]
result = convolve_fft(array, kernel, normalize_kernel=np.max)
assert_allclose(result, [3, 6, 5], atol=1E-10)
assert_allclose(result, [3, 6, 5], atol=1e-14)
@pytest.mark.parametrize(option_names, options)
def test_normalization_is_respected(self, boundary,
......@@ -335,10 +336,10 @@ class TestConvolve1D(object):
normalization_zero_tol=normalization_rtol)
if normalize_kernel:
# Kernel has been normalized to 1.
assert_allclose(result, array)
assert_allclose(result, array, atol=1e-14)
else:
# Kernel should not have been normalized...
assert_allclose(result, array * kernel)
assert_allclose(result, array * kernel, atol=1e-14)
class TestConvolve2D(object):
......@@ -381,7 +382,6 @@ class TestConvolve2D(object):
normalize_kernel=normalize_kernel)
assert_array_almost_equal_nulp(z, x, 10)
# assert np.all( np.abs(z-x) < np.spacing(np.where(z>x, z, x))*2 )
@pytest.mark.parametrize(option_names, options)
def test_uniform_3x3(self, boundary, nan_treatment, normalize_kernel):
......@@ -464,7 +464,7 @@ class TestConvolve2D(object):
if hasattr(np, 'float16'):
assert_array_almost_equal_nulp(np.asarray(z, dtype=np.float16),
np.asarray(a, dtype=np.float16), 10)
assert np.all(np.abs(z - a) < 1e-14)
assert_allclose(z, a, atol=1e-14)
@pytest.mark.parametrize(option_names, options)
def test_uniform_3x3_withnan(self, boundary, nan_treatment,
......@@ -569,12 +569,12 @@ class TestConvolve2D(object):
normalize_kernel=False)
if boundary in (None, 'fill'):
assert_array_almost_equal_nulp(z, np.array([[1., -5., 2.],
[1., 0., -3.],
[-2., -1., -1.]], dtype='float'), 10)
assert_allclose(z, np.array([[1., -5., 2.],
[1., 0., -3.],
[-2., -1., -1.]], dtype='float'), atol=1e-14)
elif boundary == 'wrap':
assert_allclose(z, np.array([[0., -8., 6.],
[5., 0., -4.],
[2., 3., -4.]], dtype='float'), atol=1e-14,)
[2., 3., -4.]], dtype='float'), atol=1e-14)
else:
raise ValueError("Invalid boundary specification")
......@@ -11,7 +11,7 @@ from __future__ import (absolute_import, division, print_function,
from .errors import *
from .angles import *
from .baseframe import *
from .frame_attributes import *
from .attributes import *
from .distances import *
from .earth import *
from .transformations import *
......
......@@ -6,19 +6,21 @@ from __future__ import (absolute_import, unicode_literals, division,
# Dependencies
import numpy as np
import warnings
# Project
from .. import units as u
from ..utils.compat.numpy import broadcast_to as np_broadcast_to
from ..utils.exceptions import AstropyDeprecationWarning
from ..utils import OrderedDescriptor, ShapedLikeNDArray
__all__ = ['FrameAttribute', 'TimeFrameAttribute', 'QuantityFrameAttribute',
__all__ = ['Attribute', 'TimeAttribute', 'QuantityAttribute',
'EarthLocationAttribute', 'CoordinateAttribute',
'CartesianRepresentationFrameAttribute',
'DifferentialFrameAttribute']
'CartesianRepresentationAttribute',
'DifferentialAttribute']
class FrameAttribute(OrderedDescriptor):
class Attribute(OrderedDescriptor):
"""A non-mutable data descriptor to hold a frame attribute.
This class must be used to define frame attributes (e.g. ``equinox`` or
......@@ -29,9 +31,9 @@ class FrameAttribute(OrderedDescriptor):
The `~astropy.coordinates.FK4` class uses the following class attributes::
class FK4(BaseCoordinateFrame):
equinox = TimeFrameAttribute(default=_EQUINOX_B1950)
obstime = TimeFrameAttribute(default=None,
secondary_attribute='equinox')
equinox = TimeAttribute(default=_EQUINOX_B1950)
obstime = TimeAttribute(default=None,
secondary_attribute='equinox')
This means that ``equinox`` and ``obstime`` are available to be set as
keyword arguments when creating an ``FK4`` class instance and are then
......@@ -60,7 +62,7 @@ class FrameAttribute(OrderedDescriptor):
def __init__(self, default=None, secondary_attribute=''):
self.default = default
self.secondary_attribute = secondary_attribute
super(FrameAttribute, self).__init__()
super(Attribute, self).__init__()
def convert_input(self, value):
"""
......@@ -133,10 +135,10 @@ class FrameAttribute(OrderedDescriptor):
raise AttributeError('Cannot set frame attribute')
class TimeFrameAttribute(FrameAttribute):
class TimeAttribute(Attribute):
"""
Frame attribute descriptor for quantities that are Time objects.
See the `~astropy.coordinates.FrameAttribute` API doc for further
See the `~astropy.coordinates.Attribute` API doc for further
information.
Parameters
......@@ -190,7 +192,7 @@ class TimeFrameAttribute(FrameAttribute):
return out, converted
class CartesianRepresentationFrameAttribute(FrameAttribute):
class CartesianRepresentationAttribute(Attribute):
"""
A frame attribute that is a CartesianRepresentation with specified units.
......@@ -207,7 +209,8 @@ class CartesianRepresentationFrameAttribute(FrameAttribute):
"""
def __init__(self, default=None, secondary_attribute='', unit=None):
super(CartesianRepresentationFrameAttribute, self).__init__(default, secondary_attribute)
super(CartesianRepresentationAttribute, self).__init__(
default, secondary_attribute)
self.unit = unit
def convert_input(self, value):
......@@ -244,8 +247,9 @@ class CartesianRepresentationFrameAttribute(FrameAttribute):
# if it's a CartesianRepresentation, get the xyz Quantity
value = getattr(value, 'xyz', value)
if not hasattr(value, 'unit'):
raise TypeError('tried to set a CartesianRepresentationFrameAttribute with '
'something that does not have a unit.')
raise TypeError('tried to set a {0} with something that does '
'not have a unit.'
.format(self.__class__.__name__))
value = value.to(self.unit)
......@@ -254,7 +258,7 @@ class CartesianRepresentationFrameAttribute(FrameAttribute):
return cartrep, converted
class QuantityFrameAttribute(FrameAttribute):
class QuantityAttribute(Attribute):
"""
A frame attribute that is a quantity with specified units and shape
(optionally).
......@@ -274,7 +278,7 @@ class QuantityFrameAttribute(FrameAttribute):
"""
def __init__(self, default=None, secondary_attribute='', unit=None, shape=None):
super(QuantityFrameAttribute, self).__init__(default, secondary_attribute)
super(QuantityAttribute, self).__init__(default, secondary_attribute)
self.unit = unit
self.shape = shape
......@@ -303,7 +307,7 @@ class QuantityFrameAttribute(FrameAttribute):
return u.Quantity(np.zeros(self.shape), self.unit), True
else:
if not hasattr(value, 'unit'):
raise TypeError('Tried to set a QuantityFrameAttribute with '
raise TypeError('Tried to set a QuantityAttribute with '
'something that does not have a unit.')
oldvalue = value
value = u.Quantity(oldvalue, self.unit, copy=False)
......@@ -314,8 +318,7 @@ class QuantityFrameAttribute(FrameAttribute):
converted = oldvalue is not value
return value, converted
class EarthLocationAttribute(FrameAttribute):
class EarthLocationAttribute(Attribute):
"""
A frame attribute that can act as a `~astropy.coordinates.EarthLocation`.
It can be created as anything that can be transformed to the
......@@ -369,7 +372,7 @@ class EarthLocationAttribute(FrameAttribute):
return itrsobj.earth_location, True
class CoordinateAttribute(FrameAttribute):
class CoordinateAttribute(Attribute):
"""
A frame attribute which is a coordinate object. It can be given as a
low-level frame class *or* a `~astropy.coordinates.SkyCoord`, but will
......@@ -426,7 +429,7 @@ class CoordinateAttribute(FrameAttribute):
return transformedobj, True
class DifferentialFrameAttribute(FrameAttribute):
class DifferentialAttribute(Attribute):
"""A frame attribute which is a differential instance.
The optional ``allowed_classes`` argument allows specifying a restricted
......@@ -452,8 +455,8 @@ class DifferentialFrameAttribute(FrameAttribute):
else:
self.allowed_classes = BaseDifferential
super(DifferentialFrameAttribute, self).__init__(default,
secondary_attribute)
super(DifferentialAttribute, self).__init__(default,
secondary_attribute)
def convert_input(self, value):
"""
......@@ -478,7 +481,7 @@ class DifferentialFrameAttribute(FrameAttribute):
"""
if not isinstance(value, self.allowed_classes):
raise TypeError('Tried to set a DifferentialFrameAttribute with '
raise TypeError('Tried to set a DifferentialAttribute with '
'an unsupported Differential type {0}. Allowed '
'classes are: {1}'
.format(value.__class__,
......@@ -487,6 +490,39 @@ class DifferentialFrameAttribute(FrameAttribute):
return value, True
# Backwards-compatibility: these are the only classes that were previously
# released in v1.3
class FrameAttribute(Attribute):
def __init__(self, *args, **kwargs):
warnings.warn("FrameAttribute has been renamed to Attribute.",
AstropyDeprecationWarning)
super(FrameAttribute, self).__init__(*args, **kwargs)
class TimeFrameAttribute(TimeAttribute):
def __init__(self, *args, **kwargs):
warnings.warn("TimeFrameAttribute has been renamed to TimeAttribute.",
AstropyDeprecationWarning)
super(TimeFrameAttribute, self).__init__(*args, **kwargs)
class QuantityFrameAttribute(QuantityAttribute):
def __init__(self, *args, **kwargs):
warnings.warn("QuantityFrameAttribute has been renamed to "
"QuantityAttribute.", AstropyDeprecationWarning)
super(QuantityFrameAttribute, self).__init__(*args, **kwargs)
class CartesianRepresentationFrameAttribute(CartesianRepresentationAttribute):
def __init__(self, *args, **kwargs):
warnings.warn("CartesianRepresentationFrameAttribute has been renamed "
"to CartesianRepresentationAttribute.",
AstropyDeprecationWarning)
super(CartesianRepresentationFrameAttribute, self).__init__(
*args, **kwargs)
# do this here to prevent a series of complicated circular imports
from .earth import EarthLocation
from .representation import CartesianRepresentation, BaseDifferential
......@@ -30,16 +30,17 @@ from ..utils import (OrderedDescriptorContainer, ShapedLikeNDArray,
from .transformations import TransformGraph
from . import representation as r
from .frame_attributes import FrameAttribute
from .attributes import Attribute
# Import all other FrameAttributes so we don't break backwards-compatibility
# (some users rely on them being here, although that is not
# encouraged, as this is not the public API location.)
from .frame_attributes import (
# Import old names for Attributes so we don't break backwards-compatibility
# (some users rely on them being here, although that is not encouraged, as this
# is not the public API location -- see attributes.py).
from .attributes import (
TimeFrameAttribute, QuantityFrameAttribute,
EarthLocationAttribute, CoordinateAttribute,
CartesianRepresentationFrameAttribute) # pylint: disable=W0611
__all__ = ['BaseCoordinateFrame', 'frame_transform_graph',
'GenericFrame', 'RepresentationMapping']
......@@ -224,7 +225,12 @@ class BaseCoordinateFrame(ShapedLikeNDArray):
treated as the default representation of this frame. This is the
representation assumed by default when the frame is created.
* `~astropy.coordinates.FrameAttribute` class attributes
* `default_differential`
A subclass of `~astropy.coordinates.BaseDifferential` that will be
treated as the default differential class of this frame. This is the
differential class assumed by default when the frame is created.
* `~astropy.coordinates.Attribute` class attributes
Frame attributes such as ``FK4.equinox`` or ``FK4.obstime`` are defined
using a descriptor class. See the narrative documentation or
built-in classes code for details.
......@@ -242,6 +248,13 @@ class BaseCoordinateFrame(ShapedLikeNDArray):
arguments)
*args, **kwargs
Coordinates, with names that depend on the subclass.
differential_cls : `BaseDifferential`, dict, optional
A differential class or dictionary of differential classes (currently
only a velocity differential with key 's' is supported). This sets
the expected input differential class, thereby changing the expected
keyword arguments of the data passed in. For example, passing
``differential_cls=CartesianDifferential`` will make the classes
expect velocity data with the argument names ``v_x, v_y, v_z``.
copy : bool, optional
If `True` (default), make copies of the input coordinate arrays.
Can only be passed in as a keyword argument.
......@@ -254,7 +267,7 @@ class BaseCoordinateFrame(ShapedLikeNDArray):
# attributes.
frame_specific_representation_info = {}
_inherit_descriptors_ = (FrameAttribute,)
_inherit_descriptors_ = (Attribute,)
frame_attributes = OrderedDict()
# Default empty frame_attributes dict
......@@ -266,9 +279,23 @@ class BaseCoordinateFrame(ShapedLikeNDArray):
# TODO: we should be able to deal with an instance, not just a
# class or string.
representation = kwargs.pop('representation', None)
differential_cls = kwargs.pop('differential_cls', None)
if representation is not None or differential_cls is not None:
if representation is None:
representation = self.default_representation
if representation is not None:
self.set_representation_cls(representation)
if (inspect.isclass(differential_cls) and
issubclass(differential_cls, r.BaseDifferential)):
# TODO: assumes the differential class is for the velocity
# differential
differential_cls = {'s': differential_cls}
elif differential_cls is None:
differential_cls = {'s': 'base'} # see set_representation_cls()
self.set_representation_cls(representation, **differential_cls)
# if not set below, this is a frame with no data
representation_data = None
......@@ -508,12 +535,12 @@ class BaseCoordinateFrame(ShapedLikeNDArray):
's': self.default_differential}
return self._representation[which] if which is not None else self._representation
def set_representation_cls(self, base, s='base'):
def set_representation_cls(self, base=None, s='base'):
"""Set representation and/or differential class for this frame's data.
Parameters
----------
base : str or `~astropy.coordinates.BaseRepresentation` subclass
base : str, `~astropy.coordinates.BaseRepresentation` subclass, optional
The name or subclass to use to represent the coordinate data.
s : `~astropy.coordinates.BaseDifferential` subclass, optional
The differential subclass to use to represent any velocities,
......@@ -521,6 +548,8 @@ class BaseCoordinateFrame(ShapedLikeNDArray):
which is the default, it will be inferred from the representation.
If `None`, the representation will drop any differentials.
"""
if base is None:
base = self._representation['base']
self._representation = _get_repr_classes(base=base, s=s)
representation = property(
......@@ -1114,6 +1143,9 @@ class BaseCoordinateFrame(ShapedLikeNDArray):
representation_cls = kwargs.pop('representation_cls',
self.representation)
differential_cls = kwargs.pop('differential_cls',
self.get_representation_cls('s'))
def apply_method(value):
if isinstance(value, ShapedLikeNDArray):
if method == 'replicate' and not hasattr(value, method):
......@@ -1133,7 +1165,8 @@ class BaseCoordinateFrame(ShapedLikeNDArray):
data = apply_method(data)
# TODO: change to representation_cls in __init__ - gh-6219.
frattrs = {'representation': representation_cls}
frattrs = {'representation': representation_cls,
'differential_cls': differential_cls}
for attr in self.get_frame_attr_names():
if attr not in self._attr_names_with_defaults:
if (method == 'copy' or method == 'replicate') and attr in kwargs:
......@@ -1287,8 +1320,11 @@ class BaseCoordinateFrame(ShapedLikeNDArray):
raise ValueError('The other object does not have a distance; '
'cannot compute 3d separation.')
return Distance((self.cartesian -
other_in_self_system.cartesian).norm())
# drop the differentials to ensure they don't do anything odd in the
# subtraction
self_car = self.data.without_differentials().represent_as(r.CartesianRepresentation)
other_car = other_in_self_system.data.without_differentials().represent_as(r.CartesianRepresentation)
return Distance((self_car - other_car).norm())
@property
def cartesian(self):
......@@ -1343,7 +1379,7 @@ class GenericFrame(BaseCoordinateFrame):
def __init__(self, frame_attrs):
self.frame_attributes = OrderedDict()
for name, default in frame_attrs.items():
self.frame_attributes[name] = FrameAttribute(default)
self.frame_attributes[name] = Attribute(default)
setattr(self, '_' + name, default)
super(GenericFrame, self).__init__(None)
......
......@@ -8,8 +8,8 @@ import numpy as np
from ... import units as u
from .. import representation as r
from ..baseframe import BaseCoordinateFrame, RepresentationMapping
from ..frame_attributes import (FrameAttribute, TimeFrameAttribute,
QuantityFrameAttribute, EarthLocationAttribute)
from ..attributes import (Attribute, TimeAttribute,
QuantityAttribute, EarthLocationAttribute)
_90DEG = 90*u.deg
......@@ -53,6 +53,14 @@ class AltAz(BaseCoordinateFrame):
If `True` (default), make copies of the input coordinate arrays.
Can only be passed in as a keyword argument.
differential_cls : `BaseDifferential`, dict, optional
A differential class or dictionary of differential classes (currently
only a velocity differential with key 's' is supported). This sets
the expected input differential class, thereby changing the expected
keyword arguments of the data passed in. For example, passing
``differential_cls=CartesianDifferential`` will make the classes
expect velocity data with the argument names ``v_x, v_y, v_z``.
Other parameters
----------------
obstime : `~astropy.time.Time`
......@@ -121,12 +129,12 @@ class AltAz(BaseCoordinateFrame):
default_representation = r.SphericalRepresentation
default_differential = r.SphericalCosLatDifferential
obstime = TimeFrameAttribute(default=None)
obstime = TimeAttribute(default=None)
location = EarthLocationAttribute(default=None)
pressure = QuantityFrameAttribute(default=0, unit=u.hPa)
temperature = QuantityFrameAttribute(default=0, unit=u.deg_C)
relative_humidity = FrameAttribute(default=0)
obswl = QuantityFrameAttribute(default=1*u.micron, unit=u.micron)
pressure = QuantityAttribute(default=0, unit=u.hPa)
temperature = QuantityAttribute(default=0, unit=u.deg_C)
relative_humidity = Attribute(default=0)
obswl = QuantityAttribute(default=1*u.micron, unit=u.micron)
def __init__(self, *args, **kwargs):
super(AltAz, self).__init__(*args, **kwargs)
......
......@@ -28,15 +28,23 @@ _base_radec_docstring = """Parameters
pm_ra_cosdec : :class:`~astropy.units.Quantity`, optional, must be keyword
The proper motion in Right Ascension (including the ``cos(dec)`` factor)
for this object (``pm_dec`` must also be given).
pm_dec : :class:`~astropy.units.Quantity`, optional, must be keyword The
proper motion in Declination for this object (``pm_ra_cosdec`` must also
be given).
pm_dec : :class:`~astropy.units.Quantity`, optional, must be keyword
The proper motion in Declination for this object (``pm_ra_cosdec`` must
also be given).
radial_velocity : :class:`~astropy.units.Quantity`, optional, must be keyword
The radial velocity of this object.
copy : bool, optional
If `True` (default), make copies of the input coordinate arrays.
Can only be passed in as a keyword argument.
differential_cls : `BaseDifferential`, dict, optional
A differential class or dictionary of differential classes (currently
only a velocity differential with key 's' is supported). This sets
the expected input differential class, thereby changing the expected
keyword arguments of the data passed in. For example, passing
``differential_cls=CartesianDifferential`` will make the classes
expect velocity data with the argument names ``v_x, v_y, v_z``.
"""
......
......@@ -3,7 +3,7 @@
from __future__ import (absolute_import, unicode_literals, division,
print_function)
from ..frame_attributes import TimeFrameAttribute
from ..attributes import TimeAttribute
from .baseradec import _base_radec_docstring, BaseRADecFrame
from .utils import DEFAULT_OBSTIME
......@@ -24,7 +24,7 @@ class CIRS(BaseRADecFrame):
position of the Earth and its precession.
"""
obstime = TimeFrameAttribute(default=DEFAULT_OBSTIME)
obstime = TimeAttribute(default=DEFAULT_OBSTIME)
CIRS.__doc__ = CIRS.__doc__.format(params=_base_radec_docstring)
......
......@@ -6,7 +6,7 @@ from __future__ import (absolute_import, unicode_literals, division,
from ... import units as u
from .. import representation as r
from ..baseframe import BaseCoordinateFrame, RepresentationMapping
from ..frame_attributes import TimeFrameAttribute
from ..attributes import TimeAttribute
from .utils import EQUINOX_J2000
__all__ = ['GeocentricTrueEcliptic', 'BarycentricTrueEcliptic',
......@@ -46,6 +46,14 @@ _base_ecliptic_docstring = """.. warning::
copy : bool, optional
If `True` (default), make copies of the input coordinate arrays.
Can only be passed in as a keyword argument.
differential_cls : `BaseDifferential`, dict, optional
A differential class or dictionary of differential classes (currently
only a velocity differential with key 's' is supported). This sets
the expected input differential class, thereby changing the expected
keyword arguments of the data passed in. For example, passing
``differential_cls=CartesianDifferential`` will make the classes
expect velocity data with the argument names ``v_x, v_y, v_z``.
"""
......@@ -106,7 +114,7 @@ class GeocentricTrueEcliptic(BaseEclipticFrame):
non-geocentric systems).
"""
equinox = TimeFrameAttribute(default=EQUINOX_J2000)
equinox = TimeAttribute(default=EQUINOX_J2000)
GeocentricTrueEcliptic.__doc__ = GeocentricTrueEcliptic.__doc__.format(
......@@ -132,7 +140,7 @@ class BarycentricTrueEcliptic(BaseEclipticFrame):
x-axis and the location of the Earth and Sun.
"""
equinox = TimeFrameAttribute(default=EQUINOX_J2000)
equinox = TimeAttribute(default=EQUINOX_J2000)
BarycentricTrueEcliptic.__doc__ = BarycentricTrueEcliptic.__doc__.format(
......@@ -158,7 +166,7 @@ class HeliocentricTrueEcliptic(BaseEclipticFrame):
x-axis and the location of the Earth and Sun.
"""
equinox = TimeFrameAttribute(default=EQUINOX_J2000)
equinox = TimeAttribute(default=EQUINOX_J2000)
HeliocentricTrueEcliptic.__doc__ = HeliocentricTrueEcliptic.__doc__.format(
......
......@@ -8,7 +8,7 @@ import numpy as np
from ...extern.six.moves import range
from ... import units as u
from ..baseframe import frame_transform_graph
from ..frame_attributes import TimeFrameAttribute
from ..attributes import TimeAttribute
from ..transformations import (FunctionTransformWithFiniteDifference,
FunctionTransform, DynamicMatrixTransform)
from ..representation import (CartesianRepresentation,
......@@ -39,8 +39,8 @@ class FK4(BaseRADecFrame):
``equinox``.
"""
equinox = TimeFrameAttribute(default=EQUINOX_B1950)
obstime = TimeFrameAttribute(default=None, secondary_attribute='equinox')
equinox = TimeAttribute(default=EQUINOX_B1950)
obstime = TimeAttribute(default=None, secondary_attribute='equinox')
FK4.__doc__ = FK4.__doc__.format(params=_base_radec_docstring)
......@@ -75,8 +75,8 @@ class FK4NoETerms(BaseRADecFrame):
``equinox``.
"""
equinox = TimeFrameAttribute(default=EQUINOX_B1950)
obstime = TimeFrameAttribute(default=None, secondary_attribute='equinox')
equinox = TimeAttribute(default=EQUINOX_B1950)
obstime = TimeAttribute(default=None, secondary_attribute='equinox')
@staticmethod
def _precession_matrix(oldequinox, newequinox):
......
......@@ -4,7 +4,7 @@ from __future__ import (absolute_import, unicode_literals, division,
print_function)
from ..baseframe import frame_transform_graph
from ..frame_attributes import TimeFrameAttribute