Commits
331 331 | refant='0',solint='inf', |
332 332 | corrdepflags=False,corrcomb='none',concatspws=False) |
333 333 | tblocal.open(self.testout) |
334 334 | fl=tblocal.getcol('FLAG') |
335 335 | tblocal.close() |
336 336 | #print(np.sum(fl),np.sum(fl)==16) |
337 337 | #print(fl[:,0,6::10]) # both pols |
338 338 | #print(np.alltrue(fl[:,0,6::10])) |
339 339 | |
340 340 | self.assertTrue(np.sum(fl)==16) # 4 params in 2 pols in 2 spws |
341 - | self.assertTrue(np.alltrue(fl[:,0,6::10])) # both pols flagged |
341 + | self.assertTrue(np.all(fl[:,0,6::10])) # both pols flagged |
342 342 | |
343 343 | |
344 344 | # corrdepflags=True, corrcomb='none' |
345 345 | # ant id=6 pol id=1 only flagged |
346 346 | fringefit(vis=self.polcombtestms, caltable=self.testout, |
347 347 | spw='0,1', |
348 348 | refant='0',solint='inf', |
349 349 | corrdepflags=True,corrcomb='none',concatspws=False) |
350 350 | tblocal.open(self.testout) |
351 351 | fl=tblocal.getcol('FLAG') |
352 352 | tblocal.close() |
353 353 | #print(np.sum(fl),np.sum(fl)==8) |
354 354 | #print(fl[4:,0,6::10]) # 2nd pol only |
355 355 | #print(np.alltrue(fl[4:,0,6::10])) |
356 356 | |
357 357 | self.assertTrue(np.sum(fl)==8) # 4 params in 1 pol in 2 spws |
358 - | self.assertTrue(np.alltrue(fl[4:,0,6::10])) # 2nd pol only flagged |
358 + | self.assertTrue(np.all(fl[4:,0,6::10])) # 2nd pol only flagged |
359 359 | |
360 360 | # corrdepflags=True, corrcomb='stokes' |
361 361 | # ant id=6 completely flagged |
362 362 | # solutions identical in both pols |
363 363 | fringefit(vis=self.polcombtestms, caltable=self.testout, |
364 364 | spw='0,1', |
365 365 | refant='0',solint='inf', |
366 366 | corrdepflags=True,corrcomb='stokes',concatspws=False) |
367 367 | tblocal.open(self.testout) |
368 368 | fl=tblocal.getcol('FLAG') |
369 369 | sol=tblocal.getcol('FPARAM') |
370 370 | tblocal.close() |
371 371 | #print(np.sum(fl),np.sum(fl)==16) |
372 372 | #print(fl[:,0,6::10]) # both pols |
373 373 | #print(np.alltrue(fl[:,0,6::10])) |
374 374 | #print(np.alltrue(sol[0:4,0,:]==sol[4:,0,:])) # same soln in both pols |
375 375 | |
376 376 | self.assertTrue(np.sum(fl)==16) # 4 params in 2 pols in 2 spws |
377 - | self.assertTrue(np.alltrue(fl[:,0,6::10])) # both pols flagged |
378 - | self.assertTrue(np.alltrue(sol[0:4,0,:]==sol[4:,0,:])) # same soln in both pols |
377 + | self.assertTrue(np.all(fl[:,0,6::10])) # both pols flagged |
378 + | self.assertTrue(np.all(sol[0:4,0,:]==sol[4:,0,:])) # same soln in both pols |
379 379 | |
380 380 | # corrdepflags=True, corrcomb='parallel' |
381 381 | # nothing flagged (ant id=6 pol id=0 solutions used for both pols) |
382 382 | # solutions identical in both pols |
383 383 | fringefit(vis=self.polcombtestms, caltable=self.testout, |
384 384 | spw='0,1', |
385 385 | refant='0',solint='inf', |
386 386 | corrdepflags=True,corrcomb='parallel',concatspws=False) |
387 387 | tblocal.open(self.testout) |
388 388 | fl=tblocal.getcol('FLAG') |
389 389 | sol=tblocal.getcol('FPARAM') |
390 390 | tblocal.close() |
391 391 | #print(np.sum(fl),np.sum(fl)==0) # no flagged solutions! |
392 392 | #print(np.alltrue(sol[0:4,0,:]==sol[4:,0,:])) # same soln in both pols |
393 393 | |
394 394 | self.assertTrue(np.sum(fl)==0) # nothing flagged |
395 - | self.assertTrue(np.alltrue(sol[0:4,0,:]==sol[4:,0,:])) # same soln in both pols |
395 + | self.assertTrue(np.all(sol[0:4,0,:]==sol[4:,0,:])) # same soln in both pols |
396 396 | |
397 397 | # corrdepflags=True, corrcomb='stokes', concatspws=True |
398 398 | # ant id=6 fully flagged |
399 399 | # solutions identical in both pols |
400 400 | fringefit(vis=self.polcombtestms, caltable=self.testout, |
401 401 | spw='0,1,2,3',combine='spw', |
402 402 | refant='0',solint='inf', |
403 403 | corrdepflags=True,corrcomb='stokes',concatspws=True) |
404 404 | tblocal.open(self.testout) |
405 405 | fl=tblocal.getcol('FLAG') |
406 406 | sol=tblocal.getcol('FPARAM') |
407 407 | tblocal.close() |
408 408 | # print(np.sum(fl),np.sum(fl)==8) |
409 409 | # print(fl[:,0,6::10]) # both pols |
410 410 | # print(np.alltrue(fl[:,0,6::10])) |
411 411 | # print(np.alltrue(sol[0:4,0,:]==sol[4:,0,:])) # same soln in both pols |
412 412 | self.assertTrue(np.sum(fl)==8) # ant id 6 completely flagged |
413 - | self.assertTrue(np.alltrue(fl[:,0,6::10])) # both pols flagged |
414 - | self.assertTrue(np.alltrue(sol[0:4,0,:]==sol[4:,0,:])) # same soln in both pols |
413 + | self.assertTrue(np.all(fl[:,0,6::10])) # both pols flagged |
414 + | self.assertTrue(np.all(sol[0:4,0,:]==sol[4:,0,:])) # same soln in both pols |
415 415 | |
416 416 | |
417 417 | # corrdepflags=True, corrcomb='parallel', concatspws=True |
418 418 | # no solutions flagged |
419 419 | # solutions identical in both pols |
420 420 | fringefit(vis=self.polcombtestms, caltable=self.testout, |
421 421 | spw='0,1,2,3',combine='spw', |
422 422 | refant='0',solint='inf', |
423 423 | corrdepflags=True,corrcomb='parallel',concatspws=True) |
424 424 | tblocal.open(self.testout) |
425 425 | fl=tblocal.getcol('FLAG') |
426 426 | sol=tblocal.getcol('FPARAM') |
427 427 | tblocal.close() |
428 428 | # print(np.sum(fl),np.sum(fl)==0) # no flagged solutions! |
429 429 | # print(np.alltrue(sol[0:4,0,:]==sol[4:,0,:])) # same soln in both pols |
430 430 | self.assertTrue(np.sum(fl)==0) # nothing flagged |
431 - | self.assertTrue(np.alltrue(sol[0:4,0,:]==sol[4:,0,:])) # same soln in both pols |
431 + | self.assertTrue(np.all(sol[0:4,0,:]==sol[4:,0,:])) # same soln in both pols |
432 432 | |
433 433 | |
434 434 | |
435 435 | |
436 436 | class Fringefit_paramactive_caltable(unittest.TestCase): |
437 437 | prefix = 'n08c1' |
438 438 | msfile = prefix + '.ms' |
439 439 | testcallib = 'testcaltable.txt' |
440 440 | |
441 441 | preapplytable = 'topreapply.cal' |