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
fb7a6678
Commit
fb7a6678
authored
Jan 21, 2018
by
Tammo Jan Dijkema
Browse files
Rename time to duration
parent
1cddb090
Changes
1
Hide whitespace changes
Inline
Side-by-side
tofil.py
View file @
fb7a6678
...
...
@@ -22,7 +22,7 @@ try:
except
:
print
(
"Could not connect to console, no RA/DEC recorded"
)
def
create_filterbank
(
source
,
infile
=
None
,
outfile
=
None
,
date
=
None
,
headeronly
=
False
,
centerfrequency
=
420.
,
time
=
30
):
def
create_filterbank
(
source
,
infile
=
None
,
outfile
=
None
,
date
=
None
,
headeronly
=
False
,
centerfrequency
=
420.
,
duration
=
30
):
"""
Create a filterbank file from the CAMRAS-format, which is generated
by pulsar_record.
...
...
@@ -103,7 +103,8 @@ def create_filterbank(source, infile=None, outfile=None, date=None, headeronly=F
if
not
infile
:
out
.
close
()
cmd
=
"~dijkema/pulsar/pulsar_filterbank "
+
str
(
time
)
+
" "
+
outfile
cmd
=
"/home/dijkema/pulsar/pulsar_filterbank "
+
str
(
duration
)
+
" "
+
outfile
cmd
=
"sleep "
+
str
(
duration
)
print
(
"Running "
+
cmd
)
#subprocess.Popen(cmd.split())
os
.
system
(
cmd
)
...
...
@@ -144,8 +145,8 @@ if __name__ == "__main__":
parser
.
add_argument
(
"-d"
,
"--date"
,
help
=
"Start date/time of observation, in 'isot' format (defaults to now, or creation date of infile)"
,
default
=
None
)
parser
.
add_argument
(
"--header"
,
help
=
"Only record a header"
,
default
=
False
,
action
=
"store_true"
)
parser
.
add_argument
(
"-f"
,
"--frequency"
,
help
=
"Center frequency in MHz, default: 420."
,
default
=
420.
,
type
=
float
)
parser
.
add_argument
(
"-t"
,
"--time"
,
help
=
"
Time
for observing in seconds, default: 300s (5min)"
,
default
=
300
)
parser
.
add_argument
(
"-t"
,
"--time"
,
help
=
"
Duration
for observing in seconds, default: 300s (5min)"
,
default
=
300
)
args
=
parser
.
parse_args
()
create_filterbank
(
args
.
sourcename
,
infile
=
args
.
infile
,
outfile
=
args
.
outfile
,
date
=
args
.
date
,
headeronly
=
args
.
header
,
centerfrequency
=
args
.
frequency
,
time
=
args
.
time
)
create_filterbank
(
args
.
sourcename
,
infile
=
args
.
infile
,
outfile
=
args
.
outfile
,
date
=
args
.
date
,
headeronly
=
args
.
header
,
centerfrequency
=
args
.
frequency
,
duration
=
args
.
time
)
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