Commit 1cddb090 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema

Start at 10 second, document outfile

parent 8c3077b6
*.dat
*.fil
*.pyc
*.ar
*.zap
*.med
*.psh
*.par
*.png*
......@@ -11,6 +11,7 @@ import os.path
import os
import sys
import re
import subprocess
import argparse
......@@ -51,6 +52,8 @@ def create_filterbank(source, infile=None, outfile=None, date=None, headeronly=F
date = Time(os.path.getctime(infile), format='unix')
else:
date = Time.now()
while date.datetime.second % 10 != 0:
date = Time.now()
else:
date = Time(date, format='isot')
......@@ -102,7 +105,9 @@ def create_filterbank(source, infile=None, outfile=None, date=None, headeronly=F
out.close()
cmd = "~dijkema/pulsar/pulsar_filterbank " + str(time) + " " + outfile
print("Running "+cmd)
#subprocess.Popen(cmd.split())
os.system(cmd)
print("\a")
return
# Read file
......@@ -134,7 +139,7 @@ def create_filterbank(source, infile=None, outfile=None, date=None, headeronly=F
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Create a filterbank file from the output of the CAMRAS backend in pulsar mode.")
parser.add_argument("sourcename", help="Name of the source, e.g. 'B0329+54'")
parser.add_argument("-o", "--outfile", help="Name of output file, e.g. 'B0329.fil'")
parser.add_argument("-o", "--outfile", help="Name of output file, e.g. 'B0329.fil'. Default: '2018-01-17-20:38:50_B0329+54.fil'")
parser.add_argument("-i", "--infile", help="Input CAMRAS pulsar file. If empty, it will start a new recording.")
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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment