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

RuntimeError: nbits=1 not supported #116

Closed
mabaisen opened this issue Jul 8, 2023 · 4 comments
Closed

RuntimeError: nbits=1 not supported #116

mabaisen opened this issue Jul 8, 2023 · 4 comments
Assignees
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@mabaisen
Copy link

mabaisen commented Jul 8, 2023

Hello, when i run your tutorial about "Candidate class to analyse single pulses".
i have the problem below:
Traceback (most recent call last):
File "/home/mbs/Desktop/mycode/fetch-tf2/your_candmaker.py", line 40, in
cand.get_chunk()
File "/home/mbs/miniconda3/envs/rdkit-smiles/lib/python3.7/site-packages/your/candidate.py", line 218, in get_chunk
data = self.get_data(nstart=nstart_read, nsamp=nsamp_read)
File "/home/mbs/miniconda3/envs/rdkit-smiles/lib/python3.7/site-packages/your/your.py", line 255, in get_data
data = self.formatclass.get_data(self, nstart, nsamp, pol=pol, npoln=npoln)
File "/home/mbs/miniconda3/envs/rdkit-smiles/lib/python3.7/site-packages/your/formats/pysigproc.py", line 306, in get_data
self._mmdata[int(b0) : int(b1)], dtype=self.dtype
File "/home/mbs/miniconda3/envs/rdkit-smiles/lib/python3.7/site-packages/your/formats/pysigproc.py", line 251, in dtype
raise RuntimeError("nbits=%d not supported" % self.nbits)
RuntimeError: nbits=1 not supported

My fil header is below:
Unified Header:
"basename": "BJ0009_025C1"
"bw": -288.0
"center_freq": 1374.0
"dec_deg": -40.98771722222223
"dtype": "uint8"
"fch1": 1516.5
"filelist": [
"data/BJ0009_025C1.fil"
]
"filename": "data/BJ0009_025C1.fil"
"foff": -3.0
"format": "fil"
"frequency_decimation_factor": 1
"gb": -20.446928712599487
"gl": 176.3830098025743
"native_foff": -3.0
"native_nbits": 1
"native_nchans": 96
"native_nspectra": 2121728.0
"native_tsamp": 0.000125
"nbits": 8
"nchans": 96
"npol": 1
"nspectra": 2121728
"poln_order": "I"
"ra_deg": 287.1500545833334
"source_name": "Unknown"
"time_decimation_factor": 1
"tsamp": 0.000125
"tstart": 51934.01997685185
"tstart_utc": "2001-01-25T00:28:46.000"

Could you help me what's the problem i have encountered.

@mabaisen mabaisen added the bug Something isn't working label Jul 8, 2023
@devanshkv
Copy link
Member

As mentioned in the error, nbits=1 is not supported. If you can contribute to the package and send a PR, we will happily incorporate it.

One trick would do would be to add np.bool_ for nbits=1 here:

if self.nbits == 8:
return numpy.uint8
elif self.nbits == 16:
return numpy.uint16
elif self.nbits == 32:
return numpy.float32
else:
raise RuntimeError("nbits=%d not supported" % self.nbits)

@devanshkv devanshkv self-assigned this Jul 8, 2023
@devanshkv
Copy link
Member

@mabaisen, can you share a sample 1-bit filterbank?

@mabaisen
Copy link
Author

Thank you for your help. I download the filterbank from "https://data-portal.hpc.swin.edu.au/dataset/parkes-frbs-archival-data".
I used the first filterbank in FRB010125.tar.gz run your_candmaker

@stale
Copy link

stale bot commented Aug 10, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Aug 10, 2023
@stale stale bot closed this as completed Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants