File tree 1 file changed +7
-10
lines changed
1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 12
12
import os
13
13
import json
14
14
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" )
15
20
16
21
# ----------------------------------------------------------------------
17
22
# Function to parse input arguments
@@ -549,7 +554,7 @@ def get_base_files():
549
554
if len (filesInfo ) == 0 :
550
555
try :
551
556
os .chdir ("UA/output" )
552
- get_base_files ()
557
+ filesInfo = get_base_files ()
553
558
except :
554
559
print ("No input files found!!" )
555
560
@@ -974,15 +979,7 @@ def main(args):
974
979
iAlt = args .alt
975
980
976
981
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
+
986
983
for iFile , fileInfo in enumerate (filesInfo ):
987
984
coreFile = fileInfo ['coreFile' ]
988
985
isNetCDF = fileInfo ['isNetCDF' ]
You can’t perform that action at this time.
0 commit comments