thepetabyteproject / your

Your Unified Reader
https://thepetabyteproject.github.io/your/
GNU General Public License v3.0
35 stars 25 forks source link

Add support for reading filterbank files with nsamples parameter in header #122

Open aaronpearlman opened 1 year ago

aaronpearlman commented 1 year ago

nsamples is a valid keyword parameter in the header of filterbank files.

Currently, when reading filterbank files with this keyword, the following warning appears:

WARNING:root:Unknown header parameter: nsamples. Skipping it and continuing. This may lead to incorrect header values.
WARNING:root:Skipping next 4 bytes of data.

This also results in an incorrect number of samples being read from the file.

This can be fixed simply by adding the following to the SigprocFile class in your/formats/pysigproc.py:

_type["nsamples"] = "int"
devanshkv commented 11 months ago

Thanks, @aaronpearlman, would you send a PR for the fix?