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
4bb411b8
Commit
4bb411b8
authored
Apr 17, 2018
by
Tammo Jan Dijkema
Browse files
Make trackHI a separate script
parent
0c8ccc6f
Changes
3
Show whitespace changes
Inline
Side-by-side
setup.py
View file @
4bb411b8
...
...
@@ -8,8 +8,10 @@ meta = dict(name='hpib',
author_email
=
'harm.munk@camras.nl'
,
description
=
'Controlling HPIB-software in the CAMRAS Dwingeloo Radio Telescope'
,
platforms
=
'Linux, Mac OSX'
,
py_modules
=
[
'hpib'
,
'camrasdevices'
],
scripts
=
[
'trackHI.py'
],
py_modules
=
[
'hpib'
,
'camrasdevices'
,
'trackHI'
],
entry_points
=
{
'console_scripts'
:
[
'trackHI=trackHI:main'
],
},
install_requires
=
[
'pyserial'
]
)
...
...
trackHI
0 → 100755
View file @
4bb411b8
#!/usr/bin/env python
import
astropy.units
as
u
import
argparse
import
track_hi
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"
,
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
=
freq_HI
,
type
=
float
)
args
=
parser
.
parse_arguments
()
track_hi
.
track_frequency
(
tracking_frequency
=
args
.
frequency
,
doppler_executable
=
args
.
doppler_executable
)
if
__name__
==
'__main__'
:
main
()
track_hi.py
100755 → 100644
View file @
4bb411b8
#!/usr/bin/env python
import
astropy.units
as
u
import
numpy
as
np
import
argparse
import
subprocess
...
...
@@ -9,10 +9,10 @@ from camrasdevices import Receiver, LocalOscillator
import
time
freq_
HI
=
1420.405751
freq_
hi
=
1420.405751
def
track_frequency
(
lo
=
LocalOscillator
(),
dt
=
telescope
(),
tracking_frequency
=
freq_
HI
,
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
)
...
...
@@ -31,5 +31,15 @@ def track_frequency(lo=LocalOscillator(), dt=telescope(),
dfreq
=
1000.0
+
tracking_frequency
-
freq_doppler
lo
.
frequency
=
dfreq
*
1e6
if
__name__
==
'__main__'
:
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
()
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