Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor with recent changes #36

Merged
merged 66 commits into from
Jun 11, 2018
Merged
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
7d189f8
Consolidated blank_dc function
telegraphic Jun 3, 2018
2bdf80c
Removed unneccesary _flat_file_dimension
telegraphic Jun 3, 2018
c51574b
Modified calc_n_coarse_channels to support GBT and Parkes
telegraphic Jun 3, 2018
6259aba
Updated calc_n_blobs for readability
telegraphic Jun 3, 2018
7fe834c
PEP8: Classes FIL_reader and H5_reader -> FilReader and H5Reader
telegraphic Jun 3, 2018
c414291
Removing duplicated code from sigproc.py: header_keyword_types
telegraphic Jun 3, 2018
2ff2de9
Removing duplicated code from sigproc.py: fil_double_to_angle
telegraphic Jun 3, 2018
1ee6cbc
Removing duplicated code from sigproc.py: read_next_header_keyword
telegraphic Jun 3, 2018
19e04dc
Removing duplicated code from sigproc.py: read_header
telegraphic Jun 3, 2018
2f23a4e
Removing duplicated code from sigproc.py: len_header
telegraphic Jun 3, 2018
79d628b
Removed _ from read_header in H5 and Fil Readers
telegraphic Jun 3, 2018
11bdc7a
Shuffled order of methods so _methods first, then populate, etc
telegraphic Jun 3, 2018
2e63830
Renamed _get_n_ints_in_file to _setup_n_ints_in_file for consistency
telegraphic Jun 3, 2018
d83f7a2
Added a docstring and propagate return_idxs in read_header
telegraphic Jun 3, 2018
2a3721e
Delete unused struct import
telegraphic Jun 3, 2018
5ec6a05
Remove unused astropy units import
telegraphic Jun 3, 2018
55909fd
Typo and sanity check on read_header
telegraphic Jun 3, 2018
e5c0684
Adding basic test of Waterfall() reader
telegraphic Jun 3, 2018
df5e05a
set_useOffset raised an error (matplotlib version issue?), use rcParams
telegraphic Jun 3, 2018
6f5281d
Modify plot_time_series so unit test passes.
telegraphic Jun 3, 2018
0f75684
Minor tidy-up for PEP8
telegraphic Jun 3, 2018
eac357b
Removing unused imports and adding fail-over for non-package usage
telegraphic Jun 3, 2018
848e19c
Removed gen_from_header function in filterbank.py
telegraphic Jun 3, 2018
789cafe
Removed unsupported keyword arguments in read_hdf5
telegraphic Jun 3, 2018
602ee31
_find_blob_start tidy: doesn't actually use blob_dim in fil reader
telegraphic Jun 3, 2018
fd82448
Added new tests in test_compare_voyager
telegraphic Jun 3, 2018
a38b45d
Follow-up on removal of gen_from_header.
telegraphic Jun 3, 2018
9445558
Added deprecation notes in docstrings.
telegraphic Jun 3, 2018
b964099
Bumped version number
telegraphic Jun 3, 2018
c2f6330
Adding test_filterbank_voyager.py
telegraphic Jun 4, 2018
da1e15b
Updating unit tests
telegraphic Jun 4, 2018
f43c489
Fixes for Py3 support: division now in int() if integer output reqd
telegraphic Jun 5, 2018
93aeed7
Putting guppi test as TODO until test data is sourced
telegraphic Jun 5, 2018
cb4f0ce
Change tests to pytest
telegraphic Jun 5, 2018
7532977
Delete test_filterbank.py
telegraphic Jun 5, 2018
31c20a0
Updated to build h5py better
telegraphic Jun 5, 2018
1f65b7d
pesky () for Py3
telegraphic Jun 5, 2018
c1c30d6
pesky b"bytestrung" for Py3
telegraphic Jun 5, 2018
bb2e9d5
More bytestring Py3 shennanigans
telegraphic Jun 5, 2018
0a43a85
Even more bytestring Py3 shennanigans
telegraphic Jun 5, 2018
ecfc6af
Py3 throws a hissy fit with None comparisons, making these more robust
telegraphic Jun 5, 2018
c98d11f
Py3 freaks with None comparisons, making these more robust take 2
telegraphic Jun 5, 2018
63d7ace
Py3 freaks with None comparisons, making these more robust take 3
telegraphic Jun 5, 2018
bb4b9ce
Py3: Change to integer division
telegraphic Jun 5, 2018
0c3c042
Py3: Catch nonetype comparison
telegraphic Jun 5, 2018
9a9fdff
Py3: ensure computed f.seek indexes are integers
telegraphic Jun 5, 2018
efc9942
Updates for #31 #32 #33 #34 plotting issues
telegraphic Jun 5, 2018
b70ac1e
Adding ipython notebook for quick voyager tests
telegraphic Jun 5, 2018
2e6b778
Updates for #31 #32 #33 #34 plotting issues -- not all fixed.
telegraphic Jun 5, 2018
ed252c4
Py3 Print parenthesis.
telegraphic Jun 5, 2018
09e244b
Added unit tests for utils
telegraphic Jun 6, 2018
269f060
Unit tests now passing for Waterfall
telegraphic Jun 6, 2018
f341299
Added unpack unit tests
telegraphic Jun 6, 2018
1ef38cf
Fixed up unpack code and added unittests
telegraphic Jun 6, 2018
9a969f1
Updated waterfall.py grab_data to fix #31 #32 #33 #34
telegraphic Jun 6, 2018
49285f2
utils.py coverage now at 100%
telegraphic Jun 6, 2018
f006d5c
More Py3 parentheses
telegraphic Jun 6, 2018
5b81eb3
First attempt to add code coverage
telegraphic Jun 6, 2018
7a687e7
First attempt to add code coverage
telegraphic Jun 6, 2018
acd7003
First attempt to add code coverage
telegraphic Jun 6, 2018
4a1caec
Typo fix pin -> pip
telegraphic Jun 6, 2018
fcec275
Adding coveralls.io badge
telegraphic Jun 6, 2018
ee284c8
calc_n_coarse_channels not working at Parkes, changing logic to fix
telegraphic Jun 8, 2018
16591fc
Removing calc_n_coarse_chan from filterbank
telegraphic Jun 8, 2018
07dfc19
Removing unused arg from blob_start call
telegraphic Jun 10, 2018
a2d668a
None comparison edit in response to jeenriquez code review
telegraphic Jun 11, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Shuffled order of methods so _methods first, then populate, etc
  • Loading branch information
telegraphic committed Jun 3, 2018
commit 11bdc7a05469dd61f759968fea53ed5a95422874
67 changes: 35 additions & 32 deletions blimpy/file_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,28 +106,7 @@ def _setup_dtype(self):
elif self._n_bytes == 1:
return 'int8'

def populate_timestamps(self,update_header=False):
""" Populate time axis.
IF update_header then only return tstart
"""

#Check to see how many integrations requested
ii_start, ii_stop = 0, self.n_ints_in_file
if self.t_start:
ii_start = self.t_start
if self.t_stop:
ii_stop = self.t_stop

## Setup time axis
t0 = self.header['tstart']
t_delt = self.header['tsamp']

if update_header:
timestamps = ii_start * t_delt / 24./60./60 + t0
else:
timestamps = np.arange(ii_start, ii_stop) * t_delt / 24./60./60 + t0

return timestamps

def _calc_selection_size(self):
"""Calculate size of data of interest.
Expand All @@ -143,17 +122,6 @@ def _calc_selection_size(self):

return selection_size

def isheavy(self):
""" Check if the current selection is too large.
"""

selection_size_bytes = self._calc_selection_size()

if selection_size_bytes > self.MAX_DATA_ARRAY_SIZE:
return True
else:
return False

def _calc_selection_shape(self):
"""Calculate shape of data of interest.
"""
Expand Down Expand Up @@ -203,6 +171,29 @@ def _setup_freqs(self):
self.f_start = self.f_end - self.chan_stop_idx*abs(self.header['foff'])
self.f_stop = self.f_end - self.chan_start_idx*abs(self.header['foff'])

def populate_timestamps(self,update_header=False):
""" Populate time axis.
IF update_header then only return tstart
"""

#Check to see how many integrations requested
ii_start, ii_stop = 0, self.n_ints_in_file
if self.t_start:
ii_start = self.t_start
if self.t_stop:
ii_stop = self.t_stop

## Setup time axis
t0 = self.header['tstart']
t_delt = self.header['tsamp']

if update_header:
timestamps = ii_start * t_delt / 24./60./60 + t0
else:
timestamps = np.arange(ii_start, ii_stop) * t_delt / 24./60./60 + t0

return timestamps

def populate_freqs(self):
"""
Populate frequency axis
Expand Down Expand Up @@ -253,6 +244,18 @@ def calc_n_blobs(self, blob_dim):

return n_blobs

def isheavy(self):
""" Check if the current selection is too large.
"""

selection_size_bytes = self._calc_selection_size()

if selection_size_bytes > self.MAX_DATA_ARRAY_SIZE:
return True
else:
return False


class H5Reader(Reader):
""" This class handles .h5 files.
"""
Expand Down