Commit 89662c2d authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Rename track_hi to track_doppler

parent a32df349
#!/usr/bin/env python3
import track_doppler
from astropy.coordinates import SkyCoord
import astropy.units as u
class DummyTelescope():
def __init__(self):
pass
def getJ2000(self):
for i in range(3):
fake_pointing = SkyCoord(ra=0.*u.deg, dec=31.*u.deg)
yield {'radec': fake_pointing,}
class DummyLocalOscillator():
def __init__(self):
self._frequency = 0
pass
@property
def frequency(self):
return self._frequency
@frequency.setter
def frequency(self, freq):
self._frequency = freq
print("Dummy LO set to {}".format(self._frequency))
track_hi.track_frequency(lo=DummyLocalOscillator(), dt=DummyTelescope())
......@@ -2,16 +2,16 @@
import astropy.units as u
import argparse
import track_hi
import track_doppler
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 = argparse.ArgumentParser(description = "Adjust the frequency of the local oscillator to Doppler track a 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=track_hi.freq_hi, type=float)
args = parser.parse_args()
track_hi.track_frequency(tracking_frequency=args.frequency, doppler_executable=args.doppler_executable)
track_doppler.track_frequency(tracking_frequency=args.frequency, doppler_executable=args.doppler_executable)
if __name__ == '__main__':
main()
......@@ -11,9 +11,9 @@ import time
freq_hi = 1420.405751
def track_frequency(lo=None, dt=None,
tracking_frequency=freq_hi,
doppler_executable="/home/harm/bin/doppler_mb"):
def track_doppler(lo=None, dt=None,
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)
dt_lon = np.deg2rad(6.396169)
......@@ -35,16 +35,3 @@ def track_frequency(lo=None, dt=None,
freq_doppler = float(subprocess.Popen(doppler_cmd, stdout=subprocess.PIPE, shell=True).stdout.read())
dfreq = 1000.0 + tracking_frequency - freq_doppler
lo.frequency = dfreq * 1e6
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