Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with h52fil #41

Closed
mattlebofsky opened this issue Jul 11, 2018 · 4 comments · Fixed by #42
Closed

Bug with h52fil #41

mattlebofsky opened this issue Jul 11, 2018 · 4 comments · Fixed by #42
Assignees

Comments

@mattlebofsky
Copy link
Member

Trying to convert a filterbank file to hdf5 at GB using blimpy 1.2.1 (though I tried 1.2.0 and 1.1.8). And I get this error:

h52fil /mnt_bls4/datax3/holding/spliced_blc0001020304050607_guppi_57708_17466_HIP19335_0003.gpuspec.0002.h5 -o /datax3/users/sci -n filfromf5.fil
Traceback (most recent call last):
File "/opt/pyve/eepy/bin/h52fil", line 11, in
load_entry_point('blimpy==1.2.1', 'console_scripts', 'h52fil')()
File "/opt/pyve/eepy/local/lib/python2.7/site-packages/blimpy-1.2.1-py2.7.egg/blimpy/h52fil.py", line 60, in cmd_tool
make_fil_file(filename, out_dir = opts.out_dir, new_filename=opts.new_filename)
File "/opt/pyve/eepy/local/lib/python2.7/site-packages/blimpy-1.2.1-py2.7.egg/blimpy/h52fil.py", line 41, in make_fil_file
fil_file.write_to_fil(new_filename)
File "/opt/pyve/eepy/local/lib/python2.7/site-packages/blimpy-1.2.1-py2.7.egg/blimpy/waterfall.py", line 227, in write_to_fil
self.__write_to_fil_light(filename_out)
File "/opt/pyve/eepy/local/lib/python2.7/site-packages/blimpy-1.2.1-py2.7.egg/blimpy/waterfall.py", line 274, in __write_to_fil_light
fileh.write(generate_sigproc_header(self)) #generate_sigproc_header comes from sigproc.py
File "/opt/pyve/eepy/local/lib/python2.7/site-packages/blimpy-1.2.1-py2.7.egg/blimpy/sigproc.py", line 375, in generate_sigproc_header
header_string += to_sigproc_keyword(keyword, f.header[keyword])
File "/opt/pyve/eepy/local/lib/python2.7/site-packages/blimpy-1.2.1-py2.7.egg/blimpy/sigproc.py", line 350, in to_sigproc_keyword
return np.int32(len(keyword)).tostring() + keyword + value_dtype(value).tostring()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xaa in position 4: ordinal not in range(128)

Not sure how to proceed... I was told to create this issue...

@telegraphic
Copy link
Contributor

telegraphic commented Jul 11, 2018 via email

@mattlebofsky
Copy link
Member Author

mattlebofsky commented Jul 12, 2018 via email

telegraphic added a commit to telegraphic/blimpy that referenced this issue Jul 12, 2018
* Also moved 2-bit support to calc_n_ints_in_file
* Fixed read_header for Py2/Py3 (fixes issue UCBerkeleySETI#41)
@telegraphic
Copy link
Contributor

H'ok, I think this is fixed in my last set of changes. This was specifically related to Py2/Py3 compatibility (AGAIN). I also found a missing b in b'src_raj that was causing Py3 (and only Py3) to load the wrong Angle value to sigproc filterbank, converting hourangle into degrees. 🤕 🐍🐍🐍

@jeenriquez
Copy link
Contributor

Thanks Danny! I'm looking at all the changes and merging soon.
A conversation when you are here: what about stop supporting python2 by the end of the year? (But not earlier!!)

FX196 pushed a commit to FX196/blimpy that referenced this issue Jul 6, 2019
* Also moved 2-bit support to calc_n_ints_in_file
* Fixed read_header for Py2/Py3 (fixes issue UCBerkeleySETI#41)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants