Benito Marcote 1 month ago
parent
commit
60edb211a1
2 changed files with 8 additions and 5 deletions
  1. +2
    -1
      comment_tasav_file.py
  2. +6
    -4
      flag_weights.py

+ 2
- 1
comment_tasav_file.py View File

@@ -355,7 +355,8 @@ with open(template_comment_file, 'r') as template:
comment_file = open('{}/{}.comment'.format(outputdir, args.experiment.lower()), 'w')
comment_file.write(full_text)
comment_file.close()
print('\nFile {0}.comment created successfully in {1}/.'.format(args.experiment.lower(), outputdir))
print('\nFile {0}.comment created successfully in {1}/.'.format(args.experiment.lower(),
outputdir))


refant, fringe_cutoff, bp_sources, pcal_sources, target_sources, do_pb_cor = get_input_file_info()


+ 6
- 4
flag_weights.py View File

@@ -8,10 +8,12 @@ Options:
threshold : float Visibilities with a weight below the specified
value will be flagged. Must be positive.

Version: 3.1
Date: Mar 2020
Version: 3.2
Date: Mar 2021
Written by Benito Marcote (marcote@jive.eu)

version 3.2 changes (Mar 2021)
- w > 0 condiction moved to > 0.001 to include possible weights at the ~1e-5 level.
version 3.1 changes (Mar 2020)
- Progress bar added.
version 3.0 changes (Apr 2019)
@@ -117,11 +119,11 @@ with pt.table(msdata, readonly=False, ack=False) as ms:
# extract weights and compute new flags based on threshold
weights = ms.getcol(weightcol, startrow=start, nrow=nrow)
# how many non-zero did we flag
flagged_nonzero_before = np.logical_and(flags, weights > 0)
flagged_nonzero_before = np.logical_and(flags, weights > 0.001)
# join with existing flags and count again
flags = np.logical_or(flags, weights < threshold)
flagged_after += np.sum(flags)
flagged_nonzero_after = np.logical_and(flags, weights > 0)
flagged_nonzero_after = np.logical_and(flags, weights > 0.001)
# Saving the total of nonzero flags (in this and previous runs)
# flagged_nonzero += np.sum(np.logical_xor(flagged_nonzero_before, flagged_nonzero_after))
flagged_nonzero += np.sum(flagged_nonzero_after)


Loading…
Cancel
Save