pipeline.domain.measures.EquatorialArc

class EquatorialArc(value: int | float | Decimal = 0, units: dict = {'html': '°', 'name': 'DEGREE', 'symbol': 'd', 'units per circle': Decimal('360')})[source]

Bases: ComparableUnit

Methods

convert_to

Converts this arc to the new units.

toDms

Returns a representation of this arc in degrees, minutes, and seconds.

toHms

Returns a representation of this arc in hours, minutes, and seconds.

to_units

Returns the magnitude of this arc in otherUnits.

Attributes

value

units

__init__(value: int | float | Decimal = 0, units: dict = {'html': '°', 'name': 'DEGREE', 'symbol': 'd', 'units per circle': Decimal('360')}) None[source]

Creates a new equatorial arc with the given magnitude and units.

If no arguments are given, a new arc of 0 degrees is created. If no units are given, degrees are assumed.

Parameters:
  • value -- The magnitude for this arc.

  • units -- The new units for this arc.

convert_to(newUnits: dict = {'html': '°', 'name': 'DEGREE', 'symbol': 'd', 'units per circle': Decimal('360')}) EquatorialArc[source]

Converts this arc to the new units.

After this method is complete this arc will have units of units and its value will have been converted accordingly.

Parameters:

newUnits -- The new units for this arc. Default: degrees.

Returns:

This arc. The reason for this return type is to allow code of this nature:

radians = myArc.convert_to(ArcUnits.RADIAN).value;

toDms() tuple[int, int, float][source]

Returns a representation of this arc in degrees, minutes, and seconds.

Returns:

An integer holding the number of degrees. An integer holding the number of arc minutes. A float holding the number of arc seconds.

Return type:

a tuple of size three in this order

toHms() tuple[int, int, float][source]

Returns a representation of this arc in hours, minutes, and seconds.

Returns:

An integer holding the number of hours. An integer holding the number of minutes. A float holding the number of seconds.

Return type:

a tuple of size three in this order

to_units(otherUnits: dict = {'html': '°', 'name': 'DEGREE', 'symbol': 'd', 'units per circle': Decimal('360')}) Decimal[source]

Returns the magnitude of this arc in otherUnits.

Note that this method does not alter the state of this arc. Contrast this with convert_to(ArcUnits).

Parameters:

otherUnits -- The units in which to express this arc's magnitude (default: degrees)

Returns:

This arc's value converted to otherUnits.