Skip to content

Commit 30fa3dd

Browse files
committed
BUG: Whoops prev commit on postprocessor was missing two pieces
1 parent 5ef672e commit 30fa3dd

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

srcPython/postAether.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
import os
1313
import json
1414
from struct import unpack
15+
try:
16+
from netCDF4 import Dataset
17+
from h5py import File
18+
except InputError:
19+
print("NetCDF and/or h5py not found")
1520

1621
# ----------------------------------------------------------------------
1722
# Function to parse input arguments
@@ -549,7 +554,7 @@ def get_base_files():
549554
if len(filesInfo) == 0:
550555
try:
551556
os.chdir("UA/output")
552-
get_base_files()
557+
filesInfo = get_base_files()
553558
except:
554559
print("No input files found!!")
555560

@@ -974,15 +979,7 @@ def main(args):
974979
iAlt = args.alt
975980

976981
output_netcdf = False if args.hdf5 else True
977-
978-
if filesInfo[0]['isNetCDF']:
979-
try:
980-
from netCDF4 import Dataset
981-
from h5py import File
982-
except InputError:
983-
raise InputError(
984-
"Attempting to postprocess NetCDF files, but NetCDF is not installed for Python")
985-
982+
986983
for iFile, fileInfo in enumerate(filesInfo):
987984
coreFile = fileInfo['coreFile']
988985
isNetCDF = fileInfo['isNetCDF']

0 commit comments

Comments
 (0)