Commits
Ville Suoranta authored 1bbc8096b8c Merge
1 1 | from __future__ import absolute_import |
2 2 | from __future__ import print_function |
3 3 | |
4 + | import platform |
4 5 | import time |
5 6 | import numpy |
6 7 | import os |
7 8 | import shutil |
8 9 | import re |
9 10 | |
10 11 | # get is_CASA6 and is_python3, and import other classes |
11 12 | try: |
12 13 | from casatasks.private.casa_transition import * |
13 14 | except: |
165 166 | growiterations,#=100 |
166 167 | dogrowprune,#=True |
167 168 | verbose): #=False |
168 169 | """ |
169 170 | Runs the minor cycle only of tclean. |
170 171 | Most of this code is copied directly from tclean. |
171 172 | """ |
172 173 | |
173 174 | cppparallel=False |
174 175 | decon=None |
176 + | |
177 + | if interactive: |
178 + | # Check for casaviewer, if it does not exist flag it up front for macOS |
179 + | # since casaviewer is no longer provided by default with macOS. Returning |
180 + | # False instead of throwing an exception results in: |
181 + | # |
182 + | # RuntimeError: No active exception to reraise |
183 + | # |
184 + | # from deconvolve run from casashell. |
185 + | try: |
186 + | import casaviewer as __test_casaviewer |
187 + | except: |
188 + | if platform.system( ) == "Darwin": |
189 + | casalog.post( |
190 + | "casaviewer is no longer available for macOS, for more information see: http://go.nrao.edu/casa-viewer-eol Please restart by setting interactive=F", |
191 + | "WARN", |
192 + | "task_deconvolve", |
193 + | ) |
194 + | raise RuntimeError( "casaviewer is no longer available for macOS, for more information see: http://go.nrao.edu/casa-viewer-eol" ) |
195 + | |
175 196 | try: |
176 197 | |
177 198 | # discard empty start model strings |
178 199 | if type(startmodel) is list: |
179 200 | startmodel = list(filter(lambda v: len(v) > 0, startmodel)) |
180 201 | |
181 202 | # clean input |
182 203 | inp=locals().copy() |
183 204 | inp['msname'] = '' # -> no 'vis' parameter for minor cycle only |
184 205 | inp['cycleniter'] = inp['niter'] |