Longitude¶
- class astropy.coordinates.Longitude(angle, unit=None, wrap_angle=None, **kwargs)[source]¶
Bases:
AngleLongitude-like angle(s) which are wrapped within a contiguous 360 degree range.
A
Longitudeobject is distinguished from a pureAngleby virtue of awrap_angleproperty. Thewrap_anglespecifies 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_angleis 360 deg. Settingwrap_angle=180 * u.degwould instead result in values between -180 and +180 deg. Setting thewrap_angleattribute of an existingLongitudeobject 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,
Quantityor anotherAngle.The input parser is flexible and supports all of the input formats supported by
Angle.- Parameters:
- angle
tupleor 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
angleis a sequence or array of strings, the resulting values will be in the givenunit, or ifNoneis 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
Unitunderstands, 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 unlessanglehas awrap_angleattribute already (i.e., is aLongitude), in which case it will be taken from there.
- angle
- Raises:
UnitsErrorIf a unit is not provided or it is not an angular unit.
TypeErrorIf the angle parameter is an instance of
Latitude.
Attributes Summary
Attributes Documentation
- info¶
- wrap_angle¶