def dms2deg(valin):
    """
    Converts DMS input to decimal degrees.
    Input can be either a string delimeted by : or spaces, or a list of [D,M,S] numbers.
    
    Parameters
    ----------
    valin: float
        Input value in DMS. Can be either: \n
        - a string delimeted by : or spaces \n
        - a list of [D,M,S] numbers (floats or ints) \n
    
    Returns
    -------
    valout : float
        Degrees corresponding to the DMS value
    
    Examples
    --------
    # e.g., '-78:12:34.56' corresponds to -77.7904 deg \n
    obs.dms2deg('-78:12:34.56')  #--> -77.79039999999999 \n
    obs.dms2deg('-78 12 34.56')  #--> -77.79039999999999 \n
    obs.dms2deg([-78,12,34.56])  #--> -77.79039999999999
    """
    if type(valin)==str:
        if ':' in valin: ra=[float(val) for val in valin.split(':')]
        else: ra=[float(val) for val in valin.split(' ')]
    else: ra=valin
    valout=ra[0]+ra[1]/60.+ra[2]/3600.
    return valout