Esempio 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
Esempio 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
Esempio 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
Esempio 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