scottransom / presto

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

Support sigproc keyword refdm. #164

Closed pravirkr closed 2 years ago

pravirkr commented 2 years ago

Adds the ability to read the refdm keyword in SIGPROC filterbank headers.

Currently, it results in (with readfile) ERROR: read_filterbank_header - unknown parameter: refdm

scottransom commented 2 years ago

Thanks for the PR on this. But I'm a bit confused: is refdm used for filterbank files? If so, what does it mean? I thought that it was only for time series.

And if it is used for filterbank files (i.e. maybe coherent DM used for each channel, or a DM used to subband a previous filterbank file), then PRESTO will possibly process the data incorrectly without an error since this PR doesn't handle it any way other than reading the parameter.

pravirkr commented 2 years ago

I am also not aware of any general use case of refdm for filterbank files. However, many filterbank packages (dspsr, sigproc, including sigproc.py in PRESTO) support reading this keyword (not utilized though, except for timeseries). So readfile should at least allow parsing refdm and not throw an error.

I am not sure how much PRESTO internals need to be changed if the refdm also reflects the state of data in the file. I plan to utilize refdm in sigpyproc to read/write a block of dedispersed data as filterbanks.

What do you suggest? Maybe we can allow this PR for refdm = 0 cases and add a warning perhaps for other values.

scottransom commented 2 years ago

OK. Fair enough. I guess I was just wondering if there was a need for PRESTO to do more with that flag if it exists. And I guess the answer is no (at least for now). Given that, I see no harm in merging this. Thanks!