Commit 4bb411b8 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Make trackHI a separate script

parent 0c8ccc6f
......@@ -8,8 +8,10 @@ meta = dict(name='hpib',
author_email='harm.munk@camras.nl',
description='Controlling HPIB-software in the CAMRAS Dwingeloo Radio Telescope',
platforms='Linux, Mac OSX',
py_modules=['hpib', 'camrasdevices'],
scripts=['trackHI.py'],
py_modules=['hpib', 'camrasdevices', 'trackHI'],
entry_points= {
'console_scripts': ['trackHI=trackHI:main'],
},
install_requires=['pyserial']
)
......
#!/usr/bin/env python
import astropy.units as u
import argparse
import track_hi
def main():
parser = argparse.ArgumentParser(description = "Adjust the frequency of the local oscillator to track the HI frequency at the pointing of the telescope")
parser.add_argument("-d", "--doppler-executable", help="Executable for computing the Doppler correction", default="/home/harm/bin/doppler_mb")
parser.add_argument("-f", "--frequency", help="Frequency to track, default is HI frequency at {}".format(track_hi.freq_HI), default=freq_HI, type=float)
args = parser.parse_arguments()
track_hi.track_frequency(tracking_frequency=args.frequency, doppler_executable=args.doppler_executable)
if __name__ == '__main__':
main()
#!/usr/bin/env python
import astropy.units as u
import numpy as np
import argparse
import subprocess
......@@ -9,10 +9,10 @@ from camrasdevices import Receiver, LocalOscillator
import time
freq_HI = 1420.405751
freq_hi = 1420.405751
def track_frequency(lo=LocalOscillator(), dt=telescope(),
tracking_frequency=freq_HI,
tracking_frequency=freq_hi,
doppler_executable="/home/harm/bin/doppler_mb"):
"""Sets the Local Oscillator to a frequency to correct for Doppler shift"""
dt_lat = np.deg2rad(52.812019)
......@@ -31,5 +31,15 @@ def track_frequency(lo=LocalOscillator(), dt=telescope(),
dfreq = 1000.0 + tracking_frequency - freq_doppler
lo.frequency = dfreq * 1e6
if __name__ == '__main__':
def main():
parser = argparse.ArgumentParser(description = "Adjust the frequency of the local oscillator to track the HI frequency at the pointing of the telescope")
parser.add_argument("-d", "--doppler-executable", "Executable for computing the Doppler correction", default="/home/harm/bin/doppler_mb")
parser.add_argument("-f", "--frequency", "Frequency to track, default is HI frequency at {} MHz".format(freq_hi), default=freq_hi, type=float)
args = parser.parse_arguments()
track_frequency(tracking_frequency=args.frequency, doppler_executable=args.doppler_executable)
track_frequency()
if __name__ == '__main__':
main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment