Skip to content

Commit

Permalink
Merge pull request #271 from texadactyl/master
Browse files Browse the repository at this point in the history
Fix issue #270
  • Loading branch information
texadactyl authored Jul 22, 2022
2 parents d061f99 + 0928949 commit d5ad499
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion VERSION-HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ This file is a version history of blimpy amendments, beginning with version 2.0.
<br>
| 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). |
Expand Down
8 changes: 7 additions & 1 deletion blimpy/waterfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions tests/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
4 changes: 3 additions & 1 deletion tests/test_waterfall2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():

Expand Down Expand Up @@ -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__":
Expand Down

0 comments on commit d5ad499

Please sign in to comment.