def calculate_mag(raw_val):
    """
    Converts the raw value read from the magnetometer.
    Currently does not take calibration into consideration.
    """
    result = raw_val * 2 / ((2**15) - 1)
    return result