def convert_lon(df):
    
    """
    Convert longitudes from 0:360 range to -180:180
    """
    
    df.coords['longitude'] = (df.coords['longitude'] + 180) % 360 - 180
    df = df.sortby(df.longitude)
    
    return df