From 444c41327e20ff97386d36a16ee78e88b668774d Mon Sep 17 00:00:00 2001 From: Takeshi Nakazato Date: Fri, 1 Aug 2025 05:20:33 +0000 Subject: [PATCH] _solve will raise an error when no valid visibility data are available. --- python/priism/core/imager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/priism/core/imager.py b/python/priism/core/imager.py index 35107c9..34b238c 100644 --- a/python/priism/core/imager.py +++ b/python/priism/core/imager.py @@ -198,6 +198,12 @@ def solve(self, l1, ltsv, maxiter=50000, eps=1.0e-5, clean_box=None, def _solve(self, mfistaparam, working_set, storeinitialimage=True, overwriteinitialimage=False): assert working_set is not None + if working_set is None or len(working_set.rdata) == 0: + raise RuntimeError( + "No visibility data is given. Please run readvis or gridvis first. " + "If you already did, probably all the visibility data are flagged (invalid). " + "Please check contents of the MS and tweak channel selection appropriately." + ) self.solver.mfistaparam = mfistaparam return self.solver.solve(working_set, self.imparam, storeinitialimage, overwriteinitialimage)