Longitude#
- class astropy.coordinates.Longitude(angle, unit=None, wrap_angle=None, **kwargs)[source]#
Bases:
Angle
Longitude-like angle(s) which are wrapped within a contiguous 360 degree range.
A
Longitude
object is distinguished from a pureAngle
by virtue of awrap_angle
property. Thewrap_angle
specifies that all angle values represented by the object will be in the range:wrap_angle - 360 * u.deg <= angle(s) < wrap_angle
The default
wrap_angle
is 360 deg. Settingwrap_angle=180 * u.deg
would instead result in values between -180 and +180 deg. Setting thewrap_angle
attribute of an existingLongitude
object will result in re-wrapping the angle values in-place.The input angle(s) can be specified either as an array, list, scalar, tuple, string,
Quantity
or anotherAngle
.The input parser is flexible and supports all of the input formats supported by
Angle
.- Parameters:
- angle
tuple
or astropy:angle-like The angle value(s). If a tuple, will be interpreted as
(h, m s)
or(d, m, s)
depending onunit
. If a string, it will be interpreted following the rules described forAngle
.If
angle
is a sequence or array of strings, the resulting values will be in the givenunit
, or ifNone
is provided, the unit will be taken from the first given value.- unitastropy:unit-like [:ref: ‘angle’], optional
The unit of the value specified for the angle. This may be any string that
Unit
understands, but it is better to give an actual unit object. Must be an angular unit.- wrap_angleastropy:angle-like or
None
, optional Angle at which to wrap back to
wrap_angle - 360 deg
. IfNone
(default), it will be taken to be 360 deg unlessangle
has awrap_angle
attribute already (i.e., is aLongitude
), in which case it will be taken from there.
- angle
- Raises:
UnitsError
If a unit is not provided or it is not an angular unit.
TypeError
If the angle parameter is an instance of
Latitude
.
Attributes Summary
Attributes Documentation
- info#
- wrap_angle#