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

Create a 2-bit to 8-bit utility per @telegraphic #55

Open
shamichatterjee opened this issue Aug 31, 2018 · 6 comments
Open

Create a 2-bit to 8-bit utility per @telegraphic #55

shamichatterjee opened this issue Aug 31, 2018 · 6 comments

Comments

@shamichatterjee
Copy link

f = Waterfall('ParkesHTRU.fil', t_start=7800000, t_stop=7850000)
f.info() -> Returns expected values from the header.
f.plot_waterfall() -> May or may not be doing the right thing, but at leas the axis labels look right.
But
f.plot_spectrum()
/opt/anaconda/lib/python3.6/site-packages/blimpy/filterbank.py in plot_spectrum(self, t, f_start, f_stop, logged, if_id, c, **kwargs)
546 plot_data = plot_data.mean()
547 else:
--> 548 raise RuntimeError("Unknown integration %s" % t)
549
550 # Rebin to max number of points
RuntimeError: Unknown integration all

I wonder if this is actually an error in unpacking the 2-bit data? If I try to read the data values I see values like
-4.6255555765569165e+303
6.807427090242793e+301
-1.570574712372553e+108
but plot_waterfall() seems to be working around it. Or is it? Is there a way to get access to the data array and directly imshow it, for example? When I do
d = f.data[:,0,:].transpose()
then d.shape is (1024, 50000), as expected (1024 channels, 50,000 time samples) but I get garbage when trying to imshow(d) because it looks like the 2-bit values aren't unpacked correctly.

Please let me know how to better document this error so that you can see the issue! Thanks.

@jeenriquez
Copy link
Contributor

Hi Shami, thanks for the report, could I ask which version of blimpy are you using?

Danny Price (@telegraphic) since you implemented the 2-bit handling I'm assigning this to you :)

@telegraphic
Copy link
Contributor

telegraphic commented Sep 3, 2018

Hey @shamichatterjee, does it work if you load the whole file? Can you point me toward a small 2-bit file with something interesting in it at a known location so I can work on it?

For 2-bit data you may be better off using sigpyproc (for now at least) - https://github.com/ewanbarr/sigpyproc

@shamichatterjee
Copy link
Author

@telegraphic sorry, I used a file from the Parkes HTRU archive and don't really have anything smaller, but Vishal G should be able to provide one. It sure looks like the 2-bit values are still packed and the combined value is interpreted as a (random) float when I try to access the array.

I installed the current version via downloading a zip file from GitHub - setup.py lists
version = '1.3.4'

I did try sigpyproc just now - it installed fine but trying to import led to a syntax error on a fairly innocuous line: raise ValueError,"readsamps must be > skipback value")
I'll try to look into that but I suspect that's maybe a mess.

@telegraphic
Copy link
Contributor

Labelling both a bug and an enhancement!

@telegraphic
Copy link
Contributor

This relates to #25, which I will close as a duplicate issue

@telegraphic
Copy link
Contributor

telegraphic commented Nov 30, 2018

After some discussion, we think that a better approach is to create a 2-bit to 8-bit utility, and will only support uint8 and above.

A error should be raised if data are 2-bit, with direction in the docstring to the 2to8 utility.

@texadactyl texadactyl changed the title 2 bit data - plot_spectrum RuntimeError: Unknown integration all Create a 2-bit to 8-bit utility per @telegraphic Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants