Commits
Renaud Miel authored and Ville Suoranta committed 406c0764acb Merge
1 1 | from __future__ import absolute_import |
2 2 | import os |
3 3 | import math |
4 4 | import shutil |
5 5 | import string |
6 6 | import time |
7 7 | import re |
8 8 | import copy |
9 + | from typing import TYPE_CHECKING |
9 10 | from casatasks.private.casa_transition import is_CASA6 |
10 11 | |
11 12 | if is_CASA6: |
12 13 | from casatools import ( |
13 14 | synthesisimager, |
14 15 | synthesisdeconvolver, |
15 16 | synthesisnormalizer, |
16 17 | iterbotsink, |
17 18 | ctsys, |
18 19 | table, |
19 20 | image, |
20 21 | ) |
21 22 | from casatasks import casalog |
22 23 | from casatasks.private.imagerhelpers.summary_minor import SummaryMinor |
24 + | if TYPE_CHECKING: |
25 + | from casatasks.private.imagerhelpers.input_parameters import ImagerParameters |
23 26 | |
24 27 | ctsys_hostinfo = ctsys.hostinfo |
25 28 | _tb = table() |
26 29 | _ia = image() |
27 30 | else: |
28 31 | from taskinit import * |
29 32 | from imagerhelpers.summary_minor import SummaryMinor |
33 + | if TYPE_CHECKING: |
34 + | from imagerhelpers.input_parameters import ImagerParameters |
30 35 | |
31 36 | synthesisimager = casac.synthesisimager |
32 37 | synthesisdeconvolver = casac.synthesisdeconvolver |
33 38 | synthesisnormalizer = casac.synthesisnormalizer |
34 39 | # make it look like the CASA6 version even though it's using the CASA5 named tool not present in CASA6 |
35 40 | iterbotsink = casac.synthesisiterbot |
36 41 | |
37 42 | ctsys_hostinfo = casac.cu.hostinfo |
38 43 | |
39 44 | _tb = tb |
40 45 | """ |
41 46 | A set of helper functions for tclean. |
42 47 | |
43 48 | Summary... |
44 49 | |
45 50 | """ |
46 51 | |
47 52 | ############################################# |
48 53 | class PySynthesisImager: |
49 - | def __init__(self, params): |
54 + | def __init__(self, params: 'ImagerParameters'): |
50 55 | ################ Tools |
51 56 | self.initDefaults() |
52 57 | |
53 58 | # Check all input parameters, after partitioning setup. |
54 59 | |
55 60 | # Selection Parameters. Dictionary of dictionaries, indexed by 'ms0','ms1',... |
56 61 | self.allselpars = params.getSelPars() |
57 62 | # Imaging/Deconvolution parameters. Same for serial and parallel runs |
58 63 | self.alldecpars = params.getDecPars() |
59 64 | self.allimpars = params.getImagePars() |