Beispiel #1
0
import os

NFBIN = 4
IFSEL = 1
FREQ = '7700'

primary = f"{mu.primary}.{FREQ}"
secondary = f"{mu.secondary}.{FREQ}"
mosaic = f"{mu.science}.{FREQ}"

# Load in the data
atlod = mu.mirstr(f"atlod in=raw/*C3171 options=rfiflag,birdie,xycorr,noauto ifsel={IFSEL} out=data{IFSEL}.uv").run()
print(atlod)

# Flag the known bad channels out
mu.uvflag(atlod.attribute('out'), mu.flags_7)

# Split the data up
uvsplit = mu.mirstr(f"uvsplit vis={atlod.attribute('out')} options=mosaic").run()
print(uvsplit)

# Primary calibration
mfcal = mu.mirstr(f'mfcal vis={primary} interval=0.1').run()
gpcal = mu.mirstr(f'gpcal vis={primary} interval=0.1 nfbin={NFBIN} options=xyvary').run()

print(mfcal)
print(gpcal)

# Automated flagging
pgflag = mu.mirstr(f"pgflag vis={primary} command='<b' stokes=i,q,u,v flagpar=8,5,5,3,6,3 options=nodisp").run()
print(pgflag)
# Initial pass of the data loads in without the Tsys correction to produce a
# robust spectrum of the secondary calibrator
for index, freq in enumerate(FREQS):
    ifsel = index + 1
    primary = f"{mu.primary}.{freq}"
    secondary = f"{mu.secondary}.{freq}"
    mosaic = f"{mu.science}.{freq}"

    # Load in the data
    atlod = m(f"atlod in=raw/*C3171 options=notsys,rfiflag,birdie,xycorr,noauto "\
              f"ifsel={ifsel} out=data{ifsel}.uv").run()
    logger.log(logging.INFO, atlod)

    # Flag the known bad channels out
    if ifsel == 1:
        mu.uvflag(atlod.out, mu.flags_7)
    else:
        mu.uvflag(atlod.out, mu.flags_9)

    # Split the data up
    uvsplit = m(f"uvsplit vis={atlod.out} options=mosaic "\
                f"select=source({mu.primary}),source({mu.secondary})").run()
    logger.log(logging.INFO, uvsplit)

    mfcal = m(f"mfcal vis={primary} interval=0.1,0.1,5").run()
    gpcal = m(f"gpcal vis={primary} interval=0.1 nfbin={NFBIN} "\
              f"options=xyvary").run()
    logger.log(logging.INFO, mfcal)
    logger.log(logging.INFO, gpcal)

    mu.calibrator_pgflag(primary)
Beispiel #3
0
# Example loading in files assuming first is setup
# files = glob('raw/*C3132').pop(0)

# Glob order is not the same as sort order
# Can lead to problems with 0 and 9s.
files = sorted(files)

# Load in data. Remember to set ifsel appropriately
atlod = m(
    f"atlod in={','.join(files)} out=data5.uv ifsel=1 options=birdie,rfiflag,noauto,xycorr"
).run()
logger.log(logging.INFO, atlod)

# Flag out known bad channels
mu.uvflag(atlod.out, mu.flags_5)

uvsplit = m(f"uvsplit vis={atlod.out} options=mosaic").run()
logger.log(logging.INFO, uvsplit)

# Deduce the objects in the observing run
srcs = mu.derive_obs_sources(uvsplit, FREQ)
primary, secondary, mosaic_targets = srcs

mu.calibrator_pgflag(primary)

mfcal = m(f"mfcal vis={primary} refant=4 interval=0.1").run()
logger.log(logging.INFO, mfcal)

gpcal = m(
    f"gpcal vis={primary} refant=4 interval=0.1 nfbin={NFBIN} options=xyvary"