Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
62cb9791
Commit
62cb9791
authored
3 years ago
by
Taya Snijder
Browse files
Options
Downloads
Patches
Plain Diff
initial commit
parent
4975e485
No related branches found
No related tags found
2 merge requests
!232
Draft: Resolve L2SS-595 "Replace fpga weights rw"
,
!229
Resolve L2SS-554 "Delay pointing unit tests"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tangostationcontrol/tangostationcontrol/beam/old_test.py
+81
-0
81 additions, 0 deletions
tangostationcontrol/tangostationcontrol/beam/old_test.py
tangostationcontrol/tangostationcontrol/beam/test_delays.py
+62
-0
62 additions, 0 deletions
tangostationcontrol/tangostationcontrol/beam/test_delays.py
with
143 additions
and
0 deletions
tangostationcontrol/tangostationcontrol/beam/old_test.py
0 → 100644
+
81
−
0
View file @
62cb9791
import
datetime
from
delays
import
*
if
__name__
==
'
__main__
'
:
# # create a frame tied to the reference position
reference_itrf
=
[
3826577.066
,
461022.948
,
5064892.786
]
# CS002LBA, in ITRF2005 epoch 2012.5
d
=
delay_calculator
(
reference_itrf
)
# # set the timestamp to solve for
timestamp
=
datetime
.
datetime
(
2021
,
1
,
1
,
0
,
0
,
5
)
d
.
set_measure_time
(
timestamp
)
# compute the delays for an antennas w.r.t. the reference position
antenna_itrf
=
[[
3826923.546
,
460915.441
,
5064643.489
]]
# CS001LBA, in ITRF2005 epoch 2012.5
# # obtain the direction vector for a specific pointing
direction
=
"
J2000
"
,
"
0deg
"
,
"
0deg
"
# calculate the delays based on the set reference position, the set time and now the set direction and antenna positions.
delays
=
d
.
convert
(
direction
,
antenna_itrf
)
# print the delays
# pprint.pprint(delays)
#test changing the time
print
(
f
"
Changing timestamp test
\n
Base parametres: Direction:
{
direction
}
, position:
{
antenna_itrf
}
"
)
old_val
=
0
for
i
in
range
(
10
):
# # set the timestamp to solve for
timestamp
=
datetime
.
datetime
(
2021
,
1
,
1
,
0
,
i
,
5
)
d
.
set_measure_time
(
timestamp
)
old_val
=
delays
delays
=
d
.
convert
(
direction
,
antenna_itrf
)
diff
=
delays
[
0
]
-
old_val
# print the delays
print
(
f
"
Timestamp:
{
timestamp
}
:
{
delays
[
0
]
}
, diff:
{
diff
}
"
)
# reset time
timestamp
=
datetime
.
datetime
(
2021
,
1
,
1
,
0
,
0
,
5
)
d
.
set_measure_time
(
timestamp
)
#test changing the antenna position
print
(
f
"
Changing Antenna position test.
\n
Base parametres: Time:
{
timestamp
}
Direction:
{
direction
}
"
)
old_val
=
0
for
i
in
range
(
10
):
antenna_itrf
=
[[
3826577.066
+
i
,
461022.948
,
5064892.786
]]
# CS002LBA, in ITRF2005 epoch 2012.5
old_val
=
delays
delays
=
d
.
convert
(
direction
,
antenna_itrf
)
diff
=
delays
[
0
]
-
old_val
# print the delays
print
(
f
"
Antenna position:
{
antenna_itrf
}
:
{
delays
}
, diff:
{
diff
}
"
)
# test changing the direction
antenna_itrf
=
[[
3826923.546
,
460915.441
,
5064643.489
]]
# CS001LBA, in ITRF2005 epoch 2012.5
# antenna_itrf = [[0, 0, 0]] # CS001LBA, in ITRF2005 epoch 2012.5
print
(
f
"
Changing direction test.
\n
Base parametres: Time:
{
timestamp
}
, position:
{
antenna_itrf
}
"
)
old_val
=
0
for
i
in
range
(
12
):
deg
=
i
*
30
direction
=
"
J2000
"
,
f
"
0deg
"
,
f
"
{
deg
}
deg
"
old_val
=
delays
delays
=
d
.
convert
(
direction
,
antenna_itrf
)
diff
=
delays
[
0
]
-
old_val
# print the delays
print
(
f
"
Direction:
{
direction
}
:
{
delays
}
, diff:
{
diff
}
"
)
This diff is collapsed.
Click to expand it.
tangostationcontrol/tangostationcontrol/beam/test_delays.py
+
62
−
0
View file @
62cb9791
from
delays
import
*
from
tangostationcontrol.test
import
base
import
asyncio
import
mock
class
TestAttributeTypes
(
base
.
TestCase
):
def
setUp
(
self
):
# # create a frame tied to the reference position
reference_itrf
=
[
3826577.066
,
461022.948
,
5064892.786
]
# CS002LBA, in ITRF2005 epoch 2012.5
d
=
delay_calculator
(
reference_itrf
)
# # set the timestamp to solve for
timestamp
=
datetime
.
datetime
(
2021
,
1
,
1
,
0
,
0
,
5
)
d
.
set_measure_time
(
timestamp
)
# compute the delays for an antennas w.r.t. the reference position
antenna_itrf
=
[[
3826923.546
,
460915.441
,
5064643.489
]]
# CS001LBA, in ITRF2005 epoch 2012.5
# # obtain the direction vector for a specific pointing
direction
=
"
J2000
"
,
"
0deg
"
,
"
0deg
"
def
test_time_change
(
self
):
# # set the timestamp to solve for
timestamp
=
datetime
.
datetime
(
2021
,
1
,
1
,
0
,
i
,
5
)
d
.
set_measure_time
(
timestamp
)
delays
=
d
.
convert
(
direction
,
antenna_itrf
)
# print the delays
print
(
f
"
Timestamp:
{
timestamp
}
:
{
delays
}
"
)
def
test_direction_change
(
self
):
# test changing the direction
antenna_itrf
=
[[
3826923.546
,
460915.441
,
5064643.489
]]
# CS001LBA, in ITRF2005 epoch 2012.5
print
(
f
"
Changing direction test.
\n
Base parametres: Time:
{
timestamp
}
, position:
{
antenna_itrf
}
"
)
for
i
in
range
(
10
):
direction
=
"
J2000
"
,
f
"
{
i
}
deg
"
,
"
0deg
"
delays
=
d
.
convert
(
direction
,
antenna_itrf
)
# print the delays
print
(
f
"
Direction:
{
direction
}
:
{
delays
}
"
)
def
test_position_change
(
self
):
# test changing the antenna position
print
(
f
"
Changing Antenna position test.
\n
Base parametres: Time:
{
timestamp
}
Direction:
{
direction
}
"
)
for
i
in
range
(
10
):
antenna_itrf
=
[[
3826577.066
+
i
,
461022.948
,
5064892.786
]]
# CS002LBA, in ITRF2005 epoch 2012.5
delays
=
d
.
convert
(
direction
,
antenna_itrf
)
# print the delays
print
(
f
"
Antenna position:
{
antenna_itrf
}
:
{
delays
}
"
)
if
__name__
==
'
__main__
'
:
# # create a frame tied to the reference position
reference_itrf
=
[
3826577.066
,
461022.948
,
5064892.786
]
# CS002LBA, in ITRF2005 epoch 2012.5
...
...
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