forked from jDeters-USACE/Antecedent-Precipitation-Tool
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from erdc/apt_v200
Fixed issue with netcdf file names and removed print statement.
- Loading branch information
Showing
1 changed file
with
9 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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') | ||
|
@@ -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'] | ||
|
@@ -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('') | ||
|