def dec2dms (dec, len=11, delimiter=":") :
    """ Transform decimal format angle to deg:min:sec format
    args:
        dec: decimal angle in degree
        len: output length of string
        delimiter: char seperate deg, min and sec, default is ":"
    returns:
        sexagesimal angle string, format +/-dd:mm:ss.xxx
    """
    dec0 = dec % 360.0 if dec >= 0.0 else dec % -360.0
    pm = "-" if dec0 < 0.0 else "+"
    adec = abs(dec0)
    dd = int(adec)
    mm = int((adec - dd) * 60.0)
    ss = (adec - dd) * 3600 - mm * 60.0
    dms = "{n:1s}{d:02d}{l}{m:02d}{l}{s:08.5f}".format(n=pm, d=dd, m=mm, s=ss, l=delimiter)
    return dms[0:len]