Commits
Wataru Kawasaki authored 398231470a9 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 - | |
9 + | import pdb |
10 10 | from casatasks.private.casa_transition import is_CASA6 |
11 11 | if is_CASA6: |
12 12 | from casatools import synthesisimager, synthesisnormalizer |
13 13 | from casatasks import casalog |
14 14 | |
15 15 | from .imager_base import PySynthesisImager |
16 16 | from .parallel_imager_helper import PyParallelImagerHelper |
17 17 | synth_imager_name = 'synthesisimager' |
18 18 | synth_imager_import = 'from casatools import synthesisimager' |
19 19 | |
168 168 | + ", gridpars=" + str( ngridpars[str(fld)] ) + ")", node ) ) |
169 169 | self.PH.checkJobs(joblist); |
170 170 | |
171 171 | ############################################# |
172 172 | |
173 173 | def initializeImagers(self): |
174 174 | |
175 175 | #--------------------------------------- |
176 176 | # Check if cfcache exists. |
177 177 | # |
178 - | cfCacheName=self.allgridpars['0']['cfcache']; |
179 - | cfcExists=False; |
180 - | |
178 + | cfCacheName='' |
179 + | if(self.allgridpars['0']['gridder'].startswith('awp')): |
180 + | cfCacheName=self.allgridpars['0']['cfcache'] |
181 + | else: |
182 + | self.allgridpars['0']['cfcache']='' |
183 + | cfcExists=False |
181 184 | if(self.allgridpars['0']['gridder'] == 'awproject' or self.allgridpars['0']['gridder'] == 'awprojectft'): |
182 185 | if (cfCacheName == ''): |
183 186 | cfCacheName = self.allimpars['0']['imagename'] + '.cf' |
184 187 | cfCacheName=self.allgridpars['0']['cfcache'] = cfCacheName |
185 188 | |
186 189 | cfcExists = (os.path.exists(cfCacheName) and os.path.isdir(cfCacheName)); |
187 190 | if (cfcExists): |
188 191 | nCFs = len(os.listdir(cfCacheName)); |
189 192 | if (nCFs == 0): |
190 193 | casalog.post(cfCacheName + " exists, but is empty. Attempt is being made to fill it now.","WARN") |
439 442 | for node in self.listOfNodes: |
440 443 | cmd = "toolsi.reloadcfcache()"; |
441 444 | casalog.post("reloadCFCache, CMD = {} {}".format(node, cmd)) |
442 445 | joblist.append(self.PH.runcmd(cmd,node)); |
443 446 | self.PH.checkJobs(joblist); |
444 447 | ############################################# |
445 448 | def fillCFCache(self): |
446 449 | #casalog.post("-----------------------fillCFCache------------------------------------") |
447 450 | # cflist=[f for f in os.listdir(self.allgridpars['cfcache']) if re.match(r'CFS*', f)]; |
448 451 | # partCFList = |
452 + | if(not str(self.allgridpars['0']['gridder']).startswith("awp")): |
453 + | return |
454 + | |
449 455 | allcflist = self.PH.partitionCFCacheList(self.allgridpars['0']); |
450 456 | cfcPath = "\""+str(self.allgridpars['0']['cfcache'])+"\""; |
451 457 | ftmname = "\""+str(self.allgridpars['0']['gridder'])+"\""; |
452 458 | psTermOn = str(self.allgridpars['0']['psterm']); |
453 459 | aTermOn = str(self.allgridpars['0']['aterm']); |
454 460 | conjBeams = str(self.allgridpars['0']['conjbeams']); |
455 461 | #aTermOn = str(True); |
456 462 | # casalog.post("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") |
457 463 | # casalog.post("AllCFList = ",allcflist) |
458 464 | m = len(allcflist); |