Skip to content

Commit

Permalink
Merge pull request #4 from erdc/apt_v200
Browse files Browse the repository at this point in the history
Fixed issue with netcdf file names and removed print statement.
  • Loading branch information
jlgutenson authored Jun 27, 2023
2 parents 17295be + 53f4e27 commit 89f11a6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions arc/netcdf_parse_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ def nc_file_worker(args):
station_count_values = []

# Open precip dataset
# assume if there is an issue opening the precip dataset it's because
# the file is still preliminary
# and test if the issue with NOAA's naming convention
# if the error persists, it must be something with the THREDDS server
try:
prcp_dataset = netCDF4.Dataset(nc_file[1], 'r')
Expand All @@ -251,8 +250,14 @@ def nc_file_worker(args):
nc_file_path = "{0}prelim.nc".format(nc_file_path)
prcp_dataset = netCDF4.Dataset(nc_file_path, 'r')
except:
print("It appears the nClimGrid-Daily THREDDS data service is experiecing issues, please try again...\n")
print("If the problems persists, please contact the nClimGrid-Daily team at [email protected]\n")
try:
nc_file_path = nc_file[1]
nc_file_path = nc_file_path[:-9]
nc_file_path = "{0}scaled.nc".format(nc_file_path)
prcp_dataset = netCDF4.Dataset(nc_file_path, 'r')
except:
print("It appears the nClimGrid-Daily THREDDS data service is experiecing issues, please try again...\n")
print("If the problems persists, please contact the nClimGrid-Daily team at [email protected]\n")

prcp = prcp_dataset.variables['prcp']
timevar = prcp_dataset.variables['time']
Expand Down Expand Up @@ -386,8 +391,6 @@ def __call__(self):

# remove "masked" returns from station count results
self.station_count_values = [x for x in self.station_count_values if x >= 0]
# self.station_count_values.remove("masked")
print(self.station_count_values)

print('----------')
print('')
Expand Down

0 comments on commit 89f11a6

Please sign in to comment.