Cleaned up use of filename input argument.

这个提交包含在:
Craig Warren
2016-03-22 18:04:07 +00:00
父节点 b13fe90637
当前提交 78e0efb06f

查看文件

@@ -35,8 +35,7 @@ parser.add_argument('-fft', action='store_true', default=False, help='plot FFT (
args = parser.parse_args() args = parser.parse_args()
# Open output file and read some attributes # Open output file and read some attributes
file = args.outputfile f = h5py.File(args.outputfile, 'r')
f = h5py.File(file, 'r')
nrx = f.attrs['nrx'] nrx = f.attrs['nrx']
dt = f.attrs['dt'] dt = f.attrs['dt']
iterations = f.attrs['Iterations'] iterations = f.attrs['Iterations']
@@ -45,7 +44,7 @@ time *= (iterations * dt)
# Check there are any receivers # Check there are any receivers
if nrx == 0: if nrx == 0:
raise CmdInputError('No receivers found in {}'.format(file)) raise CmdInputError('No receivers found in {}'.format(args.outputfile))
# Check for single output component when doing a FFT # Check for single output component when doing a FFT
if args.fft: if args.fft: