UCBerkeleySETI / blimpy

Breakthrough Listen I/O Methods for Python
https://blimpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
48 stars 41 forks source link

Add support for 'tim' filterbank files #15

Closed griffinfoster closed 5 years ago

griffinfoster commented 7 years ago

Time series files in sigproc, such as the output of dedisperse, are a type of filterbank file, data_type=2 in the header. The main difference is that they are frequency collapsed so there is no number of channels (nchans) or channel bandwidth (foff).

Using Filterbank() to load a tim filterbank file fails with:

In [1]: from filterbank import Filterbank

In [2]: Filterbank('Beam6_fb_D20150907T194703.buffer24.d32.dd262.tim')

KeyError Traceback (most recent call last)

in () ----> 1 Filterbank('Beam6_fb_D20150907T194703.buffer24.d32.dd262.tim') /usr/local/lib/python2.7/dist-packages/filterbank-1.0.0-py2.7.egg/filterbank/filterbank.pyc in __init__(self, filename, f_start, f_stop, t_start, t_stop, load_data, header_dict, data_array) 475 self.read_hdf5(filename, f_start, f_stop, t_start, t_stop, load_data) 476 else: --> 477 self.read_filterbank(filename, f_start, f_stop, t_start, t_stop, load_data) 478 else: 479 self.read_filterbank(filename, f_start, f_stop, t_start, t_stop, load_data) /usr/local/lib/python2.7/dist-packages/filterbank-1.0.0-py2.7.egg/filterbank/filterbank.pyc in read_filterbank(self, filename, f_start, f_stop, t_start, t_stop, load_data) 549 ## Setup frequency axis 550 f0 = self.header['fch1'] --> 551 f_delt = self.header['foff'] 552 553 # keep this seperate! KeyError: 'foff
telegraphic commented 7 years ago

That would be useful, feel like working on adding this?

griffinfoster commented 7 years ago

Yeah, I would be willing to do so. Though currently the code is pretty BL filterbank specific in terms of the functions and plotting. Is there a plan to split the filterbank class into an interface and call external functions?

jeenriquez commented 7 years ago

We have started to work in that direction. file_wrapper.py takes care of .fil and .h5 files. It is not general enough yet. filterbank2.py (which I'll rename soon) uses file_wrapper.py

jeenriquez commented 7 years ago

I guess this is solved now with blimpy

griffinfoster commented 7 years ago

I will leave this open for now until I implement the time series support.

jeenriquez commented 7 years ago

Hey Griffin, is there still for this? I don't have time to implement it myself.

jeenriquez commented 6 years ago

should we close this? or at least assign it to someone? @telegraphic @griffinfoster ?

telegraphic commented 5 years ago

closing for now, can reopen if this is requested again