public static int degreesUnitStringToIndex(String unit) {
       switch (unit) {
            case "true":
                return 0;
            case "magnetic":
                return 1;
            case "relative":
                return 2;
            default:
                return 0;
        } 
    }