Commit 5b5477fe authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Prepare for using vlsr correction from astropy

parent 68615186
...@@ -30,6 +30,10 @@ def doppler_harm(sky_coordinate, time, tracking_frequency): ...@@ -30,6 +30,10 @@ def doppler_harm(sky_coordinate, time, tracking_frequency):
return freq_doppler * u.MHz return freq_doppler * u.MHz
def doppler_vlsr(sky_coordinate, time, tracking_frequency):
# TODO: finish this function (wrap doppler_frequency from vlsr
return 42
def track_doppler(lo=None, dt=None, def track_doppler(lo=None, dt=None,
tracking_frequency=freq_hi, tracking_frequency=freq_hi,
doppler_function=doppler_harm, doppler_function=doppler_harm,
...@@ -56,5 +60,5 @@ def track_doppler(lo=None, dt=None, ...@@ -56,5 +60,5 @@ def track_doppler(lo=None, dt=None,
sky_coordinate = dt.radec sky_coordinate = dt.radec
freq_doppler = doppler_function(sky_coordinate, time.time(), tracking_frequency) freq_doppler = doppler_function(sky_coordinate, time.time(), tracking_frequency)
dfreq = 1*u.GHz + tracking_frequency - freq_doppler dfreq = 1*u.GHz + tracking_frequency - freq_doppler
lo.frequency = dfreq * 1e6 lo.frequency = dfreq
exit_event.wait(timeout=0.5) exit_event.wait(timeout=0.5)
...@@ -47,7 +47,7 @@ def doppler_frequency(t: Time, loc: EarthLocation, psrc: SkyCoord, ...@@ -47,7 +47,7 @@ def doppler_frequency(t: Time, loc: EarthLocation, psrc: SkyCoord,
Returns: Returns:
Quantity: Observable frequency Quantity: Observable frequency
""" """
v1 = vlsr(t, loc, psrc) v1 = vlsr(t, loc, psrc, verbose=verbose)
beta = v1/astropy.constants.c beta = v1/astropy.constants.c
return np.sqrt((1 + beta)/(1 - beta)) * rest_frequency return np.sqrt((1 + beta)/(1 - beta)) * rest_frequency
......
Supports Markdown
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