Commits

Bob Garwood authored efb1bd64578
fix Python 2 iterable/list issue, increase msg level, CAS-12584, via casatasks

gcwrap/python/scripts/task_applycal.py

Modified
214 214 casalog.post("*** Error \'%s\' updating HISTORY"
215 215 % instance, 'WARN')
216 216 except Exception as instance:
217 217 print('*** Error ***', instance)
218 218 mycb.close()
219 219 casalog.post("Error in applycal: %s" % str(instance), "SEVERE")
220 220 raise Exception( "Error in applycal: "+str(instance) )
221 221
222 222 def reportflags(rec):
223 223 try:
224 - if rec.keys().count('origin') == 1 and rec['origin'] \
225 - == 'Calibrater::correct' and rec.keys().count('VisEquation'
226 - ) == 1:
224 + if 'origin' in rec and rec['origin'] \
225 + == 'Calibrater::correct' and 'VisEquation' in rec:
227 226 casalog.post('Calibration apply flagging statistics (among calibrateable spws):'
228 227 )
229 228 VE = rec['VisEquation']
230 229 nterm = len(VE)
231 230 if nterm > 0:
232 231 nVisTotal=VE['nVisTotal']
233 232
234 233 casalog.post(' Total visibilities selected for correction (ncorr x nchan x nrow summed over spws) = '
235 234 + str(nVisTotal))
236 235 casalog.post(' Flags:')
254 253
255 254 if 'table' in VEi:
256 255 flstr += ' (' + VEi['table'] + ')'
257 256 casalog.post(flstr)
258 257 if partlog:
259 258 casalog.post(' ** = Denotes caltable that only corrected a subset of total selected visibilities')
260 259
261 260 except Exception as instance:
262 261 # complain mildly, but don't alarm
263 262 casalog.post('Error formatting some or all of the applycal flagging log info: '
264 - + str(instance))
263 + + str(instance), 'SEVERE')
265 264
266 265

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut