Skip to content

Commit ccd0393

Browse files
committed
fixed problem, non-descript error when bathy's weren't relevant to the time period of choise
1 parent 2a83529 commit ccd0393

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

getDataFRF.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2747,9 +2747,13 @@ def getBathyIntegratedTransect(self, method=1, ForcedSurveyDate=None, **kwargs):
27472747
elif (self.bathydataindex == None or len(self.bathydataindex) < 1) & method == 1:
27482748
# there's no exact bathy match so find the max negative number where the negitive
27492749
# numbers are historical and the max would be the closest historical
2750-
val = (max([n for n in (self.ncfile['time'][:] - self.epochd1) if n < 0]))
2751-
idx = np.where((self.ncfile['time'][:] - self.epochd1) == val)[0][0]
2752-
print('Bathymetry is taken as closest in HISTORY - operational')
2750+
try:
2751+
val = (max([n for n in (self.ncfile['time'][:] - self.epochd1) if n < 0]))
2752+
idx = np.where((self.ncfile['time'][:] - self.epochd1) == val)[0][0]
2753+
print('Bathymetry is taken as closest in HISTORY - operational')
2754+
except ValueError:
2755+
raise NotImplementedError('need bathy that is historical to dates selected ')
2756+
27532757
elif (self.bathydataindex == None or np.size(self.bathydataindex) < 1) and method == 0:
27542758
idx = np.argmin(np.abs(self.ncfile['time'][:] - self.epochd1)) # closest in time
27552759
print('Bathymetry is taken as closest in TIME - NON-operational')

0 commit comments

Comments
 (0)