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
filterbank
Commits
956a5088
Commit
956a5088
authored
Jan 11, 2018
by
Tammo Jan Dijkema
Browse files
Read az/el and ra/dec from telescope
parent
db1d5bb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
tofil.py
View file @
956a5088
...
...
@@ -13,6 +13,14 @@ import re
import
argparse
telescope_found
=
False
try
:
from
telescope
import
telescope
dt
=
telescope
(
consoleHost
=
'console'
)
telescope_found
=
True
except
:
print
(
"Could not connect to console, no RA/DEC recorded"
)
def
create_filterbank
(
infile
=
None
,
outfile
=
None
,
date
=
None
,
source
=
None
):
"""
Create a filterbank file from the CAMRAS-format, which is generated
...
...
@@ -48,6 +56,16 @@ def create_filterbank(infile=None, outfile=None, date=None, source=None):
else
:
date
=
Time
(
date
,
format
=
'isot'
)
az_start
=
0.
za_start
=
0.
src_raj
=
0.
src_dej
=
0.
if
telescope_found
:
az_start
=
(
180
*
u
.
deg
+
dt
.
getAzEl
()[
0
]).
to
(
u
.
rad
).
value
za_start
=
(
90
*
u
.
deg
-
dt
.
getAzEl
()[
1
]).
to
(
u
.
rad
).
value
src_raj
=
dt
.
getRaDec
().
ra
.
to_string
(
unit
=
u
.
hour
,
sep
=
''
)
src_dej
=
dt
.
getRaDec
().
dec
.
to_string
(
unit
=
u
.
degree
,
sep
=
''
)
print
(
"Input file: {}"
.
format
(
infile
))
print
(
"Output file: {}"
.
format
(
outfile
))
print
(
"Source name: {}"
.
format
(
source
))
...
...
@@ -69,10 +87,10 @@ def create_filterbank(infile=None, outfile=None, date=None, source=None):
fil_header
[
"source_name"
]
=
source
fil_header
[
"barycentric"
]
=
0
fil_header
[
"pulsarcentric"
]
=
0
fil_header
[
"az_start"
]
=
0.0
fil_header
[
"za_start"
]
=
0.0
fil_header
[
"src_raj"
]
=
0.0
fil_header
[
"src_dej"
]
=
0.0
fil_header
[
"az_start"
]
=
az_start
fil_header
[
"za_start"
]
=
za_start
fil_header
[
"src_raj"
]
=
src_raj
fil_header
[
"src_dej"
]
=
src_dej
fil_header
[
"tstart"
]
=
date
fil_header
[
"tsamp"
]
=
0.00046811428571414528
# 1.0/35e6*256 chans*64 decimation
fil_header
[
"nbits"
]
=
16
...
...
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