A Bayesian approach to high fidelity interferometric calibration I: mathematical formalism | Synapse