Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
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
Container registry
Model registry
Operate
Environments
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
RTSD
HDL
Commits
359ec6a6
Commit
359ec6a6
authored
7 years ago
by
Daniel van der Schuur
Browse files
Options
Downloads
Patches
Plain Diff
Add script to point array by RA and DEC
(oostrum)
parent
4fa90d32
Branches
Branches containing commit
Tags
test
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/arts/commissioning/sc1/point_array_byradec.py
+92
-0
92 additions, 0 deletions
applications/arts/commissioning/sc1/point_array_byradec.py
with
92 additions
and
0 deletions
applications/arts/commissioning/sc1/point_array_byradec.py
0 → 100644
+
92
−
0
View file @
359ec6a6
#! /usr/bin/env python
#
# Boudewijn Hut, hut@astron.nl
# Edited to accept RA, DEC by Leon Oostrum, oostrum@astron.nl
'''
This script orchestrates APERTIFs full field of view experiment
'''
import
sys
import
socket
sys
.
path
.
insert
(
0
,
'
/opt/apertif/lib/python2.7/site-packages/
'
)
from
apertif.drivers.dcu.DCUBoards
import
DCUBoards
from
apertif.drivers.log.LOGBoards
import
LOGBoards
#import apertif.drivers.noisesrc.NoiseSource
from
apertif.drivers.uniboard.UniBoards
import
UniBoards
from
lofar.parameterset
import
parameterset
;
import
numpy
import
time
import
pickle
import
os
from
apertif.common.converters
import
convert_2_int_list
import
matplotlib.pyplot
as
plt
import
numpy
as
np
import
TechnicalCommissioning
as
tcx
import
itertools
import
struct
import
scipy.io
as
spio
import
pickle
DO_STOW
=
False
DO_POINT
=
True
def
get_ra_dec
(
ra
,
dec
):
ra
=
ra
.
split
(
'
:
'
)
ra
=
(
float
(
ra
[
0
])
+
float
(
ra
[
1
])
/
60
+
float
(
ra
[
2
])
/
3600
)
*
15
dec
=
dec
.
split
(
'
:
'
)
dec
=
float
(
dec
[
0
])
+
float
(
dec
[
1
])
/
60
+
float
(
dec
[
2
])
/
3600
def
main
():
# Assign source based on passed argument
try
:
src_ra
,
src_dec
=
sys
.
argv
[
1
:
3
]
except
ValueError
:
print
'
Both RA and DEC should be supplied
'
sys
.
exit
()
if
(
not
src_ra
[:
1
].
isdigit
())
or
(
not
src_dec
[:
1
].
isdigit
()):
print
'
Could not parse RA and/or DEC:
'
,
src_ra
,
src_dec
sys
.
exit
()
# Assign user passed dishes
telescopes
=
None
# implicit whole array
tel
=
'
rta
'
if
len
(
sys
.
argv
)
==
4
:
s
=
sys
.
argv
[
3
]
telescopes
=
[
i
for
i
in
s
.
split
(
'
,
'
)]
tel
=
telescopes
[
0
]
print
'
RA, DEC:
'
,
src_ra
,
src_dec
# check running on correct machine
tcx
.
check_host
()
exit_status
=
0
try
:
if
DO_STOW
:
tcx
.
stowarray
(
'
park
'
)
if
DO_POINT
:
tcx
.
output
(
'
Selected RA, DEC: %s %s
'
%
src_ra
,
src_dec
)
src_ra
,
src_dec
=
get_ra_dec
(
src_ra
,
src_dec
)
tcx
.
output
(
'
Determined source coordinates: (RA, dec) = (%d, %d) degree
'
%
(
src_RA
,
src_dec
))
tcx
.
output
(
'
Pointing telescopes RT2-RTD to %s: (RA, dec) = (%d, %d) degree
'
%
(
source
,
src_RA
,
src_dec
))
tcx
.
pointarray
(
src_RA
,
src_dec
,
telescopes
)
tcx
.
output
(
'
Checking %s to be on position
'
%
tel
.
upper
())
# check on-pos for a single telescope
tcx
.
wait_till_array_on_pointing
([
tel
])
tcx
.
output
(
'
%s is on position now
'
%
tel
.
upper
())
except
Exception
,
ex
:
print
sys
.
argv
[
0
]
+
'
Exception:
'
+
str
(
ex
)
raise
exit_status
=
1
finally
:
print
sys
.
argv
[
0
]
+
'
Finished
'
return
exit_status
if
__name__
==
'
__main__
'
:
#from sys import exit
exit
(
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