scottransom / presto

Open source pulsar search and analysis toolkit
http://www.cv.nrao.edu/~sransom/presto/
GNU General Public License v2.0
238 stars 174 forks source link

Issue with sigproc keyword signed #163

Closed pravirkr closed 2 years ago

pravirkr commented 2 years ago

Hi,

When writing sigproc filterbanks using sigpyproc, we get an offset of -1 sample with readfile. This issue is reported here: https://github.com/FRBs/sigpyproc3/issues/22

sigpyproc: samples written = 1024, header bytes = 389 readfile output: Spectra per file = 1023, bytes in file header = 392

I verified this using read_header in PRESTO sigproc.py and get hdrlen = 389

I think this is because of the keyword signed. The offset happens only when signed keyword is in the header. Possible fix (int -> char on line 332). https://github.com/scottransom/presto/blob/9e6d7ce40bbb584a7ff61b71ce4379ce7ad511c5/src/sigproc_fb.c#L328-L332

scottransom commented 2 years ago

yeah. That looks like the issue. I'll try to fix it now. Thanks!

scottransom commented 2 years ago

I think this should be fixed now. Please let me know if it isn't! And thanks for the report and the sleuthing!

sujaymate commented 2 years ago

I just checked it and it is working. Thanks for the fix.