Added warning of Anaconda/h5py bug for Win64 users.

Added check when plotting B-scan that there is more than one A-scan present.
这个提交包含在:
craig-warren
2015-10-06 09:58:27 +01:00
提交者 Craig Warren
父节点 6f5a746a78
当前提交 32ee1e5315

查看文件

@@ -21,6 +21,8 @@ import h5py
import numpy as np import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from gprMax.exceptions import CmdInputError
"""Plots B-scan.""" """Plots B-scan."""
# Parse command line arguments # Parse command line arguments
@@ -36,6 +38,10 @@ path = '/rxs/rx1'
f = h5py.File(file, 'r') f = h5py.File(file, 'r')
data = f[path + '/' + field] data = f[path + '/' + field]
# Check that there is more than one A-scan present
if data.shape[1] == 1:
raise raise CmdInputError('{} contains only a single A-scan.'.format(file))
# Plot B-scan image # Plot B-scan image
fig = plt.figure(num=file, figsize=(20, 10), facecolor='w', edgecolor='w') fig = plt.figure(num=file, figsize=(20, 10), facecolor='w', edgecolor='w')
plt.imshow(data, extent=[0, data.shape[1], data.shape[0]*f.attrs['dt'], 0], interpolation='nearest', aspect='auto', cmap='seismic', vmin=-np.amax(np.abs(data)), vmax=np.amax(np.abs(data))) plt.imshow(data, extent=[0, data.shape[1], data.shape[0]*f.attrs['dt'], 0], interpolation='nearest', aspect='auto', cmap='seismic', vmin=-np.amax(np.abs(data)), vmax=np.amax(np.abs(data)))