Merged magnetometer and barometer