Commit 2e82f135 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Switch to python3

parent 8b0e8cf3
Pipeline #16 failed with stages
......@@ -103,7 +103,7 @@ def read_paramname(filfile, stdout=False):
return paramname
def read_hdr_val(filfile, stdout=False):
paramname = read_paramname(filfile, stdout)
paramname = read_paramname(filfile, stdout).decode('ascii')
if header_params[paramname] == 'd':
return paramname, read_doubleval(filfile, stdout)
elif header_params[paramname] == 'i':
......@@ -119,7 +119,7 @@ def read_hdr_val(filfile, stdout=False):
return None, None
def prep_string(string):
return struct.pack('i', len(string))+string
return struct.pack('i', len(string))+string.encode('ascii')
def prep_double(name, value):
return prep_string(name)+struct.pack('d', float(value))
#!/usr/bin/env python2
from __future__ import print_function
#!/usr/bin/env python3
import numpy as np
import filterbank
......@@ -7,6 +6,13 @@ import sigproc
from astropy.time import Time
from astropy import units as u
from camrasdevices import Receiver
have_hpib = True
except ImportError:
print("Could not connect to HPIB, skipping that")
have_hpib = False
import os.path
import os
import sys
......@@ -168,4 +174,8 @@ if __name__ == "__main__":
args = parser.parse_args()
if have_hpib:
rec = Receiver()
rec.frequency = args.frequency*1.e6
create_filterbank(args.sourcename, infile=args.infile, outfile=args.outfile,, headeronly=args.header, centerfrequency=args.frequency, duration=args.time, showprogressbar=True)
Supports Markdown
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