Skip to content
Snippets Groups Projects
Commit 5822d8a5 authored by Philipp Arras's avatar Philipp Arras
Browse files

effective_uvwlen as Field

parent 9043f46b
Branches
Tags
1 merge request!25Calibration
Pipeline #106468 passed
......@@ -53,7 +53,7 @@ def main():
polmode = obs.polarization.has_crosshanded()
# TODO Add mode with independent noise learning
effuv = obs.effective_uvwlen()
effuv = obs.effective_uvwlen().val[0]
dom = ift.RGSpace((npix_wgts := 2500), 2 * np.max(effuv) / npix_wgts)
if not polmode:
assert obs.nfreq == obs.npol == 1
......
......@@ -64,7 +64,7 @@ def main():
sky = diffuse
# TODO Add mode with independent noise learning
npix = 2500
effuv = obs.effective_uvwlen()
effuv = obs.effective_uvwlen().val[0]
assert obs.nfreq == obs.npol == 1
dom = ift.RGSpace(npix, 2 * np.max(effuv) / npix)
logwgt = ift.SimpleCorrelatedField(
......
......@@ -458,7 +458,9 @@ class Observation(BaseObservation):
return out
def effective_uvwlen(self):
return np.outer(self.uvwlen(), self._freq / SPEEDOFLIGHT)
arr = np.outer(self.uvwlen(), self._freq / SPEEDOFLIGHT)
arr = np.broadcast_to(arr[None], self._dom.shape)
return ift.makeField(self._dom, arr)
def uvwlen(self):
return np.linalg.norm(self.uvw, axis=1)
......
......@@ -102,7 +102,7 @@ def test_varcov_imaging_likelihood(obs):
@pmp("obs", OBS)
@pmp("noisemodel", range(2))
def test_weighting_methods(obs, noisemodel):
efflen = obs.effective_uvwlen()
efflen = obs.effective_uvwlen().val[0]
npix = 2500
dom = ift.RGSpace(npix, 2 * max(efflen) / npix)
baseline_distributor = ift.LinearInterpolator(dom, efflen.T)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment