Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Commit

Permalink
Updated waterfall.py grab_data to fix UCBerkeleySETI#31 UCBerkeleySET…
Browse files Browse the repository at this point in the history
  • Loading branch information
telegraphic committed Jun 6, 2018
1 parent 1ef38cf commit 9a969f1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions blimpy/waterfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,20 @@ def grab_data(self, f_start=None, f_stop=None,t_start=None, t_stop=None, if_id=0
self.freqs = self.populate_freqs()
self.timestamps = self.populate_timestamps()

plot_f = self.freqs
plot_data = np.squeeze(self.data)
if f_start is None:
f_start = self.freqs[0]
if f_stop is None:
f_stop = self.freqs[-1]

i0 = np.argmin(np.abs(self.freqs - f_start))
i1 = np.argmin(np.abs(self.freqs - f_stop))

if i0 < i1:
plot_f = self.freqs[i0:i1 + 1]
plot_data = np.squeeze(self.data[t_start:t_stop, ..., i0:i1 + 1])
else:
plot_f = self.freqs[i1:i0 + 1]
plot_data = np.squeeze(self.data[t_start:t_stop, ..., i1:i0 + 1])

return plot_f, plot_data

Expand Down

0 comments on commit 9a969f1

Please sign in to comment.