#! /usr/bin/python
# Silly script to point 4 antennas at the 12-m container

import katuilib

kat = katuilib.tbuild('cfg-karoo.ini', 'karoo_ff')

print "Stowing all dishes"
kat.ants.req.target_azel(0.0, 90.0)
kat.ants.req.mode('POINT')
kat.ants.wait('lock', True, 300)

print "Pointing dishes at 12-m container"
kat.ant1.req.target_azel(145., 2.)
kat.ant2.req.target_azel(-145., 2.)
kat.ant3.req.target_azel(146., 2.)
kat.ant4.req.target_azel(136., 2.)

kat.ants.req.mode('POINT')
#!/usr/bin/python
# Write raw data packets from correlator to disk (not HDF5 file). Used for RFI mitigation code testing.

import katpoint
import katuilib
from katuilib import CaptureSession
import uuid
import math

kat = katuilib.tbuild('cfg-local.ini', 'local_ff')

targets = [
    kat.sources["Fornax A"],
    kat.sources["J0440-4333"],
    kat.sources["Zenith"],
    katpoint.construct_azel_target(math.radians(0.0), math.radians(45.0)),
    katpoint.construct_azel_target(math.radians(0.0), math.radians(20.0)),
]

with CaptureSession(kat, str(uuid.uuid1()), 'ffuser', 'RFI data collection',
                    kat.ants) as session:
    session.standard_setup()
    kat.dbe.req.k7w_write_raw(1)

    for target in targets:
        session.track(target, duration=300.0, drive_strategy='shortest-slew')
#!/usr/bin/python
# Create a DBE data stream, capture it and send the data to the signal displays.

import katuilib as katui

kat = katui.tbuild("cfg-local.ini", "local_ff")
 # make fringe fingder connections

kat.k7w.req.capture_start()
 # startup the k7 capture process

kat.dbe.req.dbe_packet_count(900)
 # stream 10 minutes of data or until stop issued
kat.dbe.req.dbe_dump_rate(1)
 # correlator dump rate set to 1 Hz
kat.dbe.req.dbe_capture_destination("stream","127.0.0.1:7010")
 # create a new data source labelled "stream". Send data to localhost on port 7010
kat.dbe.req.dbe_capture_start("stream")
 # start emitting data on stream "stream"

kat.disconnect()
Beispiel #4
0
    print "Please specify at least a target and a cal source"
    sys.exit(1)
# Various non-optional options...
if opts.ants is None:
    print 'Please specify the antennas to use via -a option (yes, this is a non-optional option...)'
    sys.exit(1)
if opts.observer is None:
    print 'Please specify the observer name via -o option (yes, this is a non-optional option...)'
    sys.exit(1)
if opts.experiment_id is None:
    # Generate unique string via RFC 4122 version 1
    opts.experiment_id = str(uuid.uuid1())
# Try to build the given KAT configuration (which might be None, in which case try to reuse latest active connection)
# This connects to all the proxies and devices and queries their commands and sensors
try:
    kat = katuilib.tbuild(opts.ini_file, opts.selected_config)
# Fall back to *local* configuration to prevent inadvertent use of the real hardware
except ValueError:
    kat = katuilib.tbuild('cfg-local.ini', 'local_ff')
print "\nUsing KAT connection with configuration: %s\n" % (kat.get_config(),)

targets = []
for arg in args:
    # With no comma in the target string, assume it's the name of a target to be looked up in the standard catalogue
    if arg.find(',') < 0:
        target = kat.sources[arg]
        if target is None:
            print "Unknown source '%s', skipping it" % (arg,)
        else:
            targets.append(target)
    else:
Beispiel #5
0
#!/usr/bin/python
# Produce various scans across a simulated DBE target producing scan data for signal displays and loading into scape (using CaptureSession).

from __future__ import with_statement

import katuilib

target = 'Takreem,azel,45,10'
Session = katuilib.observe.CaptureSession

with katuilib.tbuild() as kat:

    # Tell the DBE sim to make a test target at specfied az and el and with specified flux
    kat.dbe.req.dbe_test_target(45, 10, 100)
    nd_params = {'diode': 'coupler', 'on': 3.0, 'off': 3.0, 'period': 40.}

    with Session(kat, 'id', 'nobody', 'The scan zoo', kat.ants,
                 True) as session:
        session.standard_setup(1822., 1., nd_params)
        session.track(target, duration=5.0)
        session.fire_noise_diode('coupler', 5.0, 5.0)
        session.scan(target, duration=20.0)
        session.raster_scan(target, scan_duration=20.0)