Commit cac4019b authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Make two harm variants

parent a86caf22
......@@ -45,7 +45,8 @@ class DummyLocalOscillator(object):
self._frequency = freq
print("Dummy LO set to 1GHz {:+.3f}".format((self._frequency-1*u.GHz).to(u.kHz)))
track_doppler.track_doppler(lo=DummyLocalOscillator(), dt=DummyTelescope(), doppler_function=doppler_frequency)
track_doppler.track_doppler(lo=DummyLocalOscillator(), dt=DummyTelescope())
#track_doppler.track_doppler(lo=DummyLocalOscillator(), dt=DummyTelescope(), doppler_function=doppler_frequency)
if __name__ == '__main__':
unittest.main()
......@@ -15,7 +15,7 @@ import time
freq_hi = 1420.405751 * u.MHz
def doppler_harm(sky_coordinate, time, tracking_frequency, location):
def doppler_harm(sky_coordinate, time, tracking_frequency, location, variant):
ra = sky_coordinate.ra.to(u.rad).value
dec = sky_coordinate.dec.to(u.rad).value
t = time.unix
......@@ -25,16 +25,22 @@ def doppler_harm(sky_coordinate, time, tracking_frequency, location):
argstring = "{ra} {dec} 2000 {time} {dt_lat} {dt_lon} {dt_alt}".format(
ra=ra, dec=dec, time=t, dt_lat=dt_lat, dt_lon=dt_lon, dt_alt=dt_alt)
doppler_executable = "/home/harm/bin/doppler_bl"
doppler_executable = "/home/harm/bin/doppler_"+variant
doppler_cmd = doppler_executable + " " + argstring + " " + str(tracking_frequency.to(u.MHz).value)
freq_doppler = float(subprocess.Popen(doppler_cmd, stdout=subprocess.PIPE, shell=True).stdout.read())
return freq_doppler * u.MHz
def doppler_harm_bl(sky_coordinate, time, tracking_frequency, location):
return doppler_harm(sky_coordinate, time, tracking_frequency, location, 'bl')
def doppler_harm_mb(sky_coordinate, time, tracking_frequency, location):
return doppler_harm(sky_coordinate, time, tracking_frequency, location, 'mb')
def track_doppler(lo=None, dt=None,
tracking_frequency=freq_hi,
doppler_function=doppler_harm,
doppler_function=doppler_harm_bl,
exit_event=None):
"""Sets the Local Oscillator to a frequency to correct for Doppler shift
......
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