Ejemplo n.º 1
0
def _filter_format_degrees(degrees):
    arcminutes = units.arcminutes(degrees=degrees - int(degrees))
    arcseconds = units.arcseconds(arcminutes=arcminutes - int(arcminutes))
    format_dict = dict(deg='°',
                       arcmin="'",
                       arcsec='"',
                       degrees=degrees,
                       minutes=round(abs(arcminutes)),
                       seconds=round(abs(arcseconds)))
    return DEGREES_FORMAT % format_dict
Ejemplo n.º 2
0
def format_degrees(degrees, format=DEGREES_FORMAT, symbols=ASCII_SYMBOLS):
    arcminutes = units.arcminutes(degrees=degrees - int(degrees))
    arcseconds = units.arcseconds(arcminutes=arcminutes - int(arcminutes))
    format_dict = dict(
        symbols,
        degrees=degrees,
        minutes=abs(arcminutes),
        seconds=abs(arcseconds)
    )
    return format % format_dict
Ejemplo n.º 3
0
def format_degrees(degrees, fmt=DEGREES_FORMAT, symbols=None):
    """
    TODO docs.
    """
    symbols = symbols or ASCII_SYMBOLS
    arcminutes = units.arcminutes(degrees=degrees - int(degrees))
    arcseconds = units.arcseconds(arcminutes=arcminutes - int(arcminutes))
    format_dict = dict(symbols,
                       degrees=degrees,
                       minutes=abs(arcminutes),
                       seconds=abs(arcseconds))
    return fmt % format_dict
Ejemplo n.º 4
0
def format_degrees(degrees, fmt=DEGREES_FORMAT, symbols=ASCII_SYMBOLS):
    """
    TODO docs.
    """
    arcminutes = round(units.arcminutes(degrees=degrees - int(degrees)))
    arcseconds = units.arcseconds(arcminutes=arcminutes - int(arcminutes))
    format_dict = dict(
        symbols,
        degrees=degrees,
        minutes=abs(arcminutes),
        seconds=abs(arcseconds)
    )
    return fmt % format_dict