Exemple #1
0
def main(top_block_cls=radiotelescope, options=None):
    logging.basicConfig(
        format="%(asctime)-15s %(levelname)-8s [%(name)s] [%(module)s:%(funcName)s] %(message)s",
        level=logging.DEBUG,
    )
    args = parse_args(sys.argv)

    client = rci.client.Client(client_name='gal_scan')
    client.set_offsets(AZ_OFFSET, EL_OFFSET)

    tbkwargs = {}
    if args.sdr_frequency:
        tbkwargs['sdr_frequency'] = args.sdr_frequency
    if args.bandwidth:
        if args.bandwidth > 5e6:
            raise ValueError("bandwidth must be <5e6")
        tbkwargs['bandwidth'] = args.bandwidth

    tb = top_block_cls(
        client=client,
        sdr_gain=args.gain,
        file_sink_path=os.path.join(args.output_dir, 'receive_block_sink'),
        **tbkwargs
    )
    tb.start()
    logging.info('Receiving ...')

    try:
        s = Survey(args)
        s.run(tb)
    finally:
        tb.stop()
        tb.wait()
Exemple #2
0
def main(top_block_cls=top_block, options=None):
    parser = argparse.ArgumentParser(description='Galactic sky scan')
    parser.add_argument('output_dir', metavar='DIRECTORY',
                        help='output directory to write scan results')
    parser.add_argument('--int-time', type=int, default=30,
                        help='integration time')
    parser.add_argument('--gain', type=int, default=60,
                        help='SDR gain')
    parser.add_argument('--mode', type=Mode, choices=list(Mode), default=Mode.gal)
    parser.add_argument('--step', type=float, default=2.5,
                        help='position step size')
    parser.add_argument('--start', type=float, default=0,
                        help='starting position')
    parser.add_argument('--stop', type=float, default=360,
                        help='ending position')
    args = parser.parse_args()

    iterator_cls = {
        Mode.gal: survey_autoranging.longitude_iterator,
        Mode.az: survey_autoranging.azimuth_iterator,
        }[args.mode]

    iterator = iterator_cls(args.start, args.stop, args.step)

    try:
        os.mkdir(args.output_dir)
    except OSError:
        pass

    client = rci.client.Client(client_name='gal_scan')
    client.set_offsets(az_offset, el_offset)

    tb = top_block_cls(
        client=client,
        file_sink_path=os.path.join(args.output_dir, 'receive_block_sink'),
    )
    tb.start()
    print('Receiving ...')

    band=0
    client.set_band_rx(band, True)
    survey_autoranging.run_survey(tb, savefolder=args.output_dir, gain=args.gain, int_time=args.int_time, iterator=iterator)
    client.set_band_rx(band, False)

    tb.stop()
    tb.wait()
#axis extremes
flo=1420.4-0.75
fhi=1420.4+0.75
##################################################
##################################################
##################################################
            # RCI STUFF #
##################################################
##################################################
##################################################
az_offset=5.5
el_offset=-5.5
import rci.client
client = rci.client.Client("ws://localhost:8502/api/ws")
client.set_offsets(az_offset, el_offset)

def point(az,el): #point the dish
    client.set_azimuth_position(az)
    client.set_elevation_position(el)
    print 'Moving to position ' + str(az)+' , '+str(el)+'.'
    return

def park():
    point(250,50)
    print "Parking"
    return

##################################################
##################################################
##################################################