Skip to content

Commit

Permalink
Merge 90d69d2 into 63a6af5
Browse files Browse the repository at this point in the history
  • Loading branch information
rjleveque committed Apr 16, 2019
2 parents 63a6af5 + 90d69d2 commit 2ee0976
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pyclaw/gauges.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ def read(self, gauge_id, path=None, use_pandas=False):
self.q = pandas.DataFrame()
else:
data = numpy.loadtxt(gauge_path, comments="#")
if data.ndim == 1:
# only one line in gauge file, expand to 2d array
data = data.reshape((1,len(data)))
self.level = data[:, 0].astype(numpy.int64)
self.t = data[:, 1]
self.q = data[:, 2:].transpose()
Expand Down Expand Up @@ -429,4 +432,4 @@ def check_old_gauge_data(path, gauge_id, new_gauge_path="./regression_data"):


fig = compare_gauges(paths, gauge_id, fields)
plt.show()
plt.show()

0 comments on commit 2ee0976

Please sign in to comment.