diff --git a/VERSION-HISTORY.md b/VERSION-HISTORY.md index 341512b..146daaf 100644 --- a/VERSION-HISTORY.md +++ b/VERSION-HISTORY.md @@ -3,7 +3,8 @@ This file is a version history of blimpy amendments, beginning with version 2.0.
| Date | Version | Contents | | :--: | :--: | :-- | -| 2022-07-20 | 2.1.1 | Mods to Waterfall class, an alternative to file loading (issue #264). | +| 2022-07-22 | 2.1.2 | More container fields needed (issue #270). | +| 2022-07-21 | 2.1.1 | New Waterfall class option, an alternative to file loading (issue #264). | | 2022-07-08 | 2.1.0 | New utility: dsamp (issue #267). | | 2022-04-19 | 2.0.40 | Fixed blimpy to show plots when the display supports it (issue #263). | | 2022-03-30 | 2.0.39 | examine_h5 in hdf_reader.py is loading too much data (issue #261). | diff --git a/blimpy/waterfall.py b/blimpy/waterfall.py index 88bd593..5514a75 100755 --- a/blimpy/waterfall.py +++ b/blimpy/waterfall.py @@ -82,11 +82,13 @@ def _init_alternate(self, header_dict, data, filename=None): self.file_size_bytes = 0 # The Waterfall "container": - class Container(): + from blimpy.io.base_reader import Reader + class Container(Reader): n_beams_in_file = 1 n_pols_in_file = 1 _d_type = np.float32 t_begin = 0 + t_start = 0 freq_axis = 2 time_axis = 0 beam_axis = 1 @@ -102,6 +104,10 @@ class Container(): self.container.f_start = self.container.f_begin self.container.f_stop = self.container.f_end self.container.t_end = data.shape[0] + self.container.t_stop = data.shape[0] + self.container.selection_shape = data.shape + self.container.n_ints_in_file = data.shape[0] + self.container.header = header_dict # Set Waterfall object properties. self.header = header_dict diff --git a/setup.py b/setup.py index 1851322..6c4136d 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ """ from setuptools import setup, find_packages -__version__ = '2.1.1' +__version__ = '2.1.2' with open("README.md", "r") as fh: long_description = fh.read() diff --git a/tests/data.py b/tests/data.py index 214ec1a..463624b 100644 --- a/tests/data.py +++ b/tests/data.py @@ -8,3 +8,4 @@ voyager_block1 = path.join(here, 'test_data/Voyager1_block1.npy') test_ifs_fil = path.join(here, 'test_data/test_ifs.fil') test_h5 = path.join(here, 'test_data/test.h5') +test_fil = path.join(here, 'test_data/test.fil') diff --git a/tests/test_waterfall2.py b/tests/test_waterfall2.py index c968d86..323f881 100644 --- a/tests/test_waterfall2.py +++ b/tests/test_waterfall2.py @@ -2,7 +2,7 @@ from astropy import units as u from astropy.coordinates import Angle import blimpy as bl -from tests.data import voyager_h5 +from tests.data import voyager_h5, test_h5, test_fil def test_waterfall_stream_1(): @@ -41,6 +41,8 @@ def test_waterfall_stream_2(): wf_voya1 = bl.Waterfall(voyager_h5) wf_voya2 = bl.Waterfall(header_dict=wf_voya1.header, data_array=wf_voya1.data) wf_voya2.info() + wf_voya2.write_to_hdf5(test_h5) + wf_voya2.write_to_fil(test_fil) if __name__ == "__main__":