Пример #1
0
    def point_src_id(self,
                     src_id,
                     ant_list,
                     offsource=False,
                     az_off=0,
                     el_off=0):
        ''' This function points the antenna at the source
            designated by the given ID from the ATA catalog. '''

        now = datetime.now()
        src_ra, src_dec = ac.get_source_ra_dec(src_id)

        if self.pos.isUp('radec', now, src_ra, src_dec):
            ac.create_ephems2(src_id, az_off, el_off)
            if not offsource:
                ac.point_ants2(src_id, 'on', ant_list)
                #if not self.is_configured:
                #ac.autotune(ant_list)
                #print("\nAutotuned.\n")
            else:
                ac.point_ants2(src_id, 'off', ant_list)
                #if not self.is_configured:
                #ac.autotune(ant_list)
                #print("\nAutotuned.\n")
        else:
            print(
                "Source {0} is not up yet. Update source list and try again.".
                format(src_id))
            return
Пример #2
0
    def point_src_id(self,
                     src_id,
                     ant_list,
                     offsource=False,
                     az_off=0,
                     el_off=0):
        ''' This function points the antenna at the source
            designated by the given ID from the ATA catalog. '''

        now = datetime.now()

        # TODO: check if the source is up.
        # A former version of gr-ata checked this, but the method it used
        # does not work any longer.
        source_is_up = True
        if source_is_up:
            ac.create_ephems2(src_id, az_off, el_off)
            if not offsource:
                ac.point_ants2(src_id, 'on', ant_list)
                #if not self.is_configured:
                #ac.autotune(ant_list)
                #print("\nAutotuned.\n")
            else:
                ac.point_ants2(src_id, 'off', ant_list)
                #if not self.is_configured:
                #ac.autotune(ant_list)
                #print("\nAutotuned.\n")
        else:
            print(
                "Source {0} is not up yet. Update source list and try again.".
                format(src_id))
            return
Пример #3
0
def main():
    logger = logger_defaults.getProgramLogger("observe", loglevel=logging.INFO)

    az_offset = 20.
    el_offset = 0.

    ant_list = ["2b"]
    source = "moon"
    ata_control.reserve_antennas(ant_list)
    atexit.register(ata_control.release_antennas, ant_list, False)

    ata_control.create_ephems2(source, az_offset, el_offset)

    ata_control.point_ants2(source, "off", ant_list)
    #ata_control.autotune(ant_list)

    _ = input("Press any key to switch to on source")
    ata_control.point_ants2(source, "on", ant_list)
    print("on source acquired")
Пример #4
0
def main():
    logger = logger_defaults.getProgramLogger("observe", 
            loglevel=logging.INFO)
    #parser = argparse.ArgumentParser(description="Observing script")
    #parser.add_argument("ants", nargs="+", help="ant names")
    #args = parser.parse_args()
    #ants = args.ants
    nbatches = 15
    ant_list = ["1a","1c","1f","2a","2b","2h","4g","5c"]
    az_offset = 0
    el_offset = 10
    obs_time = 30
    source = "casa"
    #source = "moon"

    ata_control.try_on_lnas(ant_list)

    #ata_control.make_and_track_ephems(source, ant_list)
    ata_control.create_ephems2(source, az_offset, el_offset)


    #freqs = np.arange(1200, 8000, 400)
    freqs = np.arange(1000, 11000, 500)

    for freq in freqs:
        print (freq)
        ata_control.set_freq(freq, ant_list)

        # record on
        ata_control.point_ants2(source, "on", ant_list)
        ant_list.append('rfi')
        utc = snap_dada.start_recording(ant_list, obs_time)
        ant_list.remove('rfi')

        # record off
        ata_control.point_ants2(source, "off", ant_list)
        ant_list.append('rfi')
        utc = snap_dada.start_recording(ant_list, obs_time)
        ant_list.remove('rfi')
    ata_control.release_antennas(ant_list, True)
Пример #5
0
def main():
    logger = logger_defaults.getProgramLogger("observe", loglevel=logging.INFO)

    # moon observation
    az_offset = 20.
    el_offset = 0.

    #ant_list = ["1a", "1f", "1c", "2a", "2b", "3d",
    #        "4g", "1k", "5c", "1h", "4j", "2h"]
    ant_list = [
        "1c", "1e", "1g", "1h", "1k", "2a", "2b", "2c", "2e", "2h", "2j", "2k",
        "2l", "2m", "3c", "3d", "3l", "4j", "5b", "4g"
    ]

    antlo_list = [ant + "B" for ant in ant_list]

    #ant_list = [antlo[:-1] for antlo in antlo_list]

    ata_control.reserve_antennas(ant_list)
    atexit.register(ata_control.release_antennas, ant_list, False)

    obs_time = 30
    n_on_off = 1

    source = "moon"
    ata_control.create_ephems2(source, az_offset, el_offset)

    ata_control.point_ants2(source, "off", ant_list)
    ata_control.autotune(ant_list)

    #freqs = np.arange(1200, 9500, 350)
    #freqs = np.arange(1200, 11200, 350)
    #freqs = np.arange(1200, 1900, 350)
    freqs = np.arange(2250, 11200, 550)

    #snap_dada.set_freq_auto([freqs[0]]*len(ant_list), ant_list)
    #ata_control.set_freq([freqs[0]]*len(ant_list), ant_list, lo='a')
    ata_control.set_freq([freqs[0]] * len(ant_list), ant_list, lo='b')

    snap_if.tune_if_antslo(antlo_list)
    time.sleep(30)

    utcs_all = []
    for ifreq, freq in enumerate(freqs):
        utcs_this_freq = []
        if ifreq != 0:
            #ata_control.set_freq([freq]*len(ant_list), ant_list, lo='a')
            time.sleep(20)
            ata_control.set_freq([freq] * len(ant_list), ant_list, lo='b')
            snap_if.tune_if_antslo(antlo_list)

        for i in range(n_on_off):
            # record on
            ata_control.point_ants2(source, "on", ant_list)

            ntries = 0
            while True:
                try:
                    utc = snap_dada.start_recording(antlo_list,
                                                    obs_time,
                                                    npolout=2,
                                                    acclen=120 * 16,
                                                    disable_rfi=True)
                    break
                except Exception as e:
                    print("Got exception")
                    print(e)
                    ntries += 1
                    if ntries > 3:
                        raise e
                    time.sleep(0.5)

            utcs_this_freq.append(utc)
            mv_utc_antlo_to_ant(utc)
            os.system("killall ata_udpdb")

            #record off
            ata_control.point_ants2(source, "off", ant_list)

            ntries = 0
            while True:
                try:
                    utc = snap_dada.start_recording(antlo_list,
                                                    obs_time,
                                                    npolout=2,
                                                    acclen=120 * 16,
                                                    disable_rfi=True)
                    break
                except Exception as e:
                    print("Got Exception")
                    print(e)
                    ntries += 1
                    if ntries > 3:
                        raise e
                    time.sleep(0.5)

            utcs_this_freq.append(utc)
            mv_utc_antlo_to_ant(utc)
            os.system("killall ata_udpdb")

        utcs_all.append(utcs_this_freq)

    initial_utc = utcs_all[0][0]

    os.system("mkdir /mnt/datax-netStorage-40G/calibration/" + initial_utc)
    for freq, utcs in zip(freqs, utcs_all):
        os.system("mkdir /mnt/datax-netStorage-40G/calibration/%s/freq_%i" %
                  (initial_utc, freq))
        for utc in utcs:
            os.system(
                "mv /mnt/buf0/obs/%s /mnt/datax-netStorage-40G/calibration/%s/freq_%i"
                % (utc, initial_utc, freq))

    os.system(
        "/home/obsuser/scripts/fil2csv.py /mnt/datax-netStorage-40G/calibration/%s/*/*/*/*.fil"
        % (initial_utc))
    """
    os.system("mkdir /mnt/datax-netStorage-40G/calibration/"+initial_utc)
    for freq, utcs in zip(freqs, utcs_all):
        for utc in utcs:
            os.system("mv /mnt/buf0/obs/%s /mnt/datax-netStorage-40G/calibration/%s"
                    %(utc, initial_utc))
    """

    o = open("/mnt/datax-netStorage-40G/calibration/obs.dat", "a")
    o.write("%s %s %i\n" % (initial_utc, source, n_on_off))
    o.close()
Пример #6
0
def main():
    logger = logger_defaults.getProgramLogger("observe", loglevel=logging.INFO)

    # casa observation
    az_offset = 20.
    el_offset = 0.

    ant_list = [
        "1a", "1f", "1c", "2a", "2b", "2h", "3c", "4g", "1k", "5c", "1h", "4j"
    ]
    ata_control.reserve_antennas(ant_list)
    atexit.register(ata_control.release_antennas, ant_list, False)

    obs_time = 30
    n_on_off = 1

    source = "casa"
    ata_control.create_ephems2(source, az_offset, el_offset)

    ata_control.point_ants2(source, "off", ant_list)
    ata_control.autotune(ant_list)

    #freqs = np.arange(1200, 9500, 350)
    #freqs = np.arange(1200, 11200, 350)
    #freqs = np.arange(1200, 1900, 350)
    #freqs = np.arange(2250, 11200, 550)
    freqs = [3500, 4500, 5500, 6500, 7500]

    snap_dada.set_freq_auto([freqs[0]] * len(ant_list), ant_list)
    time.sleep(30)
    snap_if.tune_if_ants(ant_list)

    utcs_all = []
    for ifreq, freq in enumerate(freqs):
        utcs_this_freq = []
        if ifreq != 0:
            snap_dada.set_freq_auto([freq] * len(ant_list), ant_list)
            snap_if.tune_if_ants(ant_list)

        for i in range(n_on_off):
            # record on
            ata_control.point_ants2(source, "on", ant_list)

            utc = snap_dada.start_recording(ant_list,
                                            obs_time,
                                            npolout=2,
                                            acclen=120 * 16,
                                            disable_rfi=True)

            utcs_this_freq.append(utc)
            os.system("killall ata_udpdb")

            #record off
            ata_control.point_ants2(source, "off", ant_list)

            utc = snap_dada.start_recording(ant_list,
                                            obs_time,
                                            npolout=2,
                                            acclen=120 * 16,
                                            disable_rfi=True)

            utcs_this_freq.append(utc)
            os.system("killall ata_udpdb")

        utcs_all.append(utcs_this_freq)

    initial_utc = utcs_all[0][0]

    os.system("mkdir /mnt/datax-netStorage-40G/calibration/" + initial_utc)
    for freq, utcs in zip(freqs, utcs_all):
        os.system("mkdir /mnt/datax-netStorage-40G/calibration/%s/freq_%i" %
                  (initial_utc, freq))
        for utc in utcs:
            os.system(
                "mv /mnt/buf0/obs/%s /mnt/datax-netStorage-40G/calibration/%s/freq_%i"
                % (utc, initial_utc, freq))

    os.system(
        "/home/obsuser/scripts/fil2csv.py /mnt/datax-netStorage-40G/calibration/%s/*/*/*/*.fil"
        % (initial_utc))

    o = open("/mnt/datax-netStorage-40G/calibration/obs.dat", "a")
    o.write("%s %s %i\n" % (initial_utc, source, n_on_off))
    o.close()
Пример #7
0
def main():
    logger = logger_defaults.getProgramLogger("observe", 
            loglevel=logging.INFO)

    # moon observation
    az_offset = 20
    el_offset = 0

    #ant_list = ["1a", "1f", "1c", "2a", "2b", "2h",
    #        "3c", "4g", "1k", "5c", "1h", "4j"]
    ant_list = ["1c", "2a", "2b", "2h",
            "3c", "4g", "1k", "1h", "4j"]
    ata_control.reserve_antennas(ant_list)
    atexit.register(ata_control.release_antennas,ant_list, False)

    obs_time = 30

    source = "virgo"
    ata_control.create_ephems2(source, az_offset, el_offset)

    ata_control.point_ants2(source, "on", ant_list)
    ata_control.autotune(ant_list)

    freqs = np.arange(1200, 10500, 350)
    #freqs = np.arange(1200, 1900, 350)

    utcs_all = []
    for freq in freqs:
        utcs_this_freq = []
        snap_dada.set_freq_auto([freq]*len(ant_list), ant_list)
        snap_if.tune_if_ants(ant_list)

        for i in range(3):
            # record on
            ata_control.point_ants2(source, "on", ant_list)

            i = 0
            while i < 3:
                try:
                    utc = snap_dada.start_recording(ant_list, obs_time, 
                            npolout=2, acclen=120*16, disable_rfi=True)
                    break
                except:
                    i += 1

            utcs_this_freq.append(utc)

            #record off
            ata_control.point_ants2(source, "off", ant_list)

            i = 0
            while i < 3:
                try:
                    utc = snap_dada.start_recording(ant_list, obs_time, 
                            npolout=2, acclen=120*16, disable_rfi=True)
                    break
                except:
                    i += 1

            utcs_this_freq.append(utc)

        utcs_all.append(utcs_this_freq)

    initial_utc = utcs_all[0][0]

    os.system("mkdir /mnt/datax-netStorage-40G/calibration/"+initial_utc)
    for freq, utcs in zip(freqs, utcs_all):
        os.system("mkdir /mnt/datax-netStorage-40G/calibration/%s/freq_%i"
                %(initial_utc, freq))
        for utc in utcs:
            os.system("mv /mnt/buf0/obs/%s /mnt/datax-netStorage-40G/calibration/%s/freq_%i"
                    %(utc, initial_utc, freq))
Пример #8
0
def main():
    logger = logger_defaults.getProgramLogger("observe", 
            loglevel=logging.INFO)

    """
    # moon observation
    az_offset = 0
    el_offset = 20
    freqs = np.arange(1000, 11000, 500)
    ant_list = ['1a', '1c', '1f', '2a', '2b', '2h', '4g', '5c']
    ata_control.reserve_antennas(ant_list)
    obs_time = 30
    source = "moon"
    ata_control.create_ephems2(source, az_offset, el_offset)
    for i in range(1):
        for freq in freqs:
            print (freq)
            ata_control.set_freq(freq, ant_list)
            os.system(ATTEMP_SCRIPT)

            # record on
            ata_control.point_ants2(source, "on", ant_list)
            ant_list.append('rfi')
            utc = snap_dada.start_recording(ant_list, obs_time, 
                    acclen=160*80)
            ant_list.remove('rfi')

            # record off
            ata_control.point_ants2(source, "off", ant_list)
            ant_list.append('rfi')
            utc = snap_dada.start_recording(ant_list, obs_time,
                    acclen=160*80)
            ant_list.remove('rfi')
    """

    # Casa observation
    az_offset = 0
    el_offset = 10
    freqs = np.arange(1000, 11000, 500)
    ant_list = ['1a', '1c', '2a', '2b', '2h', '4g']
    ata_control.reserve_antennas(ant_list)
    """
    obs_time = 30
    source = "casa"
    ata_control.create_ephems2(source, az_offset, el_offset)
    for i in range(1):
        for freq in freqs:
            print (freq)
            ata_control.set_freq(freq, ant_list)
            os.system(ATTEMP_SCRIPT)

            # record on
            ata_control.point_ants2(source, "on", ant_list)
            #ant_list.append('rfi')
            utc = snap_dada.start_recording(ant_list, obs_time, 
                    acclen=160*80)
            #ant_list.remove('rfi')

            # record off
            ata_control.point_ants2(source, "off", ant_list)
            #ant_list.append('rfi')
            utc = snap_dada.start_recording(ant_list, obs_time,
                    acclen=160*80)
            #ant_list.remove('rfi')
    """

    
    # Magnetar observation
    ant_list = ["1c", "2a", "2b", "2h"]
    freq = 1600
    ata_control.set_freq(freq, ant_list)

    source = "J1934+2153"
    ata_control.make_and_track_ephems(source, ant_list)
    obs_time = 3600
    os.system(ATTEMP_SCRIPT)

    for i in range(7):
        ata_control.make_and_track_ephems(source, ant_list)
        utc = snap_dada.start_recording(ant_list, obs_time)
        print (utc)


    # casa observation
    az_offset = 0
    el_offset = 10
    freqs = np.arange(1000, 11000, 500)
    ant_list = ['1a',  '1c', '2a', '2b', '2h', '4g']
    obs_time = 30
    source = "casa"
    ata_control.create_ephems2(source, az_offset, el_offset)
    for i in range(1):
        for freq in freqs:
            print (freq)
            ata_control.set_freq(freq, ant_list)
            os.system(ATTEMP_SCRIPT)

            # record on
            ata_control.point_ants2(source, "on", ant_list)
            #ant_list.append('rfi')
            utc = snap_dada.start_recording(ant_list, obs_time, 
                    acclen=160*80)
            #ant_list.remove('rfi')

            # record off
            ata_control.point_ants2(source, "off", ant_list)
            #ant_list.append('rfi')
            utc = snap_dada.start_recording(ant_list, obs_time,
                    acclen=160*80)
            #ant_list.remove('rfi')
    ant_list = ['1a',  '1c', '2a', '2b', '2h', '4g']
    ata_control.release_antennas(ant_list, True)
Пример #9
0
from ATATools import ata_control
import atexit

az_offset = 20.
el_offset = 0.

ant_list = ["1a", "1f", "1c", "2a", "2b", "2h",
        "3c", "4g", "1k", "5c", "1h", "4j"]

ata_control.reserve_antennas(ant_list)
atexit.register(ata_control.release_antennas,ant_list, False)

source = "casa"
ata_control.create_ephems2(source, az_offset, el_offset)

ata_control.point_ants2(source, "on", ant_list)

ata_control.point_ants2(source, "off", ant_list) #this failes