print("===> and filling FLAG/FLAG_ROW using flagmask %s" % Flagger.flagmaskstr(options.fill_legacy)) flagger.xflag(unflag=~flagmask, fill_legacy=options.fill_legacy) flagger.flagsets.remove_flagset(*list(all_flagsets - retain)) sys.exit(0) # parse subset options subset = parse_subset_options(options) if not subset: print("===> ended up with empty subset, exiting") sys.exit(0) # convert timeslots to reltime option, if specified if options.timeslots: from Owlcat import Parsing tslice = Parsing.parse_slice(options.timeslots, options.timeslot_multiplier) times = sorted(set(get_ms().getcol('TIME'))) time0 = times[0] if tslice.start is None else times[tslice.start] time1 = times[-1] if tslice.stop is None else times[tslice.stop - 1] time0 -= times[0] time1 -= times[0] subset['reltime'] = time0, time1 print(" ===> select timeslots %s (reltime %g~%g s)" % (tslice, time0, time1)) # at this stage all remaining options are handled the same way flagstr = unflagstr = legacystr = None if options.flag is not None: flagstr = flagger.flagmaskstr(options.flag) print("===> flagging with flagmask %s" % flagstr) if options.unflag is not None: unflagstr = flagger.flagmaskstr(options.unflag)
print "===> and filling FLAG/FLAG_ROW using flagmask %s" % Flagger.flagmaskstr( options.fill_legacy) flagger.xflag(unflag=~flagmask, fill_legacy=options.fill_legacy) flagger.flagsets.remove_flagset(*list(all_flagsets - retain)) sys.exit(0) # parse subset options subset = parse_subset_options(options) if not subset: print "===> ended up with empty subset, exiting" sys.exit(0) # convert timeslots to reltime option, if specified if options.timeslots: from Owlcat import Parsing tslice = Parsing.parse_slice(options.timeslots, options.timeslot_multiplier) times = sorted(set(get_ms().getcol('TIME'))) time0 = times[0] if tslice.start is None else times[tslice.start] time1 = times[-1] if tslice.stop is None else times[tslice.stop - 1] time0 -= times[0] time1 -= times[0] subset['reltime'] = time0, time1 print " ===> select timeslots %s (reltime %g~%g s)" % ( tslice, time0, time1) # at this stage all remaining options are handled the same way flagstr = unflagstr = legacystr = None if options.flag is not None: flagstr = flagger.flagmaskstr(options.flag) print "===> flagging with flagmask %s" % flagstr
print("===> Flagmask 0, ignoring all flags") elif options.flagmask is not None: flagger = Flagger(msname) flagmask = flagger.lookup_flagmask(options.flagmask) flagger.close() flagger = None print("===> Flagmask is %s (you specified '%s')" % (Flagger.flagmaskstr(flagmask), options.flagmask)) if not flagmask & Flagger.LEGACY: print("===> NB: legacy FLAG/FLAG_ROW columns will be ignored with this flagmask") else: flagmask = Flagger.BITMASK_ALL | Flagger.LEGACY print("===> Using all flags") # parse slice specs try: freqslice = Parsing.parse_slice(options.freqslice) print("===> Channel selection is ", freqslice) except: parser.error("Invalid -L/--channels option. Start:end[:step] or start~end[:step] expected.") try: timeslice = Parsing.parse_slice(options.timeslice) print("===> Timeslot selection is ", timeslice) except: parser.error("Invalid -T/--timeslots option. Start:end[:step] start~end[:step] expected.") # make list of plots plots = [] has_flagplots = False column0 = "CORRECTED_DATA" if column0 not in ms.colnames(): column0 = "DATA"
elif options.flagmask is not None: flagger = Flagger(msname) flagmask = flagger.lookup_flagmask(options.flagmask) flagger.close() flagger = None print "===> Flagmask is %s (you specified '%s')" % ( Flagger.flagmaskstr(flagmask), options.flagmask) if not flagmask & Flagger.LEGACY: print "===> NB: legacy FLAG/FLAG_ROW columns will be ignored with this flagmask" else: flagmask = Flagger.BITMASK_ALL | Flagger.LEGACY print "===> Using all flags" # parse slice specs try: freqslice = Parsing.parse_slice(options.freqslice) print "===> Channel selection is ", freqslice except: parser.error( "Invalid -L/--channels option. Start:end[:step] or start~end[:step] expected." ) try: timeslice = Parsing.parse_slice(options.timeslice) print "===> Timeslot selection is ", timeslice except: parser.error( "Invalid -T/--timeslots option. Start:end[:step] start~end[:step] expected." ) # make list of plots plots = []