def convert_to_pycgm_label(label):
    """Convert angle label name to known pycgm angle label.

    Since output from other programs can use slightly 
    different angle labels, we convert them to the pycgm format 
    to make it easier to compare csv outputs across different
    formats.

    Parameters
    ----------
    label : string
        String of the label name.

    Returns
    -------
    string
        String of the known pycgm label corresponding to `label`.
    """
    known_labels = set(['Pelvis','R Hip','L Hip','R Knee','L Knee','R Ankle',
                        'L Ankle','R Foot','L Foot',
                        'Head','Thorax','Neck','Spine','R Shoulder','L Shoulder',
                        'R Elbow','L Elbow','R Wrist','L Wrist'])
    
    label_aliases = {
        #Angle names commonly used to pycgm angle names
        'RPelvisAngles': 'Pelvis',
        'RHipAngles' : 'R Hip',
        'LHipAngles' : 'L Hip',
        'RKneeAngles' : 'R Knee',
        'LKneeAngles' : 'L Knee',
        'RAnkleAngles' : 'R Ankle',
        'LAnkleAngles' : 'L Ankle',
        'RFootProgressAngles' : 'R Foot',
        'LFootProgressAngles' : 'L Foot',
        'RHeadAngles' : 'Head',
        'RThoraxAngles' : 'Thorax',
        'RNeckAngles' : 'Neck',
        'RSpineAngles' : 'Spine',
        'RShoulderAngles' : 'R Shoulder',
        'LShoulderAngles' : 'L Shoulder',
        'RElbowAngles' : 'R Elbow',
        'LElbowAngles' : 'L Elbow',
        'RWristAngles' : 'R Wrist',
        'LWristAngles' : 'L Wrist'
    }

    if label in known_labels:
        return label
    elif label in label_aliases:
        return label_aliases[label]
    else:
        return None