<commit_before>
import sys

'''
Plot visibility data for each spw to allow for easy manual flags
'''

vis = sys.argv[1]
field = sys.argv[2]
corrstring = sys.argv[3]

tb.open(vis + '/SPECTRAL_WINDOW')
freqs = tb.getcol('REF_FREQUENCY')
nchans = tb.getcol('NUM_CHAN')
tb.close()

spws = range(0, len(freqs))


for spw in spws:
    nchan = nchans[spw]

    print "On " + str(spw+1) + " of " + str(len(freqs))

    default('plotms')
    vis = vis
    xaxis = 'channel'
    yaxis = 'amp'
    ydatacolumn = 'corrected'
    selectdata = True
    field = field
    spw = str(spw)
    correlation = corrstring
    averagedata = True
    avgtime = '1e8s'
    avgscan = False
    transform = False
    extendflag = False
    iteraxis = ''
    coloraxis = 'antenna2'
    plotrange = []
    xlabel = ''
    ylabel = ''
    showmajorgrid = False
    showminorgrid = False
    plotms()

    raw_input("Continue?")

    default('plotms')
    vis = vis
    xaxis = 'channel'
    yaxis = 'phase'
    ydatacolumn = 'corrected'
    selectdata = True
    field = field
    spw = str(spw)
    correlation = corrstring
    averagedata = True
    avgtime = '1e8s'
    avgscan = False
    transform = False
    extendflag = False
    iteraxis = ''
    coloraxis = 'antenna2'
    plotrange = []
    xlabel = ''
    ylabel = ''
    showmajorgrid = False
    showminorgrid = False
    plotms()

    raw_input("Continue?")

    default('plotms')
    vis = vis
    xaxis = 'time'
    yaxis = 'amp'
    ydatacolumn = 'corrected'
    selectdata = True
    field = field
    spw = str(spw)
    correlation = corrstring
    averagedata = True
    avgchannel = str(nchan)
    avgscan = False
    transform = False
    extendflag = False
    iteraxis = ''
    coloraxis = 'antenna2'
    plotrange = []
    xlabel = ''
    ylabel = ''
    showmajorgrid = False
    showminorgrid = False
    plotms()

    raw_input("Continue?")

    default('plotms')
    vis = vis
    xaxis = 'time'
    yaxis = 'phase'
    ydatacolumn = 'corrected'
    selectdata = True
    field = field
    spw = str(spw)
    correlation = corrstring
    averagedata = True
    avgchannel = str(nchan)
    avgscan = False
    transform = False
    extendflag = False
    iteraxis = ''
    coloraxis = 'antenna2'
    plotrange = []
    xlabel = ''
    ylabel = ''
    showmajorgrid = False
    showminorgrid = False
    plotms()

    raw_input("Continue?")

    default('plotms')
    vis = vis
    xaxis = 'uvwave'
    yaxis = 'amp'
    ydatacolumn = 'corrected'
    selectdata = True
    field = field
    spw = str(spw)
    correlation = corrstring
    averagedata = True
    avgchannel = str(nchan)
    avgtime = '1e8s'
    avgscan = False
    transform = False
    extendflag = False
    iteraxis = ''
    coloraxis = 'antenna2'
    plotrange = []
    xlabel = ''
    ylabel = ''
    showmajorgrid = False
    showminorgrid = False
    plotms()

    raw_input("Continue?")
<commit_msg>Allow for interactive inputs<commit_after>
import sys

'''
Plot visibility data for each spw to allow for easy manual flags
'''

try:
    vis = sys.argv[1]
    field = sys.argv[2]
    corrstring = sys.argv[3]
except IndexError:
    vis = raw_input("MS Name? : ")
    field = raw_input("Field Name/Number? : ")
    corrstring = raw_input("Corrstring? : ")

tb.open(vis + '/SPECTRAL_WINDOW')
freqs = tb.getcol('REF_FREQUENCY')
nchans = tb.getcol('NUM_CHAN')
tb.close()

spws = range(0, len(freqs))


for spw in spws:
    nchan = nchans[spw]

    print "On " + str(spw+1) + " of " + str(len(freqs))

    default('plotms')
    vis = vis
    xaxis = 'channel'
    yaxis = 'amp'
    ydatacolumn = 'corrected'
    selectdata = True
    field = field
    spw = str(spw)
    correlation = corrstring
    averagedata = True
    avgtime = '1e8s'
    avgscan = False
    transform = False
    extendflag = False
    iteraxis = ''
    coloraxis = 'antenna2'
    plotrange = []
    xlabel = ''
    ylabel = ''
    showmajorgrid = False
    showminorgrid = False
    plotms()

    raw_input("Continue?")

    default('plotms')
    vis = vis
    xaxis = 'channel'
    yaxis = 'phase'
    ydatacolumn = 'corrected'
    selectdata = True
    field = field
    spw = str(spw)
    correlation = corrstring
    averagedata = True
    avgtime = '1e8s'
    avgscan = False
    transform = False
    extendflag = False
    iteraxis = ''
    coloraxis = 'antenna2'
    plotrange = []
    xlabel = ''
    ylabel = ''
    showmajorgrid = False
    showminorgrid = False
    plotms()

    raw_input("Continue?")

    default('plotms')
    vis = vis
    xaxis = 'time'
    yaxis = 'amp'
    ydatacolumn = 'corrected'
    selectdata = True
    field = field
    spw = str(spw)
    correlation = corrstring
    averagedata = True
    avgchannel = str(nchan)
    avgscan = False
    transform = False
    extendflag = False
    iteraxis = ''
    coloraxis = 'antenna2'
    plotrange = []
    xlabel = ''
    ylabel = ''
    showmajorgrid = False
    showminorgrid = False
    plotms()

    raw_input("Continue?")

    default('plotms')
    vis = vis
    xaxis = 'time'
    yaxis = 'phase'
    ydatacolumn = 'corrected'
    selectdata = True
    field = field
    spw = str(spw)
    correlation = corrstring
    averagedata = True
    avgchannel = str(nchan)
    avgscan = False
    transform = False
    extendflag = False
    iteraxis = ''
    coloraxis = 'antenna2'
    plotrange = []
    xlabel = ''
    ylabel = ''
    showmajorgrid = False
    showminorgrid = False
    plotms()

    raw_input("Continue?")

    default('plotms')
    vis = vis
    xaxis = 'uvwave'
    yaxis = 'amp'
    ydatacolumn = 'corrected'
    selectdata = True
    field = field
    spw = str(spw)
    correlation = corrstring
    averagedata = True
    avgchannel = str(nchan)
    avgtime = '1e8s'
    avgscan = False
    transform = False
    extendflag = False
    iteraxis = ''
    coloraxis = 'antenna2'
    plotrange = []
    xlabel = ''
    ylabel = ''
    showmajorgrid = False
    showminorgrid = False
    plotms()

    raw_input("Continue?")

{'fraction_non_alphanumeric': 0.11192294918631684, 'fraction_numerical': 0.005313849219528396, 'mean_word_length': 2.355431754874652, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1177991', 'n_tokens_mistral': 2155, 'n_tokens_neox': 2065, 'n_words': 492}