Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tracking-scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tammo Jan Dijkema
tracking-scripts
Commits
2164c92d
Commit
2164c92d
authored
1 month ago
by
Thomas Telkamp
Browse files
Options
Downloads
Patches
Plain Diff
script to add LSR correction data as tracking extended context
parent
22464416
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
track_lsr_dt_vrt.py
+107
-0
107 additions, 0 deletions
track_lsr_dt_vrt.py
with
107 additions
and
0 deletions
track_lsr_dt_vrt.py
0 → 100755
+
107
−
0
View file @
2164c92d
#!/usr/bin/env python3
"""
Add LSR tracking data to VRT stream
Usage: track_lsr_dt_vrt.py console
Make sure the console is tracking J2000 coordinates and tracking is enabled.
"""
from
astropy.coordinates
import
EarthLocation
,
Angle
from
astropy.coordinates
import
SkyCoord
,
AltAz
,
ICRS
,
get_body
from
astropy.time
import
Time
import
astropy.table
import
re
import
os
import
astropy.units
as
u
import
time
import
numpy
as
np
from
argparse
import
ArgumentParser
from
telescope
import
Telescope
from
vrtzmq
import
TrackingPublisher
import
logging
import
vlsr
logger
=
logging
.
getLogger
(
__name__
)
# freq_hi = 1420.405751e6
def
main
():
parser
=
ArgumentParser
(
description
=
"
Add LSR tracking data to VRT stream for the Dwingeloo Telescope
"
)
parser
.
add_argument
(
"
consoleHost
"
,
help
=
"
Address of the console
"
)
args
=
parser
.
parse_args
()
track_lsr
(
args
.
consoleHost
)
def
track_lsr
(
consoleHost
):
f0
=
1e9
;
dt
=
Telescope
(
consoleHost
=
consoleHost
,
setmode
=
'
J2000
'
,
waitForFirstUpdate
=
False
)
time
.
sleep
(
2
)
dwingeloo
=
EarthLocation
(
lat
=
52.81213723180477
,
lon
=
6.396346463227839
,
height
=
70.26
,
ellipsoid
=
"
WGS84
"
)
tracking_publisher
=
TrackingPublisher
()
time_last_update
=
Time
.
now
()
-
60
*
u
.
s
print
(
"
time_utc, v, f0, doppler, f_dop, doppler_rate
"
);
while
dt
is
None
or
dt
.
is_connected
:
current_radec
=
dt
.
getRaDec
();
now
=
Time
.
now
()
current_altaz
=
current_radec
.
transform_to
(
AltAz
(
obstime
=
now
,
location
=
dwingeloo
))
v
=
vlsr
.
vlsr
(
now
,
dwingeloo
,
current_radec
).
to
(
u
.
m
/
u
.
s
).
value
;
f_dop
=
(
1
-
v
/
299792458.0
)
*
f0
;
doppler
=
f_dop
-
f0
;
v_min_5
=
vlsr
.
vlsr
(
now
-
5
*
u
.
s
,
dwingeloo
,
current_radec
).
to
(
u
.
m
/
u
.
s
).
value
;
v_plus_5
=
vlsr
.
vlsr
(
now
+
5
*
u
.
s
,
dwingeloo
,
current_radec
).
to
(
u
.
m
/
u
.
s
).
value
;
dv
=
(
v_plus_5
-
v_min_5
)
/
10
;
doppler_rate
=
(
1
-
dv
/
299792458.0
)
*
f0
-
f0
;
data_to_send
=
{
"
object_name
"
:
"
DT
"
,
"
tracking_source
"
:
"
LSR
"
,
"
object_id
"
:
0
,
"
azimuth
"
:
current_altaz
.
az
.
deg
,
"
elevation
"
:
current_altaz
.
alt
.
deg
,
"
ra
"
:
current_radec
.
ra
.
deg
,
"
dec
"
:
current_radec
.
dec
.
deg
,
"
distance
"
:
0
,
"
speed
"
:
v
,
"
frequency
"
:
0
,
"
doppler
"
:
doppler
,
"
doppler_rate
"
:
doppler_rate
}
tracking_publisher
.
send
(
now
.
unix
,
data_to_send
);
if
(
Time
.
now
()
>
time_last_update
+
1
*
u
.
s
):
print
(
f
"
{
now
.
isot
}
,
{
v
:
.
2
f
}
,
{
1e9
:
.
0
f
}
,
{
doppler
:
.
2
f
}
,
{
f_dop
:
.
2
f
}
,
{
doppler_rate
:
.
6
f
}
"
);
time
.
sleep
(
0.075
)
if
__name__
==
"
__main__
"
:
# logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO)
main
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment