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
bafe129c
Commit
bafe129c
authored
Apr 13, 2018
by
Tammo Jan Dijkema
Browse files
Add trackHI.py
parent
7caaa6e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
setup.py
100644 → 100755
View file @
bafe129c
...
...
@@ -9,6 +9,7 @@ meta = dict(name='hpib',
description
=
'Controlling HPIB-software in the CAMRAS Dwingeloo Radio Telescope'
,
platforms
=
'Linux, Mac OSX'
,
py_modules
=
[
'hpib'
,
'camrasdevices'
],
scripts
=
[
'trackHI.py'
],
install_requires
=
[
'pyserial'
]
)
...
...
trackHI.py
0 → 100755
View file @
bafe129c
#!/usr/bin/env python
import
astropy.units
as
u
import
numpy
as
np
import
subprocess
from
telescope
import
telescope
from
camrasdevices
import
Receiver
,
LocalOscillator
import
time
freq_HI
=
1420.405751
def
track_frequency
(
lo
=
LocalOscillator
(),
dt
=
telescope
(),
tracking_frequency
=
freq_HI
):
"""Sets the Local Oscillator to a frequency to correct for Doppler shift"""
dt_lat
=
np
.
deg2rad
(
52.812019
)
dt_lon
=
np
.
deg2rad
(
6.396169
)
dt_alt
=
25.0
for
pointing
in
dt
.
getJ2000
():
ra
=
pointing
[
'radec'
].
ra
.
to
(
u
.
rad
).
value
dec
=
pointing
[
'radec'
].
dec
.
to
(
u
.
rad
).
value
t
=
time
.
time
()
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_cmd
=
"/home/harm/bin/doppler_mb "
+
argstring
+
" "
+
str
(
tracking_frequency
)
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
if
__name__
==
'__main__'
:
track_frequency
()
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