Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
HPIB
Commits
cac4019b
Commit
cac4019b
authored
Apr 23, 2018
by
Tammo Jan Dijkema
Browse files
Make two harm variants
parent
a86caf22
Changes
2
Hide whitespace changes
Inline
Side-by-side
test/test_track_doppler.py
View file @
cac4019b
...
@@ -45,7 +45,8 @@ class DummyLocalOscillator(object):
...
@@ -45,7 +45,8 @@ class DummyLocalOscillator(object):
self
.
_frequency
=
freq
self
.
_frequency
=
freq
print
(
"Dummy LO set to 1GHz {:+.3f}"
.
format
((
self
.
_frequency
-
1
*
u
.
GHz
).
to
(
u
.
kHz
)))
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__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
main
()
track_doppler.py
View file @
cac4019b
...
@@ -15,7 +15,7 @@ import time
...
@@ -15,7 +15,7 @@ import time
freq_hi
=
1420.405751
*
u
.
MHz
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
ra
=
sky_coordinate
.
ra
.
to
(
u
.
rad
).
value
dec
=
sky_coordinate
.
dec
.
to
(
u
.
rad
).
value
dec
=
sky_coordinate
.
dec
.
to
(
u
.
rad
).
value
t
=
time
.
unix
t
=
time
.
unix
...
@@ -25,16 +25,22 @@ def doppler_harm(sky_coordinate, time, tracking_frequency, location):
...
@@ -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
(
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
)
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
)
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
())
freq_doppler
=
float
(
subprocess
.
Popen
(
doppler_cmd
,
stdout
=
subprocess
.
PIPE
,
shell
=
True
).
stdout
.
read
())
return
freq_doppler
*
u
.
MHz
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
,
def
track_doppler
(
lo
=
None
,
dt
=
None
,
tracking_frequency
=
freq_hi
,
tracking_frequency
=
freq_hi
,
doppler_function
=
doppler_harm
,
doppler_function
=
doppler_harm
_bl
,
exit_event
=
None
):
exit_event
=
None
):
"""Sets the Local Oscillator to a frequency to correct for Doppler shift
"""Sets the Local Oscillator to a frequency to correct for Doppler shift
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment