|
|
|
@ -26,7 +26,7 @@ from pyrap import tables as pt
@@ -26,7 +26,7 @@ from pyrap import tables as pt
|
|
|
|
|
import numpy as np |
|
|
|
|
import sys |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
help_msdata = 'Measurement set containing the data to be corrected.' |
|
|
|
|
help_threshold = 'Visibilities with a weight below this value will be flagged. Must be positive.' |
|
|
|
|
help_v = 'Only checks the visibilities to flag (do not flag the data).' |
|
|
|
@ -73,8 +73,10 @@ with pt.table(msdata, readonly=False, ack=False) as ms:
@@ -73,8 +73,10 @@ with pt.table(msdata, readonly=False, ack=False) as ms:
|
|
|
|
|
weights = ms.getcol("WEIGHT") |
|
|
|
|
print('Got {0:9} weights'.format(weights.size)) |
|
|
|
|
indexes = np.where(weights < threshold) |
|
|
|
|
indexes2 = np.where((weights < threshold) & (weights > 0.0)) |
|
|
|
|
print('Got {0:9} bad points'.format(indexes[0].size)) |
|
|
|
|
print('{0:04.3}% of the visibilities to flag\n'.format(100.0*indexes[0].size/weights.size)) |
|
|
|
|
print('{0:04.3}% of the total visibilities to flag\n'.format(100.0*indexes[0].size/weights.size)) |
|
|
|
|
print('{0:04.3}% of actual data (non-zero) to flag\n'.format(100.0*indexes2[0].size/weights.size)) |
|
|
|
|
if verbose: |
|
|
|
|
weights[indexes] = -np.abs(weights[indexes]) |
|
|
|
|
ms.putcol("WEIGHT", weights) |
|
|
|
|